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

@danceroutine/tango-orm

v1.10.2

Published

Model-first querying, runtime-managed database access, and transactions for Tango

Readme

@danceroutine/tango-orm

@danceroutine/tango-orm provides Tango's persistence layer.

The default Tango path is model-first. A Tango model can expose Model.objects, the runtime loads database configuration on first use, and most application code stays focused on queries and CRUD flows rather than client wiring.

Install

pnpm add @danceroutine/tango-orm

Install the driver for the dialect you use:

pnpm add pg
# or
pnpm add better-sqlite3

What the package does inside Tango

The package is organized around five concerns:

  • runtime, for Tango-owned config loading and shared DB client lifecycle
  • manager, for Django-style Model.objects access
  • connection, for adapters and concrete DB clients
  • query, for composable query state and compilation
  • transaction, for explicit units of work

Most applications can stay inside Model.objects and QuerySet.

Quick start

import { z } from 'zod';
import '@danceroutine/tango-orm/runtime';
import { Model, t } from '@danceroutine/tango-schema';

const TodoReadSchema = z.object({
    id: z.number(),
    title: z.string(),
    completed: z.coerce.boolean(),
});

export const TodoModel = Model({
    namespace: 'app',
    name: 'Todo',
    schema: TodoReadSchema.extend({
        id: t.primaryKey(z.number().int()),
        title: z.string(),
        completed: t.field(z.coerce.boolean()).defaultValue('false').build(),
    }),
});

const todos = await TodoModel.objects.query().orderBy('-id').fetch(TodoReadSchema);

The side-effect import enables Tango's runtime-backed model augmentation for the process. After that, application code can query through Model.objects directly.

Main building blocks

The root export includes:

  • runtime helpers such as getTangoRuntime
  • manager contracts such as ModelManager
  • connection helpers such as connectDB, AdapterRegistry, PostgresAdapter, and SqliteAdapter
  • query primitives such as QuerySet, QBuilder, Q, QueryCompiler, TableMeta, and QueryExecutor
  • UnitOfWork

Import style

For most applications, root imports are the clearest choice:

import { Q, QuerySet, UnitOfWork } from '@danceroutine/tango-orm';

If you prefer explicit boundaries, the package also exposes runtime, manager, connection, query, and transaction subpaths.

Developer workflow

pnpm --filter @danceroutine/tango-orm build
pnpm --filter @danceroutine/tango-orm typecheck
pnpm --filter @danceroutine/tango-orm test

The package also has integration coverage for dialect-specific behavior:

pnpm --filter @danceroutine/tango-orm test:integration

Bugs and support

License

MIT