Skip to content

Asynchronously access and manage your IndexedDB databases using SQL queries.

License

Notifications You must be signed in to change notification settings

codewithkyle/jsql

Repository files navigation

JSQL

Access IndexedDB with SQL.

Installation

Install via NPM

npm i -S @codewithkyle/jsql

Install via CDN

import db from "https://unpkg.com/@codewithkyle/jsql@1/jsql.js";

Getting Started

import db from "https://unpkg.com/@codewithkyle/jsql@1/jsql.js";
db.start();

Hint: read the setup guide for additional details and configuration options.

Writing Queries

Insert data into IndexedDB

db.query("INSERT INTO users VALUES ($user1, $user2)", {
    user1: {
        name: "Frank",
        email: "[email protected]",
    },
    user2: {
        name: "April Summers",
        email: "[email protected]",
    }
});

Query data from IndexedDB

const users = await db.query("SELECT * FROM users LIMIT 10")
users.map(user => console.log(user));