Back in September 2025, David Fetter asked on IRC, about a tool to quickly load CSV to database. One that would require minimal configuration, will try to figure out as much as possible on its own.
I thought that it would be great idea. Plus, I'm trying to learn more JavaScript / Node, so figured I can try.
Work and life intervened, and I couldn't get to it.
In the mean time I also read a lot of praise for some AI tools for quickly starting projects, or adding functionality, or learning new stuff. So, I decided to try.
Used Claude to make the basics, and then worked to add more tests and functionality.
Long story short, the tool is here.
It does what David wanted – works as simply as possible. Assuming you have your environment configured, you can just:
=$ pg_csv_loader some_file.csv
And it will figure out delimiter, quote character, column names, datatypes, and will load it to default database – which works just like normal psql
Tested it on couple different csv files, and it seems to work. It also handled PostgreSQL csv logs, which are often problematic as they use literal new line characters, which is causing problems for some parsers.
I don't claim that I wrote it, but I did extend tests, and datatype detection, so I guess I have some partial credit 🙂
Hope you'll find it useful.