Skip to content

Commit

Permalink
Merge branch 'master' into gh-pages
Browse files Browse the repository at this point in the history
* master:
  release 0.11.10
  Prep for release
  Add CHANGELOG.md (#1615)
  Added padding to avoid header sticking to the example usage.
  Updated docs to note schema builder is getter.
  Remove unused files
  Uint8Array data (e.g. Postgres "bytea" type) erroneously considered "undefined" by recent 0.11.7 update. (#1601)
  Revert "[docs] document multi-column order-by"
  [docs] document multi-column order-by
  MSSQL columnInfo() had hard coded schema name (#1585)
  • Loading branch information
tgriesser committed Aug 9, 2016
2 parents 8bd071a + eda7151 commit 17a2f7e
Show file tree
Hide file tree
Showing 12 changed files with 1,016 additions and 449 deletions.
580 changes: 580 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions LICENSE
@@ -1,4 +1,4 @@
Copyright (c) 2013-2014 Tim Griesser
Copyright (c) 2013-present Tim Griesser

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Expand All @@ -19,4 +19,4 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
OTHER DEALINGS IN THE SOFTWARE.
818 changes: 406 additions & 412 deletions build/knex.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/assets/style.css
Expand Up @@ -81,6 +81,7 @@ h1, h2, h3, h4, h5, h6 {
font-size: 20px;
}
b.header {
margin-right: 5px;
font-size: 16px;
line-height: 30px;
}
Expand Down
8 changes: 4 additions & 4 deletions index.html
Expand Up @@ -32,7 +32,7 @@
<div id="sidebar" class="interface">

<a class="toc_title" href="#changelog">
Knex.js <span class="version">(0.11.9)</span>
Knex.js <span class="version">(0.11.10)</span>
</a>
<ul class="toc_section">
<li>&raquo; <a href="https://github.com/tgriesser/knex">GitHub Repository</a></li>
Expand Down Expand Up @@ -337,7 +337,7 @@
</p>


<h2>Latest Release: 0.11.8 - <span class="small"><a href="#changelog">Change Log</a></span></h2>
<h2>Latest Release: 0.11.10 - <span class="small"><a href="#changelog">Change Log</a></span></h2>

<p>
Current Develop &mdash;
Expand Down Expand Up @@ -1776,7 +1776,7 @@ <h2 id="Transactions">Transactions</h2>
</p>

<h2 id="Schema">Schema Builder</h2>
These methods return <a href="http://knexjs.org/#Interfaces-Promises">promises</a>.
The <tt>knex.schema</tt> is <b>a getter function</b>, which returns a stateful object containing the query. Therefore, be sure to obtain a new instance of <tt>knex.schema</tt> for every new query. The methods below return <a href="http://knexjs.org/#Interfaces-Promises">promises</a>.

<p id="Schema-withSchema">
<b class="header">withSchema</b><code>knex.schema.withSchema([schemaName])</code>
Expand Down Expand Up @@ -3109,7 +3109,7 @@ <h2 id="faq">F.A.Q.</h2>

<p>
<b class="header">My tests are failing because slow DB connection and short test timeouts! How to extend test timeouts?</b><br />
Sometimes, e.g. when running CI on travis, test suite's default timeout of 5 seconds might be too short. In such cases an alternative test timeout
Sometimes, e.g. when running CI on travis, test suite's default timeout of 5 seconds might be too short. In such cases an alternative test timeout
value in milliseconds can be specified using the <tt>KNEX_TEST_TIMEOUT</tt> environment variable.
</p>
<pre>
Expand Down
2 changes: 1 addition & 1 deletion knex.js
@@ -1,6 +1,6 @@
// Knex.js
// --------------
// (c) 2014 Tim Griesser
// (c) 2013-present Tim Griesser
// Knex may be freely distributed under the MIT license.
// For details and documentation:
// http://knexjs.org
Expand Down
6 changes: 4 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "knex",
"version": "0.11.9",
"version": "0.11.10",
"description": "A batteries-included SQL query & schema builder for Postgres, MySQL and SQLite3 and the Browser",
"main": "knex.js",
"dependencies": {
Expand Down Expand Up @@ -99,12 +99,14 @@
"oracledb": false
},
"files": [
"CONTRIBUTING.md",
"README.md",
"src/*",
"lib/*",
"build/*",
"knex.js",
"LICENSE"
"LICENSE",
"CHANGELOG.md"
],
"license": "MIT"
}
21 changes: 0 additions & 21 deletions src/connection/index.js

This file was deleted.

14 changes: 11 additions & 3 deletions src/dialects/mssql/query/compiler.js
Expand Up @@ -158,11 +158,19 @@ assign(QueryCompiler_MSSQL.prototype, {
// Compiles a `columnInfo` query.
columnInfo() {
const column = this.single.columnInfo;
const sql =
`select * from information_schema.columns where table_name = ? and table_schema = 'dbo'`;
let sql =`select * from information_schema.columns where table_name = ? and table_catalog = ?`;
const bindings = [this.single.table, this.client.database()];

if (this.single.schema) {
sql += ' and table_schema = ?';
bindings.push(this.single.schema);
} else {
sql += ` and table_schema = 'dbo'`;
}

return {
sql,
bindings: [this.single.table],
bindings: bindings,
output(resp) {
const out = resp.reduce(function(columns, val) {
columns[val.COLUMN_NAME] = {
Expand Down
5 changes: 4 additions & 1 deletion src/helpers.js
@@ -1,6 +1,6 @@
/* eslint no-console:0 */

import { map, pick, keys, isFunction, isUndefined, isObject, isArray } from 'lodash'
import { map, pick, keys, isFunction, isUndefined, isObject, isArray, isTypedArray } from 'lodash'
import chalk from 'chalk';

// Pick off the attributes from only the current layer of the object.
Expand Down Expand Up @@ -47,6 +47,9 @@ export function exit(msg) {
export function containsUndefined(mixed) {
let argContainsUndefined = false;

if (isTypedArray(mixed))
return false;

if(mixed && isFunction(mixed.toSQL)) {
//Any QueryBuilder or Raw will automatically be validated during compile.
return argContainsUndefined;
Expand Down
Empty file removed src/statement.js
Empty file.
6 changes: 3 additions & 3 deletions test/integration/builder/additional.js
Expand Up @@ -121,8 +121,8 @@ module.exports = function(knex) {
}
);
tester('mssql',
'select * from information_schema.columns where table_name = ? and table_schema = \'dbo\'',
['datatype_test'], {
'select * from information_schema.columns where table_name = ? and table_catalog = ? and table_schema = \'dbo\'',
['datatype_test', 'knex_test'], {
"enum_value": {
"defaultValue": null,
"maxLength": 100,
Expand Down Expand Up @@ -173,7 +173,7 @@ module.exports = function(knex) {
}
);
tester('mssql',
'select * from information_schema.columns where table_name = ? and table_schema = \'dbo\'',
'select * from information_schema.columns where table_name = ? and table_catalog = ? and table_schema = \'dbo\'',
null, {
"defaultValue": null,
"maxLength": null,
Expand Down

0 comments on commit 17a2f7e

Please sign in to comment.