@ladc/sqlite3-adapter
TypeScript icon, indicating that this package has built-in type declarations

0.22.9 • Public • Published

@ladc/sqlite3-adapter

Build Status npm Type definitions GitHub

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)

Readme

Keywords

Package Sidebar

Install

npm i @ladc/sqlite3-adapter

Weekly Downloads

1

Version

0.22.9

License

CC0-1.0

Unpacked Size

28.6 kB

Total Files

13

Last publish

Collaborators

  • paleo