Live data from Hacker News

A pure Go embedded SQL database

gitlab.com

1–10 of 51 posts

Re: A pure Go embedded SQL database

#5
post #3

This project seems rather in need of a summary of what it is and what it does. How does it compare to for ex Sqlite?

Well for one, if it's in Go, it wouldn't need Cgo.

It's pretty easy to statically link SQLite[0]. Are there other disadvantages to CGO?

[0]: https://www.arp242.net/static-go.html

Re: A pure Go embedded SQL database

#6
post #3

This project seems rather in need of a summary of what it is and what it does. How does it compare to for ex Sqlite?

Well for one, if it's in Go, it wouldn't need Cgo.

There are a few go libs now that offer SQLite without cgo.

https://github.com/crawshaw/sqlite https://github.com/zombiezen/go-sqlite

Re: A pure Go embedded SQL database

#7

Earlier quoted context omitted.

Well for one, if it's in Go, it wouldn't need Cgo.

It's pretty easy to statically link SQLite[0]. Are there other disadvantages to CGO? [0]: https://www.arp242.net/static-go.html

Yes. It doesn’t play nice with goroutines and Go’s concurrency model, from what I understand.

Re: A pure Go embedded SQL database

#9
post #3

This project seems rather in need of a summary of what it is and what it does. How does it compare to for ex Sqlite?

Well for one, if it's in Go, it wouldn't need Cgo.

The same author ("cznic") has also built a C-to-Go compiler/transpiler and used it to convert SQLite to pure Go source, so that it doesn't require CGo: https://gitlab.com/cznic/sqlite ... the converted Go code is pretty much unreadable and it's somewhat slower than SQLite via CGo. But a pretty neat idea! I use it in one of my projects and it works well.

Re: A pure Go embedded SQL database

#10
post #6

Earlier quoted context omitted.

Well for one, if it's in Go, it wouldn't need Cgo.

There are a few go libs now that offer SQLite without cgo. https://github.com/crawshaw/sqlite https://github.com/zombiezen/go-sqlite

crawshaw/sqlite actually uses CGo -- it's a wrapper around the C version of SQLite. For example, see https://github.com/crawshaw/sqlite/blob/23d646f8ac00d9dd2390...

zombiezen/go-sqlite uses cznic's pure Go converted version of SQLite, so avoids CGo. It's explicitly stated to be "a fork of crawshaw.io/sqlite that uses modernc.org/sqlite, a CGo-free SQLite package. It aims to be a mostly drop-in replacement for crawshaw.io/sqlite."

Post reply on HN