inf3cti0n95 / rx-sql

RxJS Implementation of MySQL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rx-sql

Build Status

RxJS Implementation of MySQL

import { RxSQL } from "rx-sql";
import { createConnection } from "mysql";
import { flatMap } from "rxjs/operators";

let db = createConnection({
  host: "localhost",
  database: "database",
  user: "root",
  password: "password"
});

let rxsql$ = new RxSQL(db);

rxsql$
  .query("SELECT * FROM table")
  .pipe(flatMap(result => result))
  .subscribe(
      result => console.log(result),
      error => console.error(error)
      () => console.info("Completed!")
      );

About

RxJS Implementation of MySQL

License:MIT License


Languages

Language:TypeScript 100.0%