armanbilge / porcupine   0.0.1

Apache License 2.0 GitHub

Skunk-inspired library for SQLite on JVM, Node.js, and Native

Scala versions: 3.x
Scala.js versions: 1.x
Scala Native versions: 0.4

porcupine

Skunk-inspired library for SQLite on JVM, Node.js, and Native!

libraryDependencies += "com.armanbilge" %%% "porcupine" % "<version>"

Installation

JVM

Delegates to the JDBC Driver.

Node.js

Requires the better-sqlite3 npm package.

npm i better-sqlite3

Native

You must provide a native build of SQLite3. Here are three interesting ways to do this.

  1. Dynamically linking to an existing installation of sqlite3.
nativeConfig ~= { c => c.withLinkingOptions(c.linkingOptions :+ "-lsqlite3") }
  1. 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.41.0/lib/libsqlite3.a") }
  1. Compiling SQLite as part of your project. You can download the SQLite amalgation as a single sqlite3.c file and place it in your resources/scala-native directory.