eyaldb
v1.0.0
Published
<h1 style="text-align: center;"><a name="title" style="color: white">eyaldb</a></h1>
Downloads
4
Readme
You can install eyaldb
using npm
$ npm install eyaldb
OR
$ yarn add eyaldb
- db#createTable
- db#deleteTable
- db#all
- db#type
- db#add
- db#delete
- db#deleteAll
- db#set
- db#has
- db#dataSize
- db#resetDb
This function allows you to create a new table in your database.
- 1: 'TEXT',
- 2: 'INTEGER',
- 3: 'BOOLEAN',
- 4: 'DATE',
- 5: 'DATETIME',
Code example:
const db = require('eyaldb');
db.table.create('customers', {
customerName: 1,
customerPaymentMethod: 1,
isPartner: 1,
customerMonthlyPrice: 2
});
Code example:
const db = require('eyaldb');
db.table.delete('customers');
This function allows you to get all the data from the specific table
Code example:
const db = require('eyaldb');
db.all('customers');
This function allows you to get the type of a specific column in a specific table
Code example:
const db = require('eyaldb');
db.type('customers', 'customerMonthlyPrice');
Code example:
const db = require('eyaldb');
db.add('customers', {
customerName: 'Eyal',
customerPaymentMethod: 1,
isPartner: 'true',
customerMonthlyPrice: 100
});
Code example:
const db = require('eyaldb');
db.delete('customers', {
customerName: 'Eyal2'
});
Code example:
const db = require('eyaldb');
db.deleteall('customers');
Code example:
const db = require('eyaldb');
db.set('customers',{customerName: 'Eyal Green'}, {customerName: 'Eyal'})
Code example:
const db = require('eyaldb');
console.log(db.has('customers', {
customerName: 'Eyal'
}));
Code example:
const db = require('eyaldb');
console.log(db.datasize('customers'))
Code example:
const db = require('eyaldb');
db.resetdb();
- Created by eyalgreen#0 (1048185629885866015)
- eyaldb is a wrapper package for better-sqlite3