Code Monkey home page Code Monkey logo

knex-utils's Introduction

knex-utils

Version Downloads License Dependencies Dev Dependencies

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]
  consolidate

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

NOTE: 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

knex-utils's People

Contributors

dependabot[bot] avatar hit12369 avatar lakshya-smpx avatar pradyumna1 avatar rohit-gohri avatar vishal-smpx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.