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

@simplysm/orm-node

v14.0.15

Published

심플리즘 패키지 - ORM (node)

Readme

@simplysm/orm-node

Node.js ORM module for the Simplysm framework. Provides database connections, query execution, and a high-level ORM factory for MySQL, MSSQL, and PostgreSQL.

Installation

npm install @simplysm/orm-node
# or
pnpm add @simplysm/orm-node

Peer dependencies (install the driver for your DBMS):

  • MySQL: mysql2
  • MSSQL: tedious
  • PostgreSQL: pg, pg-copy-streams

API Overview

ORM Factory

| Export | Type | Description | |--------|------|-------------| | createOrm | Function | Create an ORM instance with connection management | | Orm | Interface | ORM instance type with connect and connectWithoutTransaction | | OrmOptions | Interface | ORM options (database/schema override) |

Query Execution

| Export | Type | Description | |--------|------|-------------| | NodeDbContextExecutor | Class | Node.js DbContextExecutor implementation |

Connection

| Export | Type | Description | |--------|------|-------------| | createDbConn | Function | Create a low-level DB connection | | DbConn | Interface | Low-level DB connection interface | | MysqlDbConn | Class | MySQL connection implementation | | MssqlDbConn | Class | MSSQL connection implementation | | PostgresqlDbConn | Class | PostgreSQL connection implementation |

Config Types

| Export | Type | Description | |--------|------|-------------| | DbConnConfig | Type | Union of all dialect-specific configs | | MysqlDbConnConfig | Interface | MySQL connection config | | MssqlDbConnConfig | Interface | MSSQL connection config | | PostgresqlDbConnConfig | Interface | PostgreSQL connection config |

Constants & Utilities

| Export | Type | Description | |--------|------|-------------| | DB_CONN_CONNECT_TIMEOUT | Constant | Connection timeout: 10,000ms (10s) | | DB_CONN_DEFAULT_TIMEOUT | Constant | Query timeout: 600,000ms (10min) | | DB_CONN_ERRORS | Constant | Error message constants | | getDialectFromConfig | Function | Extract Dialect from config (mssql-azure -> mssql) |

Usage Examples

Basic ORM Usage

import { defineDbContext } from "@simplysm/orm-common";
import { createOrm } from "@simplysm/orm-node";

const MyDb = defineDbContext({
  tables: { user: User, post: Post },
});

const orm = createOrm(MyDb, {
  dialect: "mysql",
  host: "localhost",
  port: 3306,
  username: "root",
  password: "password",
  database: "mydb",
});

// With transaction (auto commit/rollback)
const users = await orm.connect(async (db) => {
  return db.user().execute();
});

// Without transaction (for DDL or read-only)
await orm.connectWithoutTransaction(async (db) => {
  await db.initialize();
});

Low-Level Connection

import { createDbConn } from "@simplysm/orm-node";

const conn = await createDbConn({
  dialect: "postgresql",
  host: "localhost",
  port: 5432,
  username: "postgres",
  password: "password",
  database: "mydb",
});

await conn.connect();
const results = await conn.execute(["SELECT * FROM users"]);
await conn.close();

With OrmOptions Override

const orm = createOrm(MyDb, config, {
  database: "other_db",  // Override config.database
  schema: "custom",      // Override config.schema
});