Live data from Hacker News

A pure Go embedded SQL database

gitlab.com

41–50 of 51 posts

Re: A pure Go embedded SQL database

#41
This modernc.org/ql is an embedded database accessed through QL, which is a sub-SQL language "less complex and less powerful than SQL" (according to their homepage). I fail to see when this would be useful compared to the de facto standard SQLite.

BTW, modernc.org/sqlite (by the same author) is a port of SQLite to native Go. I've used it with great success for a few personal projects. Before that, I used the go-sqlite package, which needs CGO, and makes it hard to build static executables.

Re: A pure Go embedded SQL database

#42
post #22

What are the use cases for this? Is this a good fit for Memory based testing for db stores? Also, I can’t seem to find documentation for how this compares to SQLite

It’s literally SQLite transpiled to Go using cznic’s C to Go program.

No, that is a different project by the same author: https://gitlab.com/cznic/sqlite

Re: A pure Go embedded SQL database

#43
post #26

The cardinal rule of databases: http://www.dbms2.com/2013/03/18/dbms-development-marklogic-h... Ignoring that leads to long postmortems about how your embedded db failed in a way you didn’t expect: https://blog.roblox.com/2022/01/roblox-return-to-service-10-... SQLite is good Rocksdb is good You don’t need pure go.

Keep in mind that this project isn’t creating a new SQL database from scratch. It’s literally ingesting SQLite’s C source code and spitting out Go. cznic’s done an absolutely incredible amount of work here. It’s not ready for prod yet, but it works and passes all of SQLite’s tests.

Again, no, that's a different project by the same author: https://gitlab.com/cznic/sqlite

Re: A pure Go embedded SQL database

#44

use go-sqlite3 to work with sqlite3 is one choice. https://github.com/etcd-io/bbolt is another pure go option. cznic seems like an alternative to bbolt. nice to have some options.

bbolt is a key-value store and this package is a SQL database so they aren't really the same thing.

Re: A pure Go embedded SQL database

#47

use go-sqlite3 to work with sqlite3 is one choice. https://github.com/etcd-io/bbolt is another pure go option. cznic seems like an alternative to bbolt. nice to have some options.

bbolt is a key-value store and this package is a SQL database so they aren't really the same thing.

you're right, for sql bblot is not a good option

Re: A pure Go embedded SQL database

#48
post #40

Earlier quoted context omitted.

go-sqlite3 is not pure Go. It is a Go wrapper around the SQLite amalgamation.

So why would you want pure Go? AFAIK Go is significantly slower than C. There's of course safety issues with C, but sqlite is one of the most rigorously tested sw packages out there.

so you can ship one binary contains everything.

for go-sqlite3 you still need native sqlite3 preinstalled on the OS, which is OK for developers but not for many ordinary users.

Re: A pure Go embedded SQL database

#49
post #29

use go-sqlite3 to work with sqlite3 is one choice. https://github.com/etcd-io/bbolt is another pure go option. cznic seems like an alternative to bbolt. nice to have some options.

Bolt is great, here is similar option: https://github.com/genjidb/genji

API not stable yet and it's a kv database, similar to bbolt/bolt.

as far as sqlite3 is concerned, pure-go option we indeed only have this cznic available, which is nice.

Re: A pure Go embedded SQL database

#50
post #29

Earlier quoted context omitted.

Bolt is great, here is similar option: https://github.com/genjidb/genji

API not stable yet and it's a kv database, similar to bbolt/bolt. as far as sqlite3 is concerned, pure-go option we indeed only have this cznic available, which is nice.

> it's a kv database, similar to bbolt/bolt

Its pretty clear you dont know what youre talking about. It literally says its SQL in the title, you know that big bar at the top of your screen:

> Document-oriented, embedded SQL database

Post reply on HN