Skip to content
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

SQLite driver without CGO (modernc.org/sqlite) #11

Open
abemedia opened this issue Feb 27, 2021 · 3 comments
Open

SQLite driver without CGO (modernc.org/sqlite) #11

abemedia opened this issue Feb 27, 2021 · 3 comments

Comments

@abemedia
Copy link

There is a SQLite driver that doesn't use CGO: https://pkg.go.dev/modernc.org/sqlite

Using this it would be possible to move this driver into the main repo and avoid external dependencies.

@aarondl
Copy link
Member

aarondl commented Mar 14, 2021

There's no really big reason to move it into the main repo. There's nothing special about being in there. The current binaries are all separate today and require a separate go install command and now thanks to Go 1.16 we can install them all in a very similar way - the only thing that changes a bit is the url. Is there any reason I've missed that makes it desirable?

@cryptix
Copy link

cryptix commented Mar 16, 2021

While I also got pretty excited about this and think cznic is doing the gopher gods work there, I'd advise everybody who wants to try this to check their issues page. Issue No 39 and the missing pragmas are enough for me to not jump ship immediately and let them solve the teething troubles first.

In the end this should act essentially the same anyhow and would just need a different sql.Open(...) to be passed into the generated models.

@pojntfx
Copy link

pojntfx commented Jan 7, 2022

I've forked this driver and "ported" it to modernc.org/sqlite (it was really just replacing the imports) here: https://github.com/pojntfx/sqlboiler-sqlite3 and it works really well (I'm testing it for usage in https://github.com/pojntfx/stfs, as the current CGo solution leads to quite a few portability issues). Maybe one could implement this using a build flag of sorts? While the CGo-free SQLite version is quite useful, its not without its own problems in terms of portability (such as lack of RISC-V compatibility). If one disables the SQLBoiler-generated tests with no-tests: true it is however also possible to use this version of the driver by just importing modernc.org/sqlite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants