GithubHelp home page GithubHelp logo

augustarchive / maru Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 50 KB

:seedling: | Make SQL management easier

License: MIT License

TypeScript 96.24% JavaScript 3.76%
maru database-management npm nodejs typescript javascript db-management management

maru's Introduction

@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

maru's People

Contributors

renovate-bot avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

cyberflamego

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.