Skunk-inspired library for SQLite on JVM, Node.js, and Native!
libraryDependencies += "com.armanbilge" %%% "porcupine" % "<version>"Delegates to the JDBC Driver.
Requires the better-sqlite3 npm package.
npm i better-sqlite3
You must provide a native build of SQLite3. Here are three interesting ways to do this.
- Compiling SQLite as part of your project. You can use scala-native-sqlite-amalgamation:
libraryDependencies += "com.github.lolgab" % "scala-native-sqlite-amalgamation" % "3.53.2"or download the SQLite amalgation as a single sqlite3.c file and place it in your resources/scala-native directory.
- Dynamically linking to an existing installation of sqlite3.
nativeConfig ~= { c => c.withLinkingOptions(c.linkingOptions :+ "-lsqlite3") }- Statically linking a pre-compiled SQLite into your binary. sn-vcpkg is a great way to do this. An ad-hoc configuration might look like this:
nativeConfig ~= { c => c.withLinkingOptions(c.linkingOptions :+ "/usr/local/Cellar/sqlite/3.53.2/lib/libsqlite3.a") }