sedentary-pg
TypeScript icon, indicating that this package has built-in type declarations

0.0.54 • Public • Published

sedentary-pg

Build Status Code Climate Test Coverage

NPM version NPM downloads Stars

Types Dependents Donate

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

MIT 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

Package Sidebar

Install

npm i sedentary-pg

Weekly Downloads

3

Version

0.0.54

License

MIT

Unpacked Size

57.9 kB

Total Files

9

Last publish

Collaborators

  • cicci