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

siquil

v1.0.1

Published

Simple SQL migration tool for PostgreSQL

Readme


Siquil is a simple SQL migration tool for PostgreSQL. It runs each migration inside a transaction, ensuring your database never ends up in a partially migrated state.

Siquil can be used as a CLI tool or as a library in your application.

Getting Started

Installation

npm install -g siquil

Configuration

Set your database connection:

export DATABASE_URL=postgres://user:password@localhost:5432/mydb

Optionally, create a siquil.toml in your project root:

migrations_dir = "migrations"

Initialize your project

siquil database setup

This creates the migrations directory and the __siquil_migrations tracking table.

Code Examples

Generating migrations

$ siquil migration generate create_users

Created migration: 20260127225011_create_users

This creates the following structure:

migrations/
└── 20260127225011_create_users/
    ├── up.sql
    └── down.sql

Writing migrations

Edit up.sql:

CREATE TABLE users (
    id SERIAL PRIMARY KEY,
    name VARCHAR(255) NOT NULL,
    email VARCHAR(255) UNIQUE NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

Edit down.sql:

DROP TABLE users;

Running migrations

$ siquil migration run

Running migration: 20260127225011_create_users
  Applied successfully

Applied 1 migration(s)

Reverting migrations

$ siquil migration revert

Reverting migration: 20260127225011_create_users
  Reverted successfully

Resetting the database

$ siquil database reset

Dropping all tables...
Migrations table recreated
Running migration: 20260127225011_create_users
  Applied successfully

Applied 1 migration(s)

Using as a Library

Siquil can also be used programmatically in your application:

import { Pool } from 'pg';
import { runPendingMigrations } from 'siquil';

async function main() {
  const pool = new Pool({
    connectionString: process.env.DATABASE_URL,
  });

  const applied = await runPendingMigrations(pool, './migrations');

  for (const migration of applied) {
    console.log(`Applied: ${migration.version}_${migration.name}`);
  }

  await pool.end();
}

main();

CLI Reference

| Command | Description | |---------|-------------| | siquil database setup | Initialize migrations table and run pending migrations | | siquil database reset | Drop all tables and re-run all migrations | | siquil migration generate <name> | Create a new migration | | siquil migration run | Run all pending migrations | | siquil migration revert | Revert the last applied migration |

License

Licensed under the MIT License. See LICENSE for details.