@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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.2.61latest

Version History

VersionDownloads (Last 7 Days)Published
1.2.61
1.2.50
1.2.40
1.2.30
1.2.21
1.2.11
1.2.01
1.1.01
1.0.30
1.0.20
1.0.12
1.0.00

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