by throw_m239339 · 5y ago · 0 comments
Wow, finally. I Love SQlite. It saved my a* in so much projects where I had to implement an ETL, I just spawned some in memory SQLite database instead of writing some painful custom code in Language X or Z over and over again. Also used it to generate static search results in a flat file blogging platform since it does have some full text search capabilities. And let's not even talk about custom functions, including custom aggregation functions, in any client language, directly in your application code...
Buddy, google DuckDB, it's like OLAP SQLite. You'll thank me later.
The hosting company I have to work with has a very old version of SQLite installed on the server and they don't want to update it. So I was looking at whether I could replace it with DuckDB since it seems to be easy to install with pip.
pysqlite3-binary is a Linux only package in PyPI that includes a recent version of SQLite
apsw is a cross-platform package, it brings in a modern version as well, and additionally exposes everything SQLite can do (useful for me, you can write VFS drivers in python for it). The version of apsw in pypi is hopelessly out of date, the homepage has more details on how to install the latest version.
I have tried many different ways of importing the data with no luck. Usually it turned into a memory issue. This was irrespective of how I tried to import, whether it was in batches through a script, or using the built-in import functionality, or breaking the data into chunks prior to import, or anything else I tried. I occasionally keep trying to find a way, because I like the idea and features of DuckDB so much.
Of note, MonetDB slurped it right in without issue, but I would much rather use something not so "heavy" like DuckDB.
Also, regarding SQLite, I have DBs with billions of rows that work flawlessly, though not as fast as postgres.
edit: added a better link, the stand-alone mode is called clickhouse-local
https://clickhouse.tech/docs/en/interfaces/cli
https://altinity.com/blog/2019/6/11/clickhouse-local-the-pow...
It was #1 for me! Finally indeed.