go-sqlite
go-sqlite copied to clipboard
How to encrypt database ?
Thanks for ur amazing work on https://github.com/glebarez/go-sqlite, which is VERY great project.
BTW, is there any possible way to encrypt database without relying on CGO
?
Let me forward all your credits to modernc.org/sqlite, since this repo is just a fork with minimal changes:
modernc.org/sqlite consists of:
- pure go implementation of SQLite (original C codebase is regularly transpiled into Go with great tools from modernc.org
- implementation for golang database/sql driver interface as described in https://pkg.go.dev/database/sql/driver
glebarez/go-sqlite: is just a fork of modernc/sqlite with slight changes in the driver part (2), to behave more closely to mattn’s CGo version (https://github.com/mattn/go-sqlite3). this slight changes allowed it to be fully compatible with GORM (the GORM driver is in https://github.com/glebarez/sqlite)
Now, back to your question, I am assuming you mean translating some encryption-enabled fork of SQLite (e.g. https://github.com/sqlcipher/sqlcipher) into Go ? This is only possible if developer of https://gitlab.com/cznic/sqlite will try to transpile it into Go. There's already an issue for it: https://gitlab.com/cznic/sqlite/-/issues/105
Thanks for ur reply.
Let me come back to this issue later. I'm new to sqlite3, I might need to dig in a little bit.