@ladc/sqlite3-adapter
LADC is a common API on top of relational database (SQL) connectors. It can connect to Postgresql, MariaDB / MySQL, SQLite. The API is inspired from PDO and JDBC. It’s named LADC for “a Layer Above Database Connectors”.
This package is a plugin for LADC. It is an adapter for SQLite, using the connector sqlite3 (SQLite).
Install
npm install @ladc/sqlite3-adapter ladc
Usage
How to create a connection:
import ladc from "ladc";
import sqlite3Adapter from "@ladc/sqlite3-adapter";
const cn = ladc({
adapter: sqlite3Adapter({ fileName: `${__dirname}/mydb.sqlite` }),
initConnection: async (cn) => {
await cn.exec("PRAGMA foreign_keys = ON");
},
});
Contribute
With VS Code, our recommanded plugin is:
-
TSLint from Microsoft (
ms-vscode.vscode-typescript-tslint-plugin
)