g10-db
v1.0.2
Published
Librería de base de datos SQLite, postgres, y mysql
Downloads
2
Readme
gzl-database
Librería de base de datos para el desarrollo de aplicaciones en node. Las tablas deben tener los campos:
- ID: autoincrement primary_key
- Created: timestamp
- Modified: timestamp
Usage
import DB from 'gzl-database'
// SQLite3
const db = new DB(eGzlDatabaseClient.pg,
{
filename: '<path to file>'
})
// PostGres
const db = new DB(eGzlDatabaseClient.pg,
{
host: pg_host,
port: pg_port,
user: pg_user,
password: pg_password,
database: pg_database
})
// MySQL / MariaDB
const db = new DB(eGzlDatabaseClient.pg,
{
host: mysql_host,
port: mysql_port,
user: mysql_user,
password: mysql_password,
database: mysql_database,
passwordRoot: mysql_root_password
})
await db.createDataBase()
await db.createOrUpgradeSchema(<path to schema>)
await db.disconnect()