A utility package providing CLI commands and Node.js API for PostgreSQL database management tasks such as creating, dropping, dumping, loading, truncating databases, and checking structure. Version 0.3.6 is the latest stable release. It integrates with Knex.js and supports Docker for local development. The package offers convenience scripts that automate common database operations, reducing boilerplate code. It is maintained by Smooth Code and follows a simple configuration through knexfile.
npm install knex-scriptsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Truncates all tables in a PostgreSQL database using knex-scripts truncate function with Knex configuration.
Pass --env flag or set NODE_ENV environment variable explicitly.
Ensure knexfile.js exists or use --knexfile <path>.
Add --docker flag to CLI command.
Run 'npm install knex-scripts' or ensure it's in package.json.
Run 'npm install pg' to install PostgreSQL client.
Check knexfile.js has correct environment keys (e.g., development.connection).