Show HN: Embed an SQLite database in your PostgreSQL table
81–90 of 116 posts
Re: Show HN: Embed an SQLite database in your PostgreSQL table
#82Re: Show HN: Embed an SQLite database in your PostgreSQL table
#83Yo, dawg, I heard you like databases... This is nuts. I can't think of a use for it, but I'm sure it's "a solution that will eventually find a problem".
Re: Show HN: Embed an SQLite database in your PostgreSQL table
#84Re: Show HN: Embed an SQLite database in your PostgreSQL table
#85Ok, hear me out: what if we make something that takes a postgres database dir, tars it together and encodes it as a binary blob in SQLite? We could have SQLite within postgres within sqlite within postgres! Is it practical or even slightly useful? Of course not - but it's SQL databases all the way down. Not that this is a good thing in itself.
Re: Show HN: Embed an SQLite database in your PostgreSQL table
#86Speed, anyone? How long does it take to update a table of, say, 1k rows? 1m rows? Same when subqueries and joins are involved to calculate what's to be updated?
The current implementation is writing out the DB to `/tmp` then reading the resulting file back and writing it to the column. So on the bright side updating 1k rows takes the same amount of time as updating one row. On the other hand every write is a full table write (actually two). I don't think there is a way to do this efficently with the current API as PostgreSQL is MVCC so it needs to write out each version sepa…
I think there was already another comment where someone told OP how to solve that.
Re: Show HN: Embed an SQLite database in your PostgreSQL table
#87Earlier quoted context omitted.
> managing schema-per-tenant at our scale sounds like a complexity nightmare. The per-tenant schema could be the tenant's responsibility. Most non-technical users can handle the idea of tables & columns, assuming you leverage UI/UX patterns they are already familiar with.
Our UI looks like a table: https://www.notion.so/help/intro-to-databases As long as we never add new features, never need to change how we map UI Postgres DDL, and our users never make any mistakes when they change their tables, it could work without being a complexity nightmare
Re: Show HN: Embed an SQLite database in your PostgreSQL table
#88Yo, dawg, I heard you like databases... This is nuts. I can't think of a use for it, but I'm sure it's "a solution that will eventually find a problem".
I had a project that stored a tremendous amount of spatial data. There were "sessions" of spatially-tagged time-series data that would be individually processed (think generating a map layer from time-series data). There were also reasons to perform higher level aggregations that did not dive into the time series data. The data density was high enough that it was impractical to build spatial indices over the entire dataset. Even using space-filling curves as multidimensional B-trees would require so many lookups that queries were impractically slow.
One POC I tried (and then rejected as an abomination) was to store each session's time-series data inside a SQLite database with SpatialLite extensions enabled. Then store each session's metadata, including spatial extent, in a Postgres database. The SQLite files were tossed in S3 and referenced from Postgres. I guess I could have inserted them directly to a BLOB column inside Postgres.
Re: Show HN: Embed an SQLite database in your PostgreSQL table
#89Re: Show HN: Embed an SQLite database in your PostgreSQL table
#90Earlier quoted context omitted.
But can I have one row that holds all the databases?
yes you can CREATE TABLE crime_against_humanity ( databases SQLITE[] );