Skip to content
This repository was archived by the owner on Jul 1, 2022. It is now read-only.
/ genji.js Public archive

Experimental asynchronous Javascript bindings for the Genji database

License

Notifications You must be signed in to change notification settings

genjidb/genji.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

791b24e · Jul 15, 2021

History

45 Commits
Sep 26, 2020
Mar 15, 2021
Mar 15, 2021
Mar 15, 2021
Jul 15, 2021
Jul 15, 2021
Mar 15, 2021
Mar 15, 2021
Mar 15, 2021
Mar 24, 2021
Mar 15, 2021
Mar 24, 2021
Jul 15, 2021
Apr 8, 2020
Jul 15, 2021

Repository files navigation

Genji.js

Genji

Document-oriented, embedded, SQL database

Experimental wrapper around the Genji database.

Getting started

Install Genji

yarn add @genjidb/genji

Copy the wasm file from node_modules into your public directory

cp node_modules/@genjidb/genji/genji.wasm public/

Or if you are using Webpack, add this to your config, after installing the copy-webpack-plugin loader :

yarn add --dev copy-webpack-plugin
const CopyWebpackPlugin = require('copy-webpack-plugin');

module.exports = {
    ...
    plugins: [
        new CopyWebpackPlugin({
            patterns: [
                { from: 'node_modules/@genjidb/genji/dist/genji.wasm' }
            ]
        })
    ]
}

Usage

import { initDatabase } from '@genjidb/genji';

async function run() {
  const genji = await initDatabase();
  const db = await genji.Database();
  await db.exec('CREATE TABLE foo');
  await db.exec('INSERT INTO foo (a) VALUES (1), (2), (3)');

  db.query('SELECT * FROM foo').forEach(v => console.log(v));
}

run();

Build from source

Requires Go >= 1.16 and Node >= 10

yarn install
yarn build

Running tests

yarn test

About

Experimental asynchronous Javascript bindings for the Genji database

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published