🚀 Big News:Socket Has Acquired Secure Annex.Learn More
Socket
Book a DemoSign in
Socket

sedentary-pg

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sedentary-pg

The ORM which never needs to migrate - PostgreSQL

latest
Source
npmnpm
Version
0.1.3
Version published
Weekly downloads
105
320%
Maintainers
1
Weekly downloads
 
Created
Source

sedentary-pg

Build Status Code Quality Test Coverage

NPM version NPM downloads Stars

Types Dependents Donate

under development

Description

The PostgreSQL specialized package of Sedentary.

Other DB engines: MySQL and SQLite are in todo but not yet planned.

Usage

import { SedentaryPG } from "sedentary-pg";

const db = new SedentaryPG({ database: "db", user: "user", password: "pass" });

const Items = db.model("Item", {
  num: db.Int(),
  str: db.VarChar({ size: 30 })
});

(async function () {
  await db.connect();

  const item = new Items();

  item.num = 0;
  item.str = "0";

  await item.save();

  const records = await Items.load({});

  console.log(records); // [{ id: 1, num: 0, str: "0" }]
})();

With TypeScript the instance can be typed using Entry<typeof Model>:

import { Entry, SedentaryPG } from "sedentary-pg";

const db = new SedentaryPG({ database: "db", user: "user", password: "pass" });

const Items = db.model("Item", { num: db.Int(), str: db.VarChar({ size: 30 }) });
type Item = Entry<typeof Items>;

const item: Item = new Items();

item.num = 0;
item.str = "0";

Installation

With npm:

$ npm install --save sedentary-pg

Documentation

The full documentation is on sedentary.readthedocs.io.

Compatibility

Requires:

  • Node.js: v20
  • TypeScript: v5.7 (or none if used in a JavaScript project).
  • PostgreSQL: v15

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, bash.exe can be configured as the script-shell.

> npm config set script-shell bash.exe

License

MIT License

Bugs

Bugs and inconsistencies can be reported @github.

Donating

Satoshis can be donated to this bitcoin address if the package is found useful:

1Md9WFAHrXTb3yPBwQWmUfv2RmzrtbHioB

Keywords

DB

FAQs

Package last updated on 01 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts