api documentation for knex (v0.12.9)

A batteries-included SQL query & schema builder for Postgres, MySQL and SQLite3 and the Browser

table of contents

  1. module knex
    1. function knex.Client ()
    2. function knex.formatter (client)
    3. function knex.functionhelper (client)
    4. function knex.migrate (knex)
    5. function knex.raw (sql, bindings)
    6. function knex.runner (client, builder)
    7. function knex.seed (knex)
    8. function knex.transaction (client, container, config, outerTx)
    9. object knex.Client.prototype
    10. object knex.formatter.prototype
    11. object knex.functionhelper.prototype
    12. object knex.helpers
    13. object knex.migrate.prototype
    14. object knex.raw.prototype
    15. object knex.runner.prototype
    16. object knex.seed.prototype
    17. object knex.transaction.prototype
  2. module knex.Client
    1. function knex.Client ()
    2. function knex.Client.super_ ()
  3. module knex.Client.prototype
    1. boolean knex.Client.prototype.canCancelQuery
    2. function knex.Client.prototype._escapeBinding (val)
    3. function knex.Client.prototype._formatQuery (sql, bindings, timeZone)
    4. function knex.Client.prototype.acquireConnection ()
    5. function knex.Client.prototype.assertCanCancelQuery ()
    6. function knex.Client.prototype.cancelQuery ()
    7. function knex.Client.prototype.columnBuilder (tableBuilder, type, args)
    8. function knex.Client.prototype.columnCompiler (tableBuilder, columnBuilder)
    9. function knex.Client.prototype.database ()
    10. function knex.Client.prototype.destroy (callback)
    11. function knex.Client.prototype.formatter ()
    12. function knex.Client.prototype.initializeDriver ()
    13. function knex.Client.prototype.initializePool (config)
    14. function knex.Client.prototype.poolDefaults (poolConfig)
    15. function knex.Client.prototype.prepBindings (bindings)
    16. function knex.Client.prototype.query (connection, obj)
    17. function knex.Client.prototype.queryBuilder ()
    18. function knex.Client.prototype.queryCompiler (builder)
    19. function knex.Client.prototype.raw ()
    20. function knex.Client.prototype.releaseConnection (connection)
    21. function knex.Client.prototype.runner (connection)
    22. function knex.Client.prototype.schemaBuilder ()
    23. function knex.Client.prototype.schemaCompiler (builder)
    24. function knex.Client.prototype.stream (connection, obj, _stream, options)
    25. function knex.Client.prototype.tableBuilder (type, tableName, fn)
    26. function knex.Client.prototype.tableCompiler (tableBuilder)
    27. function knex.Client.prototype.toString ()
    28. function knex.Client.prototype.transaction (container, config, outerTx)
    29. function knex.Client.prototype.validateConnection (connection)
    30. function knex.Client.prototype.wrapIdentifier (value)
  4. module knex.formatter
    1. function knex.formatter (client)
  5. module knex.formatter.prototype
    1. function knex.formatter.prototype._wrapString (value)
    2. function knex.formatter.prototype.alias (first, second)
    3. function knex.formatter.prototype.columnize (target)
    4. function knex.formatter.prototype.compileCallback (callback, method)
    5. function knex.formatter.prototype.direction (value)
    6. function knex.formatter.prototype.operator (value)
    7. function knex.formatter.prototype.outputQuery (compiled, isParameter)
    8. function knex.formatter.prototype.parameter (value)
    9. function knex.formatter.prototype.parameterize (values, notSetValue)
    10. function knex.formatter.prototype.rawOrFn (value, method)
    11. function knex.formatter.prototype.unwrapRaw (value, isParameter)
    12. function knex.formatter.prototype.wrap (value)
    13. function knex.formatter.prototype.wrapAsIdentifier (value)
  6. module knex.functionhelper
    1. function knex.functionhelper (client)
  7. module knex.functionhelper.prototype
    1. function knex.functionhelper.prototype.now ()
  8. module knex.helpers
    1. boolean knex.helpers.__esModule
    2. function knex.helpers.containsUndefined (mixed)
    3. function knex.helpers.debugLog (msg)
    4. function knex.helpers.deprecate (method, alternate)
    5. function knex.helpers.error (msg)
    6. function knex.helpers.exit (msg)
    7. function knex.helpers.normalizeArr ()
    8. function knex.helpers.skim (data)
    9. function knex.helpers.warn (msg)
  9. module knex.migrate
    1. function knex.migrate (knex)
  10. module knex.migrate.prototype
    1. function knex.migrate.prototype._absoluteConfigDir ()
    2. function knex.migrate.prototype._createMigrationLockTable (tableName)
    3. function knex.migrate.prototype._createMigrationTable (tableName)
    4. function knex.migrate.prototype._ensureFolder ()
    5. function knex.migrate.prototype._ensureTable ()
    6. function knex.migrate.prototype._freeLock ()
    7. function knex.migrate.prototype._generateStubTemplate ()
    8. function knex.migrate.prototype._getLastBatch ()
    9. function knex.migrate.prototype._getLock ()
    10. function knex.migrate.prototype._getLockTableName ()
    11. function knex.migrate.prototype._isLocked (trx)
    12. function knex.migrate.prototype._latestBatchNumber ()
    13. function knex.migrate.prototype._listAll (config)
    14. function knex.migrate.prototype._listCompleted ()
    15. function knex.migrate.prototype._lockMigrations (trx)
    16. function knex.migrate.prototype._migrationData ()
    17. function knex.migrate.prototype._runBatch (migrations, direction)
    18. function knex.migrate.prototype._transaction (migration, direction, name)
    19. function knex.migrate.prototype._useTransaction (migration, allTransactionsDisabled)
    20. function knex.migrate.prototype._validateMigrationStructure (name)
    21. function knex.migrate.prototype._waterfallBatch (batchNo, migrations, direction)
    22. function knex.migrate.prototype._writeNewMigration (name, tmpl)
    23. function knex.migrate.prototype.currentVersion (config)
    24. function knex.migrate.prototype.forceFreeMigrationsLock (config)
    25. function knex.migrate.prototype.latest (config)
    26. function knex.migrate.prototype.make (name, config)
    27. function knex.migrate.prototype.rollback (config)
    28. function knex.migrate.prototype.setConfig (config)
    29. function knex.migrate.prototype.status (config)
  11. module knex.raw
    1. function knex.raw ()
    2. function knex.raw.super_ ()
  12. module knex.raw.prototype
    1. function knex.raw.prototype.asCallback ()
    2. function knex.raw.prototype.bind ()
    3. function knex.raw.prototype.catch ()
    4. function knex.raw.prototype.connection (connection)
    5. function knex.raw.prototype.debug (enabled)
    6. function knex.raw.prototype.delay ()
    7. function knex.raw.prototype.ensure ()
    8. function knex.raw.prototype.finally ()
    9. function knex.raw.prototype.get ()
    10. function knex.raw.prototype.map ()
    11. function knex.raw.prototype.mapSeries ()
    12. function knex.raw.prototype.options (opts)
    13. function knex.raw.prototype.pipe (writable, options)
    14. function knex.raw.prototype.reduce ()
    15. function knex.raw.prototype.reflect ()
    16. function knex.raw.prototype.return ()
    17. function knex.raw.prototype.set (sql, bindings)
    18. function knex.raw.prototype.spread ()
    19. function knex.raw.prototype.stream (options)
    20. function knex.raw.prototype.tap ()
    21. function knex.raw.prototype.then ()
    22. function knex.raw.prototype.thenReturn ()
    23. function knex.raw.prototype.timeout (ms)
    24. function knex.raw.prototype.toQuery (tz)
    25. function knex.raw.prototype.toSQL (method, tz)
    26. function knex.raw.prototype.toString ()
    27. function knex.raw.prototype.transacting (t)
    28. function knex.raw.prototype.wrap (before, after)
    29. function knex.raw.prototype.yield ()
  13. module knex.runner
    1. function knex.runner (client, builder)
  14. module knex.runner.prototype
    1. function knex.runner.prototype.ensureConnection ()
    2. function knex.runner.prototype.pipe (writable, options)
    3. function knex.runner.prototype.query ()
    4. function knex.runner.prototype.queryArray (queries)
    5. function knex.runner.prototype.run ()
    6. function knex.runner.prototype.stream (options, handler)
  15. module knex.seed
    1. function knex.seed (knex)
  16. module knex.seed.prototype
    1. function knex.seed.prototype._absoluteConfigDir ()
    2. function knex.seed.prototype._ensureFolder ()
    3. function knex.seed.prototype._generateStubTemplate ()
    4. function knex.seed.prototype._listAll ()
    5. function knex.seed.prototype._runSeeds (seeds)
    6. function knex.seed.prototype._seedData ()
    7. function knex.seed.prototype._validateSeedStructure (name)
    8. function knex.seed.prototype._waterfallBatch (seeds)
    9. function knex.seed.prototype._writeNewSeed (name)
    10. function knex.seed.prototype.make (name, config)
    11. function knex.seed.prototype.run ()
    12. function knex.seed.prototype.setConfig (config)
  17. module knex.transaction
    1. function knex.transaction (client, container, config, outerTx)
  18. module knex.transaction.prototype
    1. function knex.transaction.prototype.acquireConnection (client, config, txid)
    2. function knex.transaction.prototype.asCallback ()
    3. function knex.transaction.prototype.begin (conn)
    4. function knex.transaction.prototype.bind ()
    5. function knex.transaction.prototype.catch ()
    6. function knex.transaction.prototype.commit (conn, value)
    7. function knex.transaction.prototype.debug (enabled)
    8. function knex.transaction.prototype.delay ()
    9. function knex.transaction.prototype.ensure ()
    10. function knex.transaction.prototype.exec ()
    11. function knex.transaction.prototype.finally ()
    12. function knex.transaction.prototype.get ()
    13. function knex.transaction.prototype.isCompleted ()
    14. function knex.transaction.prototype.map ()
    15. function knex.transaction.prototype.mapSeries ()
    16. function knex.transaction.prototype.query (conn, sql, status, value)
    17. function knex.transaction.prototype.reduce ()
    18. function knex.transaction.prototype.reflect ()
    19. function knex.transaction.prototype.release (conn, value)
    20. function knex.transaction.prototype.return ()
    21. function knex.transaction.prototype.rollback (conn, error)
    22. function knex.transaction.prototype.rollbackTo (conn, error)
    23. function knex.transaction.prototype.savepoint (conn)
    24. function knex.transaction.prototype.spread ()
    25. function knex.transaction.prototype.tap ()
    26. function knex.transaction.prototype.then ()
    27. function knex.transaction.prototype.thenReturn ()
    28. function knex.transaction.prototype.yield ()

module knex

function knex.Client ()

function knex.formatter (client)

function knex.functionhelper (client)

function knex.migrate (knex)

function knex.raw (sql, bindings)

function knex.runner (client, builder)

function knex.seed (knex)

function knex.transaction (client, container, config, outerTx)

module knex.Client

function knex.Client ()

function knex.Client.super_ ()

module knex.Client.prototype

function knex.Client.prototype._escapeBinding (val)

function knex.Client.prototype._formatQuery (sql, bindings, timeZone)

function knex.Client.prototype.acquireConnection ()

function knex.Client.prototype.assertCanCancelQuery ()

function knex.Client.prototype.cancelQuery ()

function knex.Client.prototype.columnBuilder (tableBuilder, type, args)

function knex.Client.prototype.columnCompiler (tableBuilder, columnBuilder)

function knex.Client.prototype.database ()

function knex.Client.prototype.destroy (callback)

function knex.Client.prototype.formatter ()

function knex.Client.prototype.initializeDriver ()

function knex.Client.prototype.initializePool (config)

function knex.Client.prototype.poolDefaults (poolConfig)

function knex.Client.prototype.prepBindings (bindings)

function knex.Client.prototype.query (connection, obj)

function knex.Client.prototype.queryBuilder ()

function knex.Client.prototype.queryCompiler (builder)

function knex.Client.prototype.raw ()

function knex.Client.prototype.releaseConnection (connection)

function knex.Client.prototype.runner (connection)

function knex.Client.prototype.schemaBuilder ()

function knex.Client.prototype.schemaCompiler (builder)

function knex.Client.prototype.stream (connection, obj, _stream, options)

function knex.Client.prototype.tableBuilder (type, tableName, fn)

function knex.Client.prototype.tableCompiler (tableBuilder)

function knex.Client.prototype.toString ()

function knex.Client.prototype.transaction (container, config, outerTx)

function knex.Client.prototype.validateConnection (connection)

function knex.Client.prototype.wrapIdentifier (value)

module knex.formatter

function knex.formatter (client)

module knex.formatter.prototype

function knex.formatter.prototype._wrapString (value)

function knex.formatter.prototype.alias (first, second)

function knex.formatter.prototype.columnize (target)

function knex.formatter.prototype.compileCallback (callback, method)

function knex.formatter.prototype.direction (value)

function knex.formatter.prototype.operator (value)

function knex.formatter.prototype.outputQuery (compiled, isParameter)

function knex.formatter.prototype.parameter (value)

function knex.formatter.prototype.parameterize (values, notSetValue)

function knex.formatter.prototype.rawOrFn (value, method)

function knex.formatter.prototype.unwrapRaw (value, isParameter)

function knex.formatter.prototype.wrap (value)

function knex.formatter.prototype.wrapAsIdentifier (value)

module knex.functionhelper

function knex.functionhelper (client)

module knex.functionhelper.prototype

function knex.functionhelper.prototype.now ()

module knex.helpers

function knex.helpers.containsUndefined (mixed)

function knex.helpers.debugLog (msg)

function knex.helpers.deprecate (method, alternate)

function knex.helpers.error (msg)

function knex.helpers.exit (msg)

function knex.helpers.normalizeArr ()

function knex.helpers.skim (data)

function knex.helpers.warn (msg)

module knex.migrate

function knex.migrate (knex)

module knex.migrate.prototype

function knex.migrate.prototype._absoluteConfigDir ()

function knex.migrate.prototype._createMigrationLockTable (tableName)

function knex.migrate.prototype._createMigrationTable (tableName)

function knex.migrate.prototype._ensureFolder ()

function knex.migrate.prototype._ensureTable ()

function knex.migrate.prototype._freeLock ()

function knex.migrate.prototype._generateStubTemplate ()

function knex.migrate.prototype._getLastBatch ()

function knex.migrate.prototype._getLock ()

function knex.migrate.prototype._getLockTableName ()

function knex.migrate.prototype._isLocked (trx)

function knex.migrate.prototype._latestBatchNumber ()

function knex.migrate.prototype._listAll (config)

function knex.migrate.prototype._listCompleted ()

function knex.migrate.prototype._lockMigrations (trx)

function knex.migrate.prototype._migrationData ()

function knex.migrate.prototype._runBatch (migrations, direction)

function knex.migrate.prototype._transaction (migration, direction, name)

function knex.migrate.prototype._useTransaction (migration, allTransactionsDisabled)

function knex.migrate.prototype._validateMigrationStructure (name)

function knex.migrate.prototype._waterfallBatch (batchNo, migrations, direction)

function knex.migrate.prototype._writeNewMigration (name, tmpl)

function knex.migrate.prototype.currentVersion (config)

function knex.migrate.prototype.forceFreeMigrationsLock (config)

function knex.migrate.prototype.latest (config)

function knex.migrate.prototype.make (name, config)

function knex.migrate.prototype.rollback (config)

function knex.migrate.prototype.setConfig (config)

function knex.migrate.prototype.status (config)

module knex.raw

function knex.raw ()

function knex.raw.super_ ()

module knex.raw.prototype

function knex.raw.prototype.asCallback ()

function knex.raw.prototype.bind ()

function knex.raw.prototype.catch ()

function knex.raw.prototype.connection (connection)

function knex.raw.prototype.debug (enabled)

function knex.raw.prototype.delay ()

function knex.raw.prototype.ensure ()

function knex.raw.prototype.finally ()

function knex.raw.prototype.get ()

function knex.raw.prototype.map ()

function knex.raw.prototype.mapSeries ()

function knex.raw.prototype.options (opts)

function knex.raw.prototype.pipe (writable, options)

function knex.raw.prototype.reduce ()

function knex.raw.prototype.reflect ()

function knex.raw.prototype.return ()

function knex.raw.prototype.set (sql, bindings)

function knex.raw.prototype.spread ()

function knex.raw.prototype.stream (options)

function knex.raw.prototype.tap ()

function knex.raw.prototype.then ()

function knex.raw.prototype.thenReturn ()

function knex.raw.prototype.timeout (ms)

function knex.raw.prototype.toQuery (tz)

function knex.raw.prototype.toSQL (method, tz)

function knex.raw.prototype.toString ()

function knex.raw.prototype.transacting (t)

function knex.raw.prototype.wrap (before, after)

function knex.raw.prototype.yield ()

module knex.runner

function knex.runner (client, builder)

module knex.runner.prototype

function knex.runner.prototype.ensureConnection ()

function knex.runner.prototype.pipe (writable, options)

function knex.runner.prototype.query ()

function knex.runner.prototype.queryArray (queries)

function knex.runner.prototype.run ()

function knex.runner.prototype.stream (options, handler)

module knex.seed

function knex.seed (knex)

module knex.seed.prototype

function knex.seed.prototype._absoluteConfigDir ()

function knex.seed.prototype._ensureFolder ()

function knex.seed.prototype._generateStubTemplate ()

function knex.seed.prototype._listAll ()

function knex.seed.prototype._runSeeds (seeds)

function knex.seed.prototype._seedData ()

function knex.seed.prototype._validateSeedStructure (name)

function knex.seed.prototype._waterfallBatch (seeds)

function knex.seed.prototype._writeNewSeed (name)

function knex.seed.prototype.make (name, config)

function knex.seed.prototype.run ()

function knex.seed.prototype.setConfig (config)

module knex.transaction

function knex.transaction (client, container, config, outerTx)

module knex.transaction.prototype

function knex.transaction.prototype.acquireConnection (client, config, txid)

function knex.transaction.prototype.asCallback ()

function knex.transaction.prototype.begin (conn)

function knex.transaction.prototype.bind ()

function knex.transaction.prototype.catch ()

function knex.transaction.prototype.commit (conn, value)

function knex.transaction.prototype.debug (enabled)

function knex.transaction.prototype.delay ()

function knex.transaction.prototype.ensure ()

function knex.transaction.prototype.exec ()

function knex.transaction.prototype.finally ()

function knex.transaction.prototype.get ()

function knex.transaction.prototype.isCompleted ()

function knex.transaction.prototype.map ()

function knex.transaction.prototype.mapSeries ()

function knex.transaction.prototype.query (conn, sql, status, value)

function knex.transaction.prototype.reduce ()

function knex.transaction.prototype.reflect ()

function knex.transaction.prototype.release (conn, value)

function knex.transaction.prototype.return ()

function knex.transaction.prototype.rollback (conn, error)

function knex.transaction.prototype.rollbackTo (conn, error)

function knex.transaction.prototype.savepoint (conn)

function knex.transaction.prototype.spread ()

function knex.transaction.prototype.tap ()

function knex.transaction.prototype.then ()

function knex.transaction.prototype.thenReturn ()

function knex.transaction.prototype.yield ()

[ this document was created with utility2 ]