Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/armanbilge/porcupine
Skunk-inspired library for SQLite on JVM, Node.js, and Native
https://github.com/armanbilge/porcupine
cats-effect scala scala-native scalajs sqlite
Last synced: 2 months ago
JSON representation
Skunk-inspired library for SQLite on JVM, Node.js, and Native
- Host: GitHub
- URL: https://github.com/armanbilge/porcupine
- Owner: armanbilge
- License: apache-2.0
- Created: 2023-02-26T05:56:04.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-16T23:10:39.000Z (3 months ago)
- Last Synced: 2024-10-19T22:57:48.611Z (2 months ago)
- Topics: cats-effect, scala, scala-native, scalajs, sqlite
- Language: Scala
- Homepage:
- Size: 159 KB
- Stars: 30
- Watchers: 3
- Forks: 2
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# porcupine
[Skunk]-inspired library for [SQLite] on JVM, Node.js, and Native!
```scala
libraryDependencies += "com.armanbilge" %%% "porcupine" % ""
```[Skunk]: https://github.com/tpolecat/skunk
[SQLite]: https://www.sqlite.org## Installation
### JVM
Delegates to the [JDBC Driver].
[JDBC Driver]: https://github.com/xerial/sqlite-jdbc
### Node.js
Requires the [better-sqlite3] npm package.
```
npm i better-sqlite3
```[better-sqlite3]: https://www.npmjs.com/package/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.
```scala
nativeConfig ~= { c => c.withLinkingOptions(c.linkingOptions :+ "-lsqlite3") }
```2. 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:
```scala
nativeConfig ~= { c => c.withLinkingOptions(c.linkingOptions :+ "/usr/local/Cellar/sqlite/3.41.0/lib/libsqlite3.a") }
```3. 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.
[sn-vcpkg]: https://github.com/indoorvivants/sn-vcpkg
[amalgation]: https://www.sqlite.org/amalgamation.html