r/PowerShell • u/rogueit • Jun 12 '26
Question Migrate large csv to which sql platform
I have a hobby that generates a lot of lines in a csv. What sql should I migrate my csv to. It’s getting large and I’m afraid disaster is on the horizon. So before that. Which sql will run well on win 11 and doesn’t require much resources.
10
Upvotes
17
u/jasonvelocity Jun 12 '26
They all run fine, tell us about the hobby.
11
u/OsuOzland Jun 12 '26
Sqlite maybe?
7
u/mrmattipants Jun 12 '26 edited Jun 12 '26
MySQL, MariaDb, PostgreSQL, SQL Server Express, SQLite3, etc. They'll all do the trick.
It depends on your preferences. Personally, I tend to use SQLite3, when I need something that doesn't require a lot of resources.
https://sqlite.org/download.html
The reason I prefer it over the others, is because SQLite is both serverless (it requires no additional services running in the background) and completely portable (I have .db files I built over a decade back that I'm confident will open on just about any system) by design.
That being said, if interested, you can use the PSSQLite Module to Import your CSV Data (there are also a few .NET Libraries, if you prefer to go that route).
http://ramblingcookiemonster.github.io/SQLite-and-PowerShell/
https://github.com/RamblingCookieMonster/PSSQLite
If you prefer to use a GUI for the initial conversion process, check out SQLiteStudio.
https://sourceforge.net/projects/sqlitestudio.mirror/
It also has an option for importing CSVs.
https://www.drlinkcheck.com/blog/sqlite-query-csv-files
4
u/jortony Jun 12 '26
Why SQL at all? If CSV is the native output, then Parquet might be the easiest option. SQL is great for transactional DB workloads, but Parquet is just efficient storage of columnar data for analytics workloads
3
u/JeremyLC Jun 12 '26
PSSQLite might work, and I believe it doesn’t require any server setup. It looks like there are also modules for MySQL and PostgreSQL.
3
u/Kemeros Jun 12 '26 edited Jun 12 '26
Look into SQLite. It's a self contained DB. The most used in the world. Portable too. No server needed.
Don't forget to backup!
Edit: Oh and it's open source.
Edit2: I would avoid SQL Express/Microsoft SQL, MySQL and PostgreSQL unless you feel like maintaining a Server/VM or having a server's services running on the same computer.
4
u/LAN_Mind Jun 12 '26
Sql express is free.
1
u/jeffrey_f Jun 12 '26
SQL Express. It can ingest that file without much issue. 10GB is the max size of a DB.
DO MAKE A BACKUP of the original before working with it, and work from the copy.
1
u/UpbeatCup3739 Jun 12 '26
For work I have had a project which started to exceed what I could manage in CSV. I’ve migrated to PostgreSQL in a Docker container works perfectly.
1
u/LogMonkey0 Jun 12 '26
Sqlite would be a good option
1
u/konikpk Jun 15 '26
What is "lot of lines" ?
1
u/melihbirim Aug 14 '26
Honestly, real answer is SQLite. But actually means to you: if the real pain is just "querying this CSV is getting slow/annoying," not data loss, you don't have to migrate at all.
Tools like DuckDB or csvql (I'm the maintainer, disclosure) can query a CSV directly and fast without ingesting it into anything.
1
u/justaguyonthebus Jun 15 '26
MS SQL Server Express is a good option because it's the full SQL Server engine with appropriate limits for dev and personal use. Pair that with the powershell DBATools.