@augu/maru
TypeScript icon, indicating that this package has built-in type declarations

1.2.6 • Public • Published

@augu/maru

🌱 | Make SQL management easier

Usage

import { Dialect, pipelines } from '@augu/maru';

const dialect = new Dialect({
  activeConnections: 3,
  username: 'uwu',
  password: 'owo?',
  host: '127.0.0.1',
  port: 6969
});

const connection = dialect.createConnection();
await connection.connect();

const batch = connection.createBatch();
batch
  .pipe(pipelines.DropTable('test'))
  .pipe(pipelines.CreateTable('test', {
    owo: {
      nullable: false,
      primary: false,
      type: 'object'
    },
    id: {
      nullable: false,
      primary: true,
      type: 'string'
    }
  }, true))
  .pipe(pipelines.Insert({
    values: {
      id: '1',
      owo: {
        uwu: true,
        hecc: false
      }
    },
    table: 'test'
  }))
  .pipe(pipelines.Select('test', ['id', '1']))
  .pipe(pipelines.Count('test'))
  .pipe(pipelines.Count('test', 1))
  .pipe(pipelines.Update({
    returning: ['id'],
    values: {
      owo: {
        hecc: true,
        uwu: false
      }
    },
    query: ['id', '1'],
    table: 'test',
    type: 'set'
  }));

const first = await batch.next();
const all = await batch.all();

console.log('First Result:\n', first);
console.log('All Results:\n', all);

License

Maru is released under the MIT License, read here for more information

/@augu/maru/

    Package Sidebar

    Install

    npm i @augu/maru

    Weekly Downloads

    7

    Version

    1.2.6

    License

    none

    Unpacked Size

    60.6 kB

    Total Files

    25

    Last publish

    Collaborators

    • auguwu
    • ohlookitsaugust