Skip to content

m-a-g-i-c/csv-to-sql-importer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

"Script" that imports data from csv into postgres.

Stack:

  • openjdk-21
  • Hikari-CP
  • pure jdbc, no ORM
  • apache.commons-csv

Tests

No tests. Real men test in production 🤠 (I was lazy and tested right away).

Local run

Unfortunately I was too lazy to create configurable solution, so I just manually changed required properties in the code🤠🦥

Motivation:

Existing data import solutions did not meet my needs, so I wrote this program for my specific use-case only.

IntelliJ IDEA 2024.3.2.2 (Ultimate Edition) db plugin

  • Unable to import data from CSV and specify date format for columns.

Bug ticket still not resolved in 2025! 😀 https://youtrack.jetbrains.com/issue/DBE-7569/Respect-timestamp-date-time-format-for-import-export-or-allow-to-configure-it-on-thy-fly

Standard postgres COPY or \copy

  • Unable to specify date-format for csv column.
  • Fails when encountering inconsistent data.

DBeaver

Supports specifying a date format, making it almost perfect for my case. But I faced multiple OutOfMemory errors when I was trying to tune performance for importing:

  • I was trying different values for batch size (100,250,500,1000).
  • Enabling/disabling "create new connection" Additionally, I had no control over invalid records in CSV file.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages