Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
knex-redshift
Advanced tools
A batteries-included SQL query & schema builder for Postgres, MySQL and SQLite3 and the Browser
A SQL query builder that is flexible, portable, and fun to use!
A batteries-included, multi-dialect (MySQL, PostgreSQL, SQLite3, WebSQL, Oracle) query builder for Node.js and the Browser, featuring:
Read the full documentation to get started!
For support and questions, join the #bookshelf channel on freenode IRC
For an Object Relational Mapper, see: http://bookshelfjs.org
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:
var 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.insert({user_name: 'Tim'}).into('users');
})
// ...and using the insert id, insert into the other table.
.then(function(rows) {
return knex.table('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);
});
0.10.0 - 15 Feb, 2016
insert
and update
now ignore undefined
values. Back compatibility is provided through the option useNullAsDefault
. #1174, #1043countDistinct
, avgDistinct
and sumDistinct
. #1046schema.jsonb
. Deprecated schema.json(column, true)
. #991??
. #1103query
event when triggered by transactions. #855.
. #1181batchInsert
. #1182knex.raw
.query-error
event. #1163batchInsert
. #1182acquireConnectionTimeout
default 60 seconds preventing #1040 from happening. #1177.raw
queries in debug output. #1169cli
to use basic configuration without specific environment set. #1101FAQs
A batteries-included SQL query & schema builder for Postgres, MySQL and SQLite3 and the Browser
We found that knex-redshift demonstrated a not healthy version release cadence and project activity because the last version was released 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.