knex

WebJar for knex

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

knex
Последняя версия

Последняя версия

0.12.6
Дата

Дата

Тип

Тип

jar
Описание

Описание

knex
WebJar for knex
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/tgriesser/knex

Скачать knex

Имя Файла Размер
knex-0.12.6.pom
knex-0.12.6.jar 260 KB
knex-0.12.6-sources.jar 22 bytes
knex-0.12.6-javadoc.jar 22 bytes
Обзор

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/knex/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>knex</artifactId>
    <version>0.12.6</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/knex/
implementation 'org.webjars.npm:knex:0.12.6'
// https://jarcasting.com/artifacts/org.webjars.npm/knex/
implementation ("org.webjars.npm:knex:0.12.6")
'org.webjars.npm:knex:jar:0.12.6'
<dependency org="org.webjars.npm" name="knex" rev="0.12.6">
  <artifact name="knex" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='knex', version='0.12.6')
)
libraryDependencies += "org.webjars.npm" % "knex" % "0.12.6"
[org.webjars.npm/knex "0.12.6"]

Зависимости

compile (17)

Идентификатор библиотеки Тип Версия
org.webjars.npm : readable-stream jar [1.1.12,2)
org.webjars.npm : babel-runtime jar [6.11.6,7)
org.webjars.npm : node-uuid jar [1.4.7,2)
org.webjars.npm : commander jar [2.2.0,3)
org.webjars.npm : minimist jar [1.1.0,1.2)
org.webjars.npm : tildify jar [1.0.0,1.1)
org.webjars.npm : debug jar [2.1.3,3)
org.webjars.npm : liftoff jar [2.2.0,2.3)
org.webjars.npm : v8flags jar [2.0.2,3)
org.webjars.npm : inherits jar [2.0.1,2.1)
org.webjars.npm : chalk jar [1.0.0,2)
org.webjars.npm » generic-pool jar [2.4.2,3)
org.webjars.npm : pg-connection-string jar [0.1.3,0.2)
org.webjars.npm : bluebird jar [3.4.6,4)
org.webjars.npm : interpret jar [0.6.5,0.7)
org.webjars.npm : mkdirp jar [0.5.0,0.6)
org.webjars.npm : lodash jar [4.6.0,5)

Модули Проекта

Данный проект не имеет модулей.

knex.js

npm version npm downloads Build Status Coverage Status Dependencies Status Gitter chat Language Grade: JavaScript

A SQL query builder that is flexible, portable, and fun to use!

A batteries-included, multi-dialect (MSSQL, MySQL, PostgreSQL, SQLite3, Oracle (including Oracle Wallet Authentication)) query builder for Node.js, featuring:

Node.js versions 10+ are supported.

Read the full documentation to get started!
Or check out our Recipes wiki to search for solutions to some specific problems
If upgrading from older version, see Upgrading instructions

For support and questions, join the #bookshelf channel on freenode IRC

For an Object Relational Mapper, see:

To see the SQL that Knex will generate for a given query, see: Knex Query Lab

Examples

We have several examples on the website. Here is the first one to get you started:

const knex = require('knex')({
  client: 'sqlite3',
  connection: {
    filename: './data.db',
  },
});

// Create a table
knex.schema
  .createTable('users', table => {
    table.increments('id');
    table.string('user_name');
  })

  // ...and another
  .createTable('accounts', table => {
    table.increments('id');
    table.string('account_name');
    table
      .integer('user_id')
      .unsigned()
      .references('users.id');
  })

  // Then query the table...
  .then(() =>
    knex('users').insert({ user_name: 'Tim' })
  )

  // ...and using the insert id, insert into the other table.
  .then(rows => 
    knex('accounts').insert({ account_name: 'knex', user_id: rows[0] })
  )

  // Query both of the rows.
  .then(() => 
    knex('users')
      .join('accounts', 'users.id', 'accounts.user_id')
      .select('users.user_name as user', 'accounts.account_name as account')
  )

  // map over the results
  .then(rows =>
    rows.map(row => {
      console.log(row)
    })
  )

  // Finally, add a .catch handler for the promise chain
  .catch(e => {
    console.error(e);
  });

Версии библиотеки

Версия
0.12.6