@sgonzalez_es/database-x

Database mysql Object (Promise)

Usage no npm install needed!

<script type="module">
  import sgonzalezEsDatabaseX from 'https://cdn.skypack.dev/@sgonzalez_es/database-x';
</script>

README

IN DEVELOPMENT (Do not use this module)

Example of use


const { DataBase } = require('@sgonzalez_es/database-x');

let db     = new DataBase ();

let setting =
{
    values: [ 'id', 'name:alias', 'count(*):total' ],
    where: { name:'Peter' },
    limit:1
}

let user   = await db.get ( 'user', setting );

Equivalence in SQL

SELECT `id`, `name` AS alias, count(*) as total FROM `user` WHERE `id` = 2 AND `name` = 'Peter' LIMIT 1

TODO

  • Create methods: set, get, put, del
  • Create objects according to the table schema

BUGS