{"name":"knex","version":"0.21.5-next2","description":"A batteries-included SQL query & schema builder for Postgres, MySQL and SQLite3 and the Browser","main":"knex.js","types":"types/index.d.ts","engines":{"node":">=10"},"scripts":{"format":"prettier --write \"{lib,bin,scripts,test}/**/*.js\"","debug:test":"mocha --inspect-brk --exit -t 0 test/all-tests-suite.js","debug:tape":"node --inspect-brk test/tape/index.js","coveralls":"nyc report --reporter=text-lcov | coveralls","lint":"eslint \"lib/**/*.js\" \"test/**/*.js\"","lint:types":"dtslint types","lint:everything":"npm run lint:types && npm run lint","test:unit":"mocha --exit -t 10000 test/db-less-test-suite.js && npm run test:tape && npm run test:cli","test:db":"mocha --exit -t 10000 test/integration-test-suite.js","test":"mocha --exit -t 10000 test/all-tests-suite.js && npm run test:tape && npm run test:cli","test:coverage":"nyc mocha --exit --check-leaks --globals __core-js_shared__ -t 10000 test/all-tests-suite.js && npm run test:tape && npm run test:cli","test:everything":"npm run lint:everything && npm run test:coverage","test:sqlite":"cross-env DB=sqlite3 npm test","test:tape":"node test/tape/index.js | tap-spec","test:cli":"cross-env KNEX_PATH=../knex.js KNEX=bin/cli.js jake -f test/jake/Jakefile","db:start":"docker-compose -f scripts/docker-compose.yml up --build -d mysql oracledbxe postgres mssql; docker-compose -f scripts/docker-compose.yml up initmssqlknexdb waitmysql waitpostgres waitoracledbxe","db:stop":"docker-compose -f scripts/docker-compose.yml down","db:start:postgres":"docker-compose -f scripts/docker-compose.yml up --build -d postgres && docker-compose -f scripts/docker-compose.yml up waitpostgres","db:stop:postgres":"docker-compose -f scripts/docker-compose.yml down","stress:init":"docker-compose -f scripts/stress-test/docker-compose.yml up --no-start && docker-compose -f scripts/stress-test/docker-compose.yml start","stress:test":"node scripts/stress-test/knex-stress-test.js | grep -A 5 -B 60 -- '- STATS '","stress:destroy":"docker-compose -f scripts/stress-test/docker-compose.yml stop"},"dependencies":{"colorette":"1.2.1","commander":"^5.1.0","debug":"4.1.1","esm":"^3.2.25","getopts":"2.2.5","inherits":"~2.0.4","interpret":"^2.2.0","liftoff":"3.1.0","lodash":"^4.17.19","mkdirp":"^1.0.4","pg-connection-string":"2.3.0","tarn":"^3.0.0","tildify":"2.0.0","uuid":"^7.0.3","v8flags":"^3.2.0"},"peerDependencies":{"mssql":"^6.2.1","mysql":"^2.18.1","mysql2":"^2.1.0","pg":"^8.3.0","sqlite3":"^5.0.0"},"peerDependenciesMeta":{"mssql":{"optional":true},"mysql":{"optional":true},"mysql2":{"optional":true},"pg":{"optional":true},"sqlite3":{"optional":true}},"lint-staged":{"*.{js,json}":["prettier --write","git add"]},"devDependencies":{"@types/node":"^14.0.27","JSONStream":"^1.3.5","chai":"^4.2.0","chai-as-promised":"^7.1.1","chai-subset-in-order":"^2.1.4","cli-testlab":"^2.0.0","coveralls":"^3.1.0","cross-env":"^7.0.2","dtslint":"3.6.14","eslint":"^7.6.0","eslint-config-prettier":"^6.11.0","eslint-plugin-import":"^2.22.0","husky":"^4.2.5","jake":"^8.1.1","lint-staged":"^10.2.11","mocha":"^8.1.1","mock-fs":"^4.12.0","mssql":"^6.2.1","mysql":"^2.18.1","mysql2":"^2.1.0","nyc":"^15.1.0","oracledb":"^5.0.0","pg":"^8.3.0","pg-query-stream":"^3.2.0","prettier":"2.0.5","rimraf":"^3.0.2","sinon":"^9.0.2","sinon-chai":"^3.5.0","source-map-support":"^0.5.19","sqlite3":"^5.0.0","tap-spec":"^5.0.0","tape":"^5.0.1","toxiproxy-node-client":"^2.0.6","ts-node":"^8.10.2","typescript":"3.9.7","webpack-cli":"^3.3.12"},"buildDependencies":["rimraf"],"bin":{"knex":"bin/cli.js"},"repository":{"type":"git","url":"git://github.com/knex/knex.git"},"homepage":"https://knexjs.org","keywords":["sql","query","postgresql","mysql","sqlite3","oracle","mssql"],"author":{"name":"Tim Griesser","url":"https://github.com/tgriesser"},"contributors":[{"name":"Mikael Lepisto"},{"name":"Igor Savin","url":"https://www.codeflashbacks.com"},{"name":"Simon Liden"},{"name":"Paul Gaurab","url":"https://lorefnon.tech"},{"name":"Brian Lauber","url":"https://briandamaged.org"}],"browser":{"./lib/migrate/Migrator.js":"./lib/util/noop.js","./lib/bin/cli.js":"./lib/util/noop.js","./lib/seed/Seeder.js":"./lib/util/noop.js","mssql":false,"mssql/lib/base":false,"tedious":false,"mysql":false,"mysql2":false,"pg":false,"pg-query-stream":false,"oracle":false,"sqlite3":false,"oracledb":false},"react-native":{"./lib/migrate":"./lib/util/noop.js","./lib/seed":"./lib/util/noop.js"},"license":"MIT","tonicExampleFilename":"scripts/runkit-example.js","nyc":{"check-coverage":true,"lines":84,"statements":82,"functions":83,"branches":69,"extension":[".js"]},"husky":{"hooks":{"pre-commit":"lint-staged"}},"gitHead":"369bbd6293e5557f98f801ba3fca2775b97a868b","bugs":{"url":"https://github.com/knex/knex/issues"},"_id":"knex@0.21.5-next2","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-sYaA9r0by/sd6W/8MtgHB8Go1sI34mSf67fW5ME9fw92Kc9bPVEm3ttVVu/lZIuUWWkuqCsU6751BpkaPgeT+g==","shasum":"710e830558a077de8e3ade81243d5132f2df097d","tarball":"http://registry-npm.ywwl.com/knex/download/knex-0.21.5-next2.tgz","fileCount":134,"unpackedSize":588066,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOV2KCRA9TVsSAnZWagAALUUP/3ZaJ7VD5tzZOzCFss/z\nLtyAKvii868uqnmzuP/kYLm2uBUaEOsc/KiLthFJjK3Ri8Ri/waZEWMbpcJI\nQ53icA0F8L3IIjFvKtFclLBO9tvKaqFxCUrhPYtdTNrWVybmZV+O6GQmu9/W\nD4fdY2c7MegS0lDurAOqaTwToKjKVZUQ4RB+u5yl/cCtUUoWF/j3kBn9Yxcm\nVzHBT88og45sIMa2g++fBQxiDdCTxFyNWad+uu/MpD87p5j2Mi4PjuZqxEu2\n0sH9GB0wWt0jwjrgpSmZwPAMbzITEM7rlS6yGjwEZByQUfIUvWVYHxPXoKlI\n7w04fviG9Vdrh5NcOeKUDwEvXSSzFtysWBvyoNfBdkLXNUrZnFL3jZAn8u+C\neFGqCYpHtqnu67x7K41OLq2wuMm320mTYK5b+IOqqWky9NVhXCInkp9wVwJ+\nwuq/qhyqvBws/06yWSiNZZ3eOECPvEoGqoVjr8D2/CPN0jWVq+xC87UIrG1z\nZhuWdudYruXApOd9C491aBHwk6Pg+LHqzQqiocGJ3BmxicHWKQVEYX5Z3MkG\nwLVYJQMaFYDfsqUUvsTcqWsxvSU3VjyeCBVY+i1/H/qx7zwBm4Uap0H4nEbB\nX/YPZlAT0goS+1WC4L0l/4Hf0DCbGioompJZCs/85m3jgx7rt84XnFA6Os+l\nQmVA\r\n=zQ3X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDUzyGveEMosqnZy4UvepBWMh15J4E5pwVXlMT4ontV8AiBda/SQsrYsRz1G9bYKCbIF4cbMlznzXKiYJGiB0KLfjA=="}],"size":144621,"noattachment":false,"key":"/knex/-/knex-0.21.5-next2.tgz"},"maintainers":[{"email":"mikael.lepisto@vincit.com","name":"elhigu"},{"email":"github.erisds@gmail.com","name":"erisds"},{"email":"iselwin@gmail.com","name":"kibertoad"},{"email":"rhys.vdw@gmail.com","name":"rhys-vdw"},{"email":"tgriesser10@gmail.com","name":"tgriesser"},{"email":"simonliden94@gmail.com","name":"wubzz"}],"_npmUser":{"name":"kibertoad","email":"iselwin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/knex_0.21.5-next2_1597595018041_0.8380132648713368"},"_hasShrinkwrap":false,"readme":"# [knex.js](https://knex.github.io/documentation/)\n\n[![npm version](http://img.shields.io/npm/v/knex.svg)](https://npmjs.org/package/knex)\n[![npm downloads](https://img.shields.io/npm/dm/knex.svg)](https://npmjs.org/package/knex)\n![](https://github.com/knex/knex/workflows/CI/badge.svg)\n[![Coverage Status](https://coveralls.io/repos/knex/knex/badge.svg?branch=master)](https://coveralls.io/r/knex/knex?branch=master)\n[![Dependencies Status](https://img.shields.io/librariesio/github/knex/knex)](https://libraries.io/npm/knex)\n[![Gitter chat](https://badges.gitter.im/tgriesser/knex.svg)](https://gitter.im/tgriesser/knex)\n\n> **A SQL query builder that is _flexible_, _portable_, and _fun_ to use!**\n\nA batteries-included, multi-dialect (PostgreSQL, MySQL, CockroachDB, MSSQL, SQLite3, Oracle (including Oracle Wallet Authentication)) query builder for\nNode.js, featuring:\n\n- [transactions](https://knex.github.io/documentation/#Transactions)\n- [connection pooling](https://knex.github.io/documentation/#Installation-pooling)\n- [streaming queries](https://knex.github.io/documentation/#Interfaces-Streams)\n- both a [promise](https://knex.github.io/documentation/#Interfaces-Promises) and [callback](https://knex.github.io/documentation/#Interfaces-Callbacks) API\n- a [thorough test suite](https://github.com/knex/knex/actions)\n\nNode.js versions 12+ are supported.\n\n- Take a look at the [full documentation](https://knex.github.io/documentation) to get started!\n- Browse the [list of plugins and tools](https://github.com/knex/knex/blob/master/ECOSYSTEM.md) built for knex\n- Check out our [recipes wiki](https://github.com/knex/knex/wiki/Recipes) to search for solutions to some specific problems\n- In case of upgrading from an older version, see [migration guide](https://github.com/knex/knex/blob/master/UPGRADING.md)\n\nYou can report bugs and discuss features on the [GitHub issues page](https://github.com/knex/knex/issues) or send tweets to [@kibertoad](http://twitter.com/kibertoad).\n\nFor support and questions, join our [Gitter channel](https://gitter.im/tgriesser/knex).\n\nFor knex-based Object Relational Mapper, see:\n\n- https://github.com/Vincit/objection.js\n- https://github.com/mikro-orm/mikro-orm\n- https://bookshelfjs.org\n\nTo see the SQL that Knex will generate for a given query, you can use [Knex Query Lab](https://michaelavila.com/knex-querylab/)\n\n## Examples\n\nWe have several examples [on the website](http://knexjs.org). Here is the first one to get you started:\n\n```js\nconst knex = require('knex')({\n  client: 'sqlite3',\n  connection: {\n    filename: './data.db',\n  },\n});\n\ntry {\n  // Create a table\n  await knex.schema\n    .createTable('users', (table) => {\n      table.increments('id');\n      table.string('user_name');\n    })\n    // ...and another\n    .createTable('accounts', (table) => {\n      table.increments('id');\n      table.string('account_name');\n      table.integer('user_id').unsigned().references('users.id');\n    });\n\n  // Then query the table...\n  const insertedRows = await knex('users').insert({ user_name: 'Tim' });\n\n  // ...and using the insert id, insert into the other table.\n  await knex('accounts').insert({\n    account_name: 'knex',\n    user_id: insertedRows[0],\n  });\n\n  // Query both of the rows.\n  const selectedRows = await knex('users')\n    .join('accounts', 'users.id', 'accounts.user_id')\n    .select('users.user_name as user', 'accounts.account_name as account');\n\n  // map over the results\n  const enrichedRows = selectedRows.map((row) => ({ ...row, active: true }));\n\n  // Finally, add a catch statement\n} catch (e) {\n  console.error(e);\n}\n```\n\n## TypeScript example\n\n```ts\nimport { Knex, knex } from 'knex';\n\ninterface User {\n  id: number;\n  age: number;\n  name: string;\n  active: boolean;\n  departmentId: number;\n}\n\nconst config: Knex.Config = {\n  client: 'sqlite3',\n  connection: {\n    filename: './data.db',\n  },\n};\n\nconst knexInstance = knex(config);\n\ntry {\n  const users = await knex<User>('users').select('id', 'age');\n} catch (err) {\n  // error handling\n}\n```\n\n## Usage as ESM module\n\nIf you are launching your Node application with `--experimental-modules`, `knex.mjs` should be picked up automatically and named ESM import should work out-of-the-box.\nOtherwise, if you want to use named imports, you'll have to import knex like this:\n\n```js\nimport { knex } from 'knex/knex.mjs';\n```\n\nYou can also just do the default import:\n\n```js\nimport knex from 'knex';\n```\n\nIf you are not using TypeScript and would like the IntelliSense of your IDE to work correctly, it is recommended to set the type explicitly:\n\n```js\n/**\n * @type {Knex}\n */\nconst database = knex({\n  client: 'mysql',\n  connection: {\n    host: '127.0.0.1',\n    user: 'your_database_user',\n    password: 'your_database_password',\n    database: 'myapp_test',\n  },\n});\ndatabase.migrate.latest();\n```\n","publish_time":1597595018199,"_cnpm_publish_time":1597595018199,"dist-tags":{"beta":"0.21.5-next1","latest":"3.3.0","next":"2.5.1","oracle-fix":"0.16.6-oracle-fix"}}