crystal-sqlite3
crystal-sqlite3 copied to clipboard
Docs on how to compile and link SQLite
This should cover the basics of how to use a newer version of SQLite on Ubuntu.
I think it could be improved by covering the following, but I do think this is a decent start.
- Static build on Alpine
- Clang
- Mac
For the record, this is related to https://forum.crystal-lang.org/t/upgrade-sqlite3-binding-version/3384
@chillfox could you add a paragraph describing in what situations someone would need/want to compile sqlite from source. I'm thinking in case your distro is out of date or you want to use development version of sqlite3. Right? Somehow I think this was also about compiling sqlite3 for static linking, but it seems it's not 🙃
Other than that I think this is good to go. Thanks!
Yeah, the main reasons people usually want to compile SQLite is to get some feature from a new release or development. The other one is enabling some compile time feature that's not commonly enabled.
It would definitely be good to cover compiling for static linking as that will likely be a common use case. I will see if I get time to add that on the weekend.
@bcardiff I had a bit of a look at how to compile SQLite for static linking and unfortunately, it requires deeper knowledge of c and the build tools than I currently have.
As far as I can tell it is something along these lines, but I am still missing something.
clang -c -Wall -o libsqlite3.o -I sqlite3.h sqlite3.c
llvm-ar rcs libsqlite3.a libsqlite3.o
crystal build --release --static --link-flags -Llibsqlite3.a app.cr
I'm wondering if the file should be placed in a
doc/folder for a tidy root directory.
@straight-shoota sure, why not. I will move it.
@straight-shoota doc is in .gitignore, so is that used for autogenerated stuff?
maybe "guides", "tutorials" or go for the full word "documents"?
Maybe just go with docs?
Maybe just go with
docs?
that's where crystal docs puts auto-generated API docs.
Ah, right. I believe that should be in .gitignore then. And doc should not be.