Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tomkcey/pg-migrate

Package Overview
Dependencies
Maintainers
0
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tomkcey/pg-migrate

A small typed library for managing PostgreSQL migrations.

  • 0.7.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-90.91%
Maintainers
0
Weekly downloads
 
Created
Source

GitHub Actions Workflow Status

How to use

Creating a migration file

For creating migration files you can use the CLI.

npx @tomkcey/pg-migrate create <migration_filename>

While database access is not required at this step, kkowing where to store those migrations is. In any case, here's all the environment variables you will need to use this program through the CLI.

PGUSER=<username>
PGPASSWORD=<password>
PGHOST=localhost
PGPORT=5432
PGDATABASE=<database>
PGSSL=<true/false>
MIGRATION_PATH=<absolute-path-to-migrations-dir>
MIGRATION_TABLE=<tablename>

Only MIGRATION_PATH is required if only using migration file creation through the CLI.

Running migrations up

import { Migrator, MigratorOptions } from "@tomkcey/pg-migrate";

const options: MigratorOptions = { ... }

const migrator = new Migrator(options, someLogger);

await migrator.up();

or npx @tomkcey/pg-migrate up

Running migrations down

import { Migrator, MigratorOptions } from "@tomkcey/pg-migrate";

const options: MigratorOptions = { ... }

const migrator = new Migrator(options, someLogger);

await migrator.down();

or npx @tomkcey/pg-migrate down


Roadmap

  • Create custom errors

Keywords

FAQs

Package last updated on 24 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc