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

@blueprime/timescaledb-core

v0.6.1

Published

Pre-1.0 ORM-agnostic core for TimescaleDB SQL/DDL generation, metadata modeling, and identifier safety.

Readme

@blueprime/timescaledb-core

ORM-agnostic core for typeorm-timescaledb: TimescaleDB SQL/DDL generation, the typed migration-operation IR, the schema diff engine, the hypertable metadata model, and identifier-safety helpers. No TypeORM dependency.

You usually don't install this directly — install typeorm-timescaledb, which depends on it. Reach for this package directly only if you are building your own integration (a different ORM, a plain pg tool) on top of the same SQL and diff machinery.

Ships dual ESM + CJS with full type definitions. Requires Node ^20.19.0 || >=22.12.0 and targets TimescaleDB ≥ 2.18.

What's in it

  • SQL builderscreateHypertableSQL, addColumnstorePolicySQL, addRetentionPolicySQL, alter{Compression,Retention}PolicySQL, setChunkIntervalSQL, alterColumnstoreConfigSQL, remove{Retention,Compression}PolicySQL, renameHypertableSQL, the continuous-aggregate builders, and the hyperfunction/toolkit expression helpers. Each returns a reversible { up, down, inspect } — and a generated down never destroys data.
  • The operation IR + one compile choke point — every migration operation is data ({ kind, ...input }), and compileOperation is the single place that turns it into SQL. Every emit path (raw SQL, TypeScript classes, direct apply) routes through it, so they cannot drift apart.
  • The schema-state IR + diff engineSchemaStateIR is the canonical description of a TimescaleDB schema; diffSchemaState(current, desired, opts?) returns an ordered Plan whose steps each carry a safety class (online-safe · needs-recompress · refuse-by-default · one-way) from classifyOperation, plus compilePlan(plan) for its up/down SQL.
  • The normalization layercanonicalizeInterval / intervalsEqual and the engine-default reconciliation that stop Postgres's interval reformatting and auto-filled defaults from reading as schema drift.
  • Identifier and literal safetyassertSafeIdentifier, quoteIdent, quoteLiteral, assertInterval. Every identifier that reaches SQL passes an allow-list; values in literal position are quoted, never concatenated.
import { diffSchemaState, compilePlan, isEmptyPlan } from '@blueprime/timescaledb-core';

const plan = diffSchemaState(currentIR, desiredIR);
if (!isEmptyPlan(plan)) {
  for (const step of plan.steps) console.log(step.safety, step.operation.kind, step.reason);
  const { up, down } = compilePlan(plan); // ready-to-run SQL, reversible
}

Reading a live database into a SchemaStateIR (introspect) and compiling entities into the desired one (compileDesiredState) live in typeorm-timescaledb, since they need the ORM.

Apache-2.0 © BluePrime Technologies.