
Weird, looks like it was generated not written.

I’m tempted to bid $10 just so I can find out more.


Yet another Rosetta Code?

I suppose so. Makes their by-line funny “Please don’t reinvent the wheel”.


I believe I triggered this by emailing the dev yesterday.

It would be funny to add a “rosetta code” idiom.

@ryanc Where does db
find the sqlite it uses? (I have a query that works on mac (version 3.22.0) but not in the server (version 3.22.0) so I am trying find differences).

@soegaard2 It uses the standard Racket shared library search path (for “libsqlite3” on Linux and Mac OS and for “sqlite3” on Windows). On Windows (and the natipkg Linux build) I believe Racket includes versions of the sqlite3 shared library, but on Mac OS and normal Linux it just uses what it finds on the system. On Racket 7.4 you can set PLTSTDERR="debug@ffi-lib"
and Racket will print information about where it found foreign libraries (or where it looked, if loading the library failed). But if the library is loaded through the OS search path, it’ll just say something like ffi-lib: loaded "libsqlite3.0.dylib"
and you’ll have to look in the standard locations yourself. If you want to use a different version of the library, you can drop the file into one of the directories returned by (begin (require setup/dirs) (get-lib-search-dirs))
, and the logger should confirm that it loads that version.

@ryanc Thanks for the tips. Still looking. I am getting prepare: near "AS": syntax error
error code: 1
on Ubuntu - and it works on mac. I couldn’t find anything in the release notes of sqlite that could explain this, so I don’t know whether I am looking in the right place.

To double-check, what does (begin (require db/private/sqlite3/ffi) (sqlite3_libversion_number))
produce on each platform?

mac: 3024000 ubuntu: 3022000

It’s getting late. I’ll attempt to make a minimal example tomorrow.