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

feature request: sqlar #1252

Open
ndajr opened this issue Jun 28, 2024 · 2 comments
Open

feature request: sqlar #1252

ndajr opened this issue Jun 28, 2024 · 2 comments

Comments

@ndajr
Copy link

ndajr commented Jun 28, 2024

sqlite has a feature called sqlar which allows one to use the database as a file store: https://www.sqlite.org/sqlar.html.

It means we need zlib and two SQL functions (sqlar_compress/sqlar_uncompress). I read the features section on the README but it's not clear how I would enable sqlar. How hard would it be to add this feature to go-sqlite3? With some guidance I am happy to do my first contribution. Many thanks!

@rittneje
Copy link
Collaborator

rittneje commented Jul 1, 2024

I believe that the SQLite CLI (which is also named sqlite3) simply includes the sqlar extension by default. It is not really a feature of the SQLite core library, which is what this Go module wraps.

If you wish to include the sqlar extension in your application, you should be able to follow the process documented here: https://pkg.go.dev/github.com/mattn/go-sqlite3#hdr-SQLite3_Extension

@ndajr
Copy link
Author

ndajr commented Jul 1, 2024

Is there a community repo for SQLite extensions? Sure I could throw some C code in my Go application, but is there a better way? If this is the only option, I am probably going to reinvent my own "sqlar" creating a table with the same schema and compressing/decompressing files myself with Go

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

2 participants