WiseLibs / better-sqlite3

The fastest and simplest library for SQLite3 in Node.js.
MIT License
5.46k stars 396 forks source link

Exposing the embedded SQLite3 version number and other compile-time variables #1021

Open moll opened 1 year ago

moll commented 1 year ago

Hey,

Thanks for your continued maintenance of Better-SQLite3! Have you considered exposing some of the compile-time variables as properties on the primary export? I've got a need to identify the SQLite3 version and SQLITE_MAX_VARIABLE_NUMBER/SQLITE_LIMIT_VARIABLE_NUMBER to adjust some queries. The former is possible to get via sqlite_version(), but that's only at runtime via initializing a database. The latter isn't possible to query at runtime AFAICT.

Mapbox/Ghost's SQLite3 seems to provide those constants in https://github.com/TryGhost/node-sqlite3/blob/master/src/node_sqlite3.cc#L23. Perhaps Better SQLite3 could, too?

Thanks!