npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@spinajs/orm-postgres

v2.0.543

Published

orm postgresql integration

Readme

@spinajs/orm-postgres

PostgreSQL driver for the SpinaJS ORM.

Usage

import { Configuration } from '@spinajs/configuration';

// connection configuration
{
  db: {
    Connections: [
      {
        Driver: 'orm-driver-postgres',
        Name: 'default',
        Host: 'localhost',
        Port: 5432,
        User: 'postgres',
        Password: 'postgres',
        Database: 'app',
        Options: {
          // optional: pins search_path for every pooled connection; also the schema
          // tableInfo() reads from. Defaults to `public`.
          Schema: 'public',
        },
      },
    ],
  },
}

Dialect notes — differences from the shared @spinajs/orm-sql (MySQL-flavoured) layer

| Feature | MySQL / shared layer | This driver | | --- | --- | --- | | Identifier quoting | `backticks` | "double quotes" | | Bound parameters | ? | rewritten to $1..$n at execution | | Generated keys | LAST_INSERT_ID() | RETURNING rows (insertReturning: true) | | Auto increment | AUTO_INCREMENT, NULL in VALUES assigns the key | GENERATED BY DEFAULT AS IDENTITY, DEFAULT in VALUES assigns the key | | Upsert | ON DUPLICATE KEY UPDATE c = VALUES(c) | ON CONFLICT (cols) DO UPDATE SET c = EXCLUDED.c | | Insert-or-ignore | INSERT IGNORE | ON CONFLICT DO NOTHING | | Offset without limit | LIMIT 18446744073709551615 | bare OFFSET | | ENUM / SET columns | native types | TEXT (+ CHECK (col IN (...)) for enum) | | DATETIME / DOUBLE / BLOB / JSON | native names | TIMESTAMP / DOUBLE PRECISION / BYTEA / JSONB | | UNSIGNED, per-column CHARACTER SET, inline COMMENT | supported | dropped (no postgres spelling) | | MODIFY column | one clause restates the column | ALTER COLUMN ... TYPE / SET / DROP actions, MODIFY semantics kept (omitted NOT NULL / DEFAULT is dropped) | | CREATE DATABASE IF NOT EXISTS | supported | refused — postgres has no such clause | | CREATE EVENT, table history triggers, CREATE TABLE ... LIKE | MySQL syntax | unregistered — fail with a DI error naming the abstraction | | DECIMAL / NUMERIC / BIGINT in responses | driver-dependent | strings (node-postgres refuses to lose precision above 2^53); ResponseSchemaTypes says so |

Transactions run on a dedicated pooled client with full savepoint support; all four standard isolation levels are accepted (READ UNCOMMITTED behaves as READ COMMITTED, postgres' documented, standard-permitted upgrade).

Running integration tests

The integration suite expects the docker fixture from the repository root:

docker compose --profile test up -d postgres

It listens on port 15432 by default; override with ORM_TEST_POSTGRES_PORT.