0.1.1 • Published 7 months ago
postgres-pdo v0.1.1
Postgres Data Object
Pdo wrapper for https://github.com/porsager/postgres
Usage
Install
$ npm i -S postgres-pdo
Connect
const postgres = require('postgres');
const Pdo = require('postgres-pdo');
const options = {
// Connection parameters
}
const sql = postgres(options);
const pdo = new Pdo(sql);
Select
const result = await pdo
.select()
.from('table_name')
.whereIn('id', [1, 2])
.orWhere('id', '=', 3)
.execute();
console.log(result);
Insert
await pdo
.insert(['name', 'age'])
.into('table_name')
.values(['John', 30])
.execute();
Update
await pdo
.update({
name: 'John',
age: 30
})
.table('table_name')
.where('id', '=', 1)
.execute();
Delete
await pdo
.delete('table_name')
.where('id', '>', 1)
.execute();
0.0.25
8 months ago
0.1.0
7 months ago
0.1.1
7 months ago
0.0.26
8 months ago
0.0.23
1 year ago
0.0.24
1 year ago
0.0.22
1 year ago
0.0.20
2 years ago
0.0.21
2 years ago
0.0.19
2 years ago
0.0.18
3 years ago
0.0.16
3 years ago
0.0.17
3 years ago
0.0.14
3 years ago
0.0.15
3 years ago
0.0.12
3 years ago
0.0.13
3 years ago
0.0.11
4 years ago
0.0.10
4 years ago
0.0.9
4 years ago
0.0.9-1
4 years ago
0.0.8
4 years ago
0.0.7
4 years ago
0.0.6
4 years ago
0.0.4
4 years ago
0.0.3
4 years ago
0.0.2
4 years ago
0.0.1
4 years ago