Socket
Socket
Sign inDemoInstall

postgrator

Package Overview
Dependencies
11
Maintainers
2
Versions
63
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install
234567Next

7.2.0

Diff

Changelog

Source

7.2.0

July 9, 2023

  • Support better-sqlite3
rickbergfalk
published 7.1.1 •

Changelog

Source

7.1.1

September 21, 2022

  • Fix migration method code comment
  • Use INTEGER for sqlite3 version type
rickbergfalk
published 7.1.0 •

Changelog

Source

7.1.0

March 31, 2022

  • Add sqlite3 support
rickbergfalk
published 7.0.0 •

Changelog

Source

7.0.0

February 23, 2022

  • getDatabaseVersion returns 0 when schema version table does not exist instead of undefined. This is technically breaking if you rely on the undefined returned in version 5.0.1.
  • Fix DEP0151 warning about ext resolution
rickbergfalk
published 6.0.0 •

Changelog

Source

6.0.0

February 21, 2022

Breaking

Postgrator is now an ES module and requires Node 14 or later. .cjs and .mjs migration files are now supported.

No other changes have been made.

rickbergfalk
published 5.0.1 •

Changelog

Source

5.0.1

February 18, 2022

  • Fix getDatabaseVersion error when schemaversion table does not exist. undefined is returned instead.
rickbergfalk
published 5.0.0 •

Changelog

Source

5.0.0

October 14, 2021

Version 5 represents an effort to simplify things, allow more flexibility, and reduce the maintenance of this package.

This is made possible by requiring the database query execution function be injected to postgrator. Postgrator no longer manages the database connection, and as a result no longer needs to maintain a mapping to specific database driver implementations.

Despite all the breaking changes below, nothing has changed in the overall migration file approach. Migrations that worked for previous versions of postgrator will still work in v5.

See examples/ directory for quick overview of how v5 is used.

Features

  • md5 validation may be skipped for specific migrations by deleting the md5 value from your DB's schemaversion table.

Fixes

  • Honors uppercase characters in postgres schema table name (#98)
  • JS migrations no longer run during validation, preventing unwanted migration failures (#124)

BREAKING

  • Nodejs 12 or later required.
  • Removed host, port, username, password, ssl, options. Manage connections with execQuery instead.
  • Driver value mysql2 unsupported. (You can still use the mysql2 package for your execQuery implementation, but set driver to mysql)
  • RemovedmigrationDirectory option. Use migrationPattern instead. In most cases it will be path/to/migrations/*. Any glob syntax supported.
  • Removed GO keyword splitting for mssql. Using GO could leave your system in a partially migrated state on failure and is not recommended.
  • filename in migration result is full file path
  • Removed md5 checksum validation for JS migrations. JS migrations are dynamic, and JS style trends could vary over time if a tool like Prettier is applied.
  • JS migrations do not generate SQL until immediately prior to being applied. Previously, JS migrations generated SQL prior to any migrations running. This was problematic for cases where JS migrations no longer successfullly generated SQL.
rickbergfalk
published 4.3.1 •

Changelog

Source

4.3.1

October 9, 2021

  • Undeprecate currentSchema config. It'll stay for v5.
rickbergfalk
published 4.3.0 •

Changelog

Source

4.3.0

October 8, 2021

  • Add execQuery function option to allow maximum flexibility in database connection management. Postgrator-owned database connections (the connections established using host, username, password, etc.) are deprecated, and will be removed in Postgrator 5.
  • Deprecate host, port, username, password, ssl, options, currentSchema config.
  • Deprecate runQuery utility function (use your db driver directly).
  • Deprecate migrationDirectory in favor of migrationPattern glob.
rickbergfalk
published 4.2.0 •

Changelog

Source

4.2.0

July 25, 2021

  • Add support for mssql 7
234567Next
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc