Earlier quoted context omitted.
Yes. It doesn’t play nice with goroutines and Go’s concurrency model, from what I understand.
Yes, function calls across the boundary are slow. It's fine if the functions do lots of work, it's very expensive for function calls that should be cheap. For sqlite it might not matter too much, since any query does quite a bit of work.
A pure Go embedded SQL database
21–30 of 51 posts
Re: A pure Go embedded SQL database
#22Re: A pure Go embedded SQL database
#23Earlier quoted context omitted.
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
#24Earlier quoted context omitted.
Yes, function calls across the boundary are slow. It's fine if the functions do lots of work, it's very expensive for function calls that should be cheap. For sqlite it might not matter too much, since any query does quite a bit of work.
A query may do a lot of work but iterating over many results could be very slow.
Re: A pure Go embedded SQL database
#25https://github.com/etcd-io/bbolt is another pure go option.
cznic seems like an alternative to bbolt. nice to have some options.
Re: A pure Go embedded SQL database
#26Ignoring 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.
Re: A pure Go embedded SQL database
#27Earlier quoted context omitted.
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.
Nice. I tried to cross-compile a Go app using SQLite for darwin/arm64 a couple months back and couldn’t figure it out for the life of me. Ended up just shipping a darwin/amd64 binary and letting Rosetta handle it. Will give this a spin when I have time.
Re: A pure Go embedded SQL database
#28The 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.
Re: A pure Go embedded SQL database
#29use 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.
Re: A pure Go embedded SQL database
#30The 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.