Live data from Hacker News

DuckDB – An embeddable SQL database like SQLite, but supports Postgres features

duckdb.org

11–20 of 167 posts

Re: DuckDB – An embeddable SQL database like SQLite, but supports Postgres features

#11
post #9

Earlier quoted context omitted.

> SQL Parser: We use the PostgreSQL parser that was repackaged as a stand-alone library. The translation to our own parse tree is inspired by Peloton. Right at the bottom of this page: https://duckdb.org/docs/why_duckdb.html

That's awesome news, thanks for that!

No problem I was curious as well and hunting it down, this project does seem interesting, I'm a huge fan of database systems like SQLite and H2. There's something wonderful about being able to copy a simple file and share it with other developers. This one seems rather interesting as well.

Re: DuckDB – An embeddable SQL database like SQLite, but supports Postgres features

#12
post #4

Strict typing has been the one big feature missing from SQLite, that this presumably brings.

Foreign keys enabled by default or by configuration setting would be another big feature missing from SQLite3, but I couldn't find any mention of foreign keys in DuckDB's documentation.

Re: DuckDB – An embeddable SQL database like SQLite, but supports Postgres features

#13
post #6
post #2

I was hoping from the title that it aims for postgres SQL compatibility, but I can't find it explicitly mentioned in the docs. This really makes me think I really want something like sqlite://memory which completely disregards speed or even persistence. Instead you could say for example "open an in-memory database that behaves like postgres 9" and run your tests against it. With typical fixtures of 10 or so rows, you…

Man, I’ve wanted the “compatible SQL engine with only RAM storage” for testing for YEARS. Closest I got was some shenanigans with MSSQL’s LocalDB.

RAM FS + fsync off?

Re: DuckDB – An embeddable SQL database like SQLite, but supports Postgres features

#15
post #12
post #4

Strict typing has been the one big feature missing from SQLite, that this presumably brings.

Foreign keys enabled by default or by configuration setting would be another big feature missing from SQLite3, but I couldn't find any mention of foreign keys in DuckDB's documentation.

It doesn't look like it provides FK looking at the create table syntax. Just PKs, unique, and check on an expression similar to sqlite.

Re: DuckDB – An embeddable SQL database like SQLite, but supports Postgres features

#16
post #2

I was hoping from the title that it aims for postgres SQL compatibility, but I can't find it explicitly mentioned in the docs. This really makes me think I really want something like sqlite://memory which completely disregards speed or even persistence. Instead you could say for example "open an in-memory database that behaves like postgres 9" and run your tests against it. With typical fixtures of 10 or so rows, you…

I would also love this, in the past I’ve used the H2 in-memory database for tests with Spring boot applications. The Hibernate ORM handles configuring the H2 schema but they’re not fully compatible, so it means I have to be careful to not rely on Postgres-specific features. I generally am not testing database logic, just need a working persistence layer to get the tests running, but an in-memory Postgres implementati…

IIRC h2 supports a postgres compatibility mode. Though I'm not sure how feature complete it is.

http://h2database.com/html/features.html

Re: DuckDB – An embeddable SQL database like SQLite, but supports Postgres features

#17
post #6

Earlier quoted context omitted.

Man, I’ve wanted the “compatible SQL engine with only RAM storage” for testing for YEARS. Closest I got was some shenanigans with MSSQL’s LocalDB.

RAM FS + fsync off?

Those solutions still have a high overhead. There's acid compliance, serialisation in memory, maintaining indices, and many other layers. Compare it to an ideal testing solution with no initialisation cost and insert being literally: parse the query, add a new entry to a list, done.

Re: DuckDB – An embeddable SQL database like SQLite, but supports Postgres features

#19

Earlier quoted context omitted.

RAM FS + fsync off?

Those solutions still have a high overhead. There's acid compliance, serialisation in memory, maintaining indices, and many other layers. Compare it to an ideal testing solution with no initialisation cost and insert being literally: parse the query, add a new entry to a list, done.

But you want to be testing against something that is as close as possible to the deployment environment. So if that means acid, indices etc, then that's what it is.

Re: DuckDB – An embeddable SQL database like SQLite, but supports Postgres features

#20
First of all, really neat project.

There's an issue with the Installation section of the web page, though. Running Chrome on Linux, it says "System detected: Linux", which is right. But under "CLI", it offers me a download of duckdb_cli-osx-amd64.zip.

Just in case it was just the zip file name that's wrong, I downloaded it, but the duckdb binary inside is a "Mach-O 64-bit x86_64 executable" according to the file command.

The correct file is available if I click on Other Installations (https://duckdb.org/docs/installation/).

Also, if I try it on running Firefox on Linux, it says "System detected: UNIX" and gives me the OS X download.

Post reply on HN