
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
odderon-knex
Advanced tools
A batteries-included SQL query & schema builder for Postgres, MySQL and SQLite3 and the Browser. Forked from knex 0.19.5 and backported with pg-native support.
A SQL query builder that is flexible, portable, and fun to use!
This repository was forked from knex.js 0.19.5 and enriched with a backported support for libpq via pg-native package.
A batteries-included, multi-dialect (MSSQL, MySQL, PostgreSQL, SQLite3, Oracle (including Oracle Wallet Authentication)) query builder for Node.js, featuring:
Node.js versions 8+ 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
We have several examples on the website. Here is the first one to get you started:
const knex = require('knex')({
dialect: 'sqlite3',
connection: {
filename: './data.db',
},
});
// Create a table
knex.schema
.createTable('users', function(table) {
table.increments('id');
table.string('user_name');
})
// ...and another
.createTable('accounts', function(table) {
table.increments('id');
table.string('account_name');
table
.integer('user_id')
.unsigned()
.references('users.id');
})
// Then query the table...
.then(function() {
return knex('users').insert({ user_name: 'Tim' });
})
// ...and using the insert id, insert into the other table.
.then(function(rows) {
return knex('accounts').insert({ account_name: 'knex', user_id: rows[0] });
})
// Query both of the rows.
.then(function() {
return knex('users')
.join('accounts', 'users.id', 'accounts.user_id')
.select('users.user_name as user', 'accounts.account_name as account');
})
// .map over the results
.map(function(row) {
console.log(row);
})
// Finally, add a .catch handler for the promise chain
.catch(function(e) {
console.error(e);
});
FAQs
A batteries-included SQL query & schema builder for Postgres, MySQL and SQLite3 and the Browser. Forked from knex 0.19.5 and backported with pg-native support.
We found that odderon-knex demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.