-
Notifications
You must be signed in to change notification settings - Fork 278
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
Add support for modernc.org/sqlite #608
Conversation
Thanks for the PR
|
I am using dbmate as a library in some projects, here is an open source example if you are interested. I prefer to avoid cgo, to make (cross-) compilation easier. I adapted the dbmate sqlite driver to use
The existing driver, using Also for fully moving to |
Thanks for the explanation. I've put some thought into this and don't think it is a good feature to merge into core dbmate. It would be better for you to maintain separately (as you stated, this version of sqlite is only helpful when using dbmate as a library, and when using dbmate as a library you can always import your own custom driver while still using our upstream core packages).
|
This PR adds a new dbmate driver for https://modernc.org/sqlite.
Some Go projects like sqlc moved away from
github.com/mattn/go-sqlite3
tomodernc.org/sqlite
which offers sqlite support without cgo.This PR adds a new dbmate driver for
modernc.org/sqlite
with the following changes:pkg/driver/sqlite/internal
contains the common sqlite code for both sqlite drivers. This is mostly just moved over from the previouspkg/driver/sqlite
package, not sure why git did not pick this up.pkg/driver/sqlite/modernc
contains a dbmate driver formodernc.org/sqlite
. It importsmodernc.org/sqlite
and registers the appropriate dbmate drivers. Also contains the tests for this dbmate driver.pkg/driver/sqlite
package still importsjackfan.us.kg/mattn/go-sqlite3
and registers the appropriate dbmate drivers. This is a backwards compatible wrapper of the internal package now and still contains tests for this driver.main_non_cgo.go
imports the new modernc driver, so dbmate can be build without cgo now and still has sqlite support.