@edward644/sqlite

0.0.1 • Public • Published

Introduction

sqliteBasic is a lightweight SQLite wrapper for Node.js, designed to simplify database interactions while maintaining flexibility. It provides a structured approach to managing tables, schemas, and transactions.

Getting Started

Installation

To install sqliteBasic, use npm:

npm install @edward644/sqlitebasic

Software Dependencies

  • Node.js >= 16.x
  • SQLite3 >= 5.x

Usage Example

import { Database } from 'sqlitebasic';

const db = new Database(':memory:');
await db.open();

await db.createTable({
  name: 'users',
  schema: [
    { name: 'id', dataType: 'INTEGER', constraint: 'PRIMARY KEY' },
    { name: 'name', dataType: 'TEXT', constraint: 'NOT NULL' },
  ],
});

await db.tables['users'].insert({ id: 1, name: 'Alice' });
const users = await db.tables['users'].list();
console.log(users);

Build and Test

Build

To build the project, run:

npm run build

Test

To run the tests, use:

npm test

License

This project is licensed under the ISC License.

Package Sidebar

Install

npm i @edward644/sqlite

Weekly Downloads

0

Version

0.0.1

License

ISC

Unpacked Size

21.4 kB

Total Files

30

Last publish

Collaborators

  • edward644