-
Notifications
You must be signed in to change notification settings - Fork 457
Use modernc.org/sqlite #1581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use modernc.org/sqlite #1581
Conversation
This way it can be enabled by default, as it is a cgo-free, Go-only package. No need for build tags, conditional compilation (whether libsqlite3-dev is installed).
|
I'm having trouble finding any succinct explanation of what the
I think putting up with cgo is a much better option. |
|
cgo transpiles Go to C, to be able to compile everything with gcc. I can't decide which is more complex, but you're right that modernc.org/sqlite is younger - though it passes the same tests as sqlite3 does... |
I think the compiler uses linker magic to coordinate the Go/C calls rather than transpiling Go to C. It compiles the C bits with gcc, the Go bits with the Go compiler, then the linker does its magic. |
|
Quoting Mohammed Al Sahaf (2021-12-24 12:40:37)
I think the compiler uses linker magic to coordinate the Go/C calls
rather than transpiling Go to C. It compiles the C bits with gcc, the
Go bits with the Go compiler, then the linker does its magic.
This is more or less correct, though I'm not sure I'd agree with the use
of the word "magic;" the C ABI isn't that complicated, and what cgo is
doing is pretty similar to what basically every other language's C FFI
does.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I've been meaning to do this too. I use modernc.org/sqlite for other things and love it.
5c2b653 to
65e5b34
Compare
|
Someone reported on the mailing list that perkeep no longer builds with |
This way it can be enabled by default, as it is a cgo-free, Go-only package.
No need for build tags, conditional compilation (whether libsqlite3-dev is installed).
My more distant purpose is to have an sqlite-based index instead of the current memory-based,
which consumes 4GiB for me now.