dbms

1.0.9 • Public • Published

Node Database Management System (ORM)

Initialization

  • installation $ npm install dbms
    • install MySQL: $ npm install mysql2
    • install PostgreSQL: $ npm install pg
    • install MongoDB: $ npm install mongodb
const dbms = require('dbms');

dbms.init([alias], connection_string);
// @alias {String} Optional, alias for connection string (default: 'default')
// @connection_string {String} A connection string to DB

// PostgreSQL
dbms.init('postgresql://user:pass@localhost:5432/dbname');
dbms.init('mypg', 'postgresql://user:pass@localhost:5432/dbname'); // with a name for more DB engines

// MySQL & Maria DB
dbms.init('mysql://user:pass@localhost:3306/dbname');
dbms.init('mysql', 'mysql://user:pass@localhost:3306/dbname'); // with a name for more DB engines

// Total.js NoSQL embedded
dbms.init('nosql');
dbms.init('mynosql', 'nosql'); // with a name for more DB engines

// Total.js Table
dbms.init('table');
dbms.init('mytable', 'nosql'); // with a name for more DB engines

Usage

// Is a global method
var db = DBMS();

// Finds records
// A response: Array
// returns QueryBuilder
db.find('collection_table_name');
db.find('mypg/collection_table_name');
db.find('mynosql/collection_table_name');
db.find('mytable/collection_table_name');

// Finds the one record
// A response: Object
// returns QueryBuilder
db.one('collection_table_name');
db.one('mypg/collection_table_name');
db.one('mynosql/collection_table_name');
db.one('mytable/collection_table_name');

// Inserts a new record
// A response: Number
// returns QueryBuilder
db.insert('collection_table_name', document, [unique]);
db.insert('mypg/collection_table_name', document, [unique]);
db.insert('mynosql/collection_table_name', document, [unique]);
db.insert('mytable/collection_table_name', document, [unique]);

Contact

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.99latest
1.0.6-10beta

Version History

VersionDownloads (Last 7 Days)Published
1.0.99
1.0.80
1.0.70
1.0.634
1.0.6-10
1.0.50
1.0.40
1.0.30
1.0.11
1.0.00
0.9.90
0.9.80
0.9.70
0.9.60
0.9.40
0.9.30
0.9.20
0.9.10
0.9.00
0.8.70
0.8.60
0.8.50
0.8.40
0.8.30
0.8.21
0.8.00
0.7.90
0.7.80
0.7.70
0.7.60
0.7.50
0.7.40
0.7.30
0.7.20
0.7.00
0.6.90
0.6.80
0.6.70
0.6.60
0.6.40
0.6.30
0.6.20
0.6.10
0.6.00
0.5.90
0.5.80
0.5.70
0.5.60
0.5.50
0.5.40
0.5.30
0.5.20
0.5.10
0.5.00
0.4.90
0.4.81
0.4.70
0.4.60
0.4.40
0.4.10
0.4.01
0.3.90
0.3.80
0.3.70
0.3.60
0.3.50
0.3.40
0.3.30
0.3.20
0.3.10
0.3.00
0.2.90
0.2.80
0.2.70
0.2.60
0.2.50
0.2.40
0.2.30
0.2.20
0.2.10
0.2.00
0.1.91
0.1.80
0.1.70
0.1.50
0.1.40
0.1.30
0.1.21
0.1.00
0.0.90
0.0.80
0.0.60
0.0.40
0.0.30
0.0.20
0.0.10

Package Sidebar

Install

npm i dbms

Weekly Downloads

49

Version

1.0.9

License

MIT

Unpacked Size

214 kB

Total Files

13

Last publish

Collaborators

  • petersirka