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

@smpx/knex-utils

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@smpx/knex-utils

Some utilities using knex to create and manage DBs

  • 1.1.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
2
Weekly downloads
 
Created
Source

Version Downloads License Dependencies Dev Dependencies

knex-utils

It is a set of utility functions for use with knex and knex migrations. Mostly aimed at PostgreSQL.

CLI:

Usage: knex-utils [options] [command]

Options:
  -V, --version     output the version number
  -h, --help        output usage information

Commands:
  refresh
  create [options]

For knex-utils create :

Usage: knex-utils create [options]

Options:
  -m, --migrate  Run migrations too after creating DB
  -h, --help     output usage information

KnexFile:

The cwd should have a knexfile.js, this is used by knex to connect to the DB.

Reference : https://knexjs.org/#knexfile

Consolidate:

** ONLY WORKS WITH POSTGRESQL **

Tool to consolidate all existing schema migrations into one migration and corresponding tables folder with one file for each table.

Supported types for columns:

  • integer
  • increments
  • string
  • jsonb
  • timestamp
  • text
  • boolean
  • float
  • decimal
  • enum
  • specificType :
    • citext

Supported Modifiers:

  • unique
  • index
  • primary
  • composite primary keys
  • nullable
  • notNullable
  • defaultTo
  • maxLength for string
  • numeric_precision for numeric

TODO:

Not supported (for now?):

  • Custom indexes not on columns directly
  • Functions
  • native types

Keywords

FAQs

Package last updated on 23 Jan 2019

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