sedentary-pg
v0.0.54
Published
The ORM which never needs to migrate - PostgreSQL
Downloads
25
Maintainers
Readme
sedentary-pg
under development
Description
The PostgreSQL specialized package of Sedentary.
Usage
import { SedentaryPG } from "sedentary-pg";
const db = new SedentaryPG(/* PG connection */);
class Items extends db.model("Item", {
num: db.INT,
str: db.VarChar(30)
});
(async function () {
await db.connect();
const item = Items.create();
item.num = 0;
item.str = "0";
await item.save();
const records = await Items.load({});
console.log(records); // [{ id: 1, num: 0, str: "0" }]
})();
Installation
With npm:
$ npm install --save sedentary-pg
Documentation
The full documentation is on sedentary.readthedocs.io.
Compatibility
Requires:
- Node.js: v14
- TypeScript: v4.6 (or none if used in a JavaScript project).
The package is tested under all version combinations of Node.js currently supported accordingly to Node.js Release and of PostgreSQL currently supported accordingly to PostgreSQL Versioning.
To work with the package under Windows, be sure to configure bash.exe
as your script-shell.
> npm config set script-shell bash.exe
License
Bugs
Do not hesitate to report any bug or inconsistency @github.
Donating
If you find useful this package, please consider the opportunity to donate some satoshis to this bitcoin address: 1Md9WFAHrXTb3yPBwQWmUfv2RmzrtbHioB