Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

knex

Package Overview
Dependencies
Maintainers
1
Versions
252
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

knex - npm Package Compare versions

Comparing version 0.5.5 to 0.5.6

4

knex.js

@@ -1,2 +0,2 @@

// Knex.js 0.5.5
// Knex.js 0.5.6
// --------------

@@ -91,3 +91,3 @@

// Keep in sync with package.json
knex.VERSION = '0.5.5';
knex.VERSION = '0.5.6';

@@ -94,0 +94,0 @@ // Runs a new transaction, taking a container and returning a promise

@@ -375,2 +375,7 @@ // Builder

// Retrieve the avg of the values of a given column.
avg: function(column) {
return this._aggregate('avg', column);
},
// Increments a column's value by the specified amount.

@@ -514,6 +519,16 @@ increment: function(column, amount) {

push.apply(this.bindings, query.bindings);
}
},
// Helper to pull a single column from each result and return array
pluck: function (column) {
if (!column) {
throw new Error('You must specify a column to pluck.');
}
return this.column(column).then(function (results) {
return _.pluck(results, column);
});
},
});
exports.Builder = Builder;
{
"name": "knex",
"version": "0.5.5",
"version": "0.5.6",
"description": "A query builder for Postgres, MySQL and SQLite3, designed to be flexible, portable, and fun to use.",

@@ -29,3 +29,3 @@ "main": "knex.js",

"mkdirp": "~0.3.5",
"bluebird": "~0.11.5-0",
"bluebird": "~1.0.0",
"colors": "~0.6.2",

@@ -32,0 +32,0 @@ "lodash": ">=2.4.0"

@@ -11,2 +11,8 @@ module.exports = function(knex) {

it('has an avg', function() {
return knex('accounts').logMe().avg('logins');
});
it('has a count', function() {

@@ -13,0 +19,0 @@

@@ -25,2 +25,25 @@ module.exports = {

},
'has an avg': {
mysql: {
bindings: [],
sql: 'select avg(`logins`) from `accounts`',
result: [{
'avg(`logins`)': 1.6667
}]
},
postgresql: {
bindings: [],
sql: 'select avg("logins") from "accounts"',
result: [{
avg: '1.6666666666666667'
}]
},
sqlite3: {
bindings: [],
sql: 'select avg("logins") from "accounts"',
result: [{
'avg("logins")': 1.6666666666666667
}]
}
},
'has a count': {

@@ -27,0 +50,0 @@ mysql: {

@@ -435,2 +435,8 @@ var _ = require('lodash');

describe('pluck', function() {
it('should pluck a defined key from the result set');
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc