23 Commits

Author SHA1 Message Date
Mikael Lepistö
b349ac4a8c
Various fixes to mssql dialect (#2653)
* Fixed float type of mssql to be float

* Many tests where postgres test was not actually ran at all

* Migrations to be mssql compatible

Mssql driver doesn't handle if multiple queries are sent to same transaction concurrently.

* Prevented mssql failing when invalid schema builder was executed by accident

Instead of trying to generate sql from broken schema calls, just make exception to leak before query compiling is started

* Fixed mssql trx rollback to always throw an error

Also modified some connection test query to be mssql compatible

* Fixed various bugs from MSSQL driver to make tests run

* Fixed mssql unique index to be compatible with other dialect implementations

* Enable running mssql tests on CI

* Test for #2588

* Updated tests to not be dependend on tables left from previous test rans

* Trying to make mssql server work on travis
2018-06-29 10:47:06 +03:00
Igor Savin
09eb12638c Update dependencies and fix ESLint warnings accordingly (#2433)
* Update dependencies. Tweak ESLint rules to work more like they used to before

* Fix indentation

* Remove unnecessary escapes.

* Remove unused 'usingClause' parameter.

* Address CI failures.

* Revert "Remove unused 'usingClause' parameter."

This reverts commit aaa4d71e914faa1c4c1313c26bbdd26067b0b448.

* eslint: add ignore with todo

* dependencies: update
2018-02-01 23:46:12 +02:00
Sami Koskimäki
45f5ffbad0 Use wrapIdentifier in columnInfo. fixes #2402 (#2405)
* Make postgres client wrapIdentifierImpl independent of `this` context

 * Also fixes a bug where only single digit indices were accepted.

* add customWrapIdentifier helper for client

 * customWrapIdentifier is one more level of abstraction for the wrapIdentifier "pipeline"
   that allows the custom wrapIdentifier to be called without calling the `wrapIdentifierImpl`

* bufix: use custom wrapIdentifier in columnInfo. fixes #2402
2018-01-03 00:05:48 +02:00
tankers746
3f8970117e Shifted returning before joins for updates (MSSQL) (#2399)
When using OUTPUT with a join in MSSQL the OUTPUT needs to come before
the joins.

https://stackoverflow.com/questions/4170389/inner-join-within-update-output-in-one-t-sql-query
2018-01-01 11:42:18 -06:00
Mike
b092a271fa Allow raw expressions in query builder aggregate methods (#2257)
The aggregate methods include `count`, `min`, `max`, `sum`, `avg`,
`countDistinct`, `sumDistinct`, and `avgDistinct`, all of which
can now receive raw expressions, e.g.

```js
knex('users').count(knex.raw("data->'active'"));
```

There seems to be some demand for this, and I think it's cleaner than the alternative of

```js
knex('users').select(knex.raw("count(data->'active')"));
```
2017-10-14 18:19:06 +03:00
dirkmc
67951700ca Fix mssql binding ordering for queries that combine a limit with select raw or update (#2066)
* Fix binding ordering for queries that combine a limit with a select raw or update

* Use old school quotes so tests pass
2017-05-16 13:51:24 +03:00
Ruben Slabbert
0ae4f3ef95 Mssql update query generates invalid syntax (#1777)
* Updated mssql update compiler with correct syntax

* Updated failing mssql test

* Updated failing tests to add from

* Third times the charm tests
2016-12-06 20:04:30 +11:00
statyan
99ac60af37 Fix incorrect MSSQL query building with lock used, with clause and Number with decimal part conversion (#1707)
* Fixed knex #1577
Aslo corrected tests for primarykey

* Fix for installing from github

* Fix for installing from github

* Fix for installing from github

* Move LOCK hint for MSSQL after join component of select

* Add missing import statement

* Added "WITH" clause to select, update, insert and delete queries.
Fixed forUpdate lock query building
Add detection of decimal value of Numeric parameter and set proper sql.Type for it. (Fix for #1604)

* Change let to const for variable declaration

* Fix MSSQL non-numeric parameters binding
2016-11-25 18:54:48 -06:00
Alexandre Tiertant
69235aed73 add With Clause (#1599)
* Add "with" clause

* Add arguments check to with() and modify some tests

* fix test
2016-09-13 13:14:04 +03:00
Nick Whiteley
f969d5236a MSSQL columnInfo() had hard coded schema name (#1585)
* MSSQL columnInfo() had hard coded schema name

* Change let to const for columnInfo bindings array
2016-07-26 10:00:57 +02:00
statyan
a7802ff8f3 Fixed knex #1463 issue 2016-06-01 02:40:58 +03:00
Rhys van der Waerden
2acd6e5daa Make spaces in import braces consistent
`import {module}` -> `import { module }`
2016-05-18 20:22:50 +10:00
Rhys van der Waerden
06e3447440 Remove duplicate spaces in assignments.
These were previously horizontally aligned. The esnext conversion disrupted them all.
2016-05-18 19:59:24 +10:00
Rhys van der Waerden
3846b7182c Make codebase conform to ESLint rules
Just a couple of changes.
2016-05-17 01:01:34 +10:00
Mikael Lepistö
9114bdd8b3 Changed implementation of replacing undefined with DEFAULT already in query compiler for every dialect. 2016-05-12 10:24:42 +03:00
wubzz
f37824a11e Fix indentation? 2016-03-15 18:12:36 +01:00
wubzz
1d27fb8550 Update lodash from 3.7.0 -> 4.6.0 2016-03-15 18:11:13 +01:00
Jurko Gospodnetić
16a076c1a0 trim trailing spaces
Only left alone ones in `test/tape/transactions.js` which would just
cause unnecessary conflicts and get cleaned up by separate pull
request #1257 anyway.
2016-03-08 08:44:01 +01:00
Jurko Gospodnetić
897f31c6e5 fix incase --> in case comment typos 2016-03-07 16:10:38 +01:00
Sky Morey
eed0004031 mssql: added top (?) back to fix that error. also removed loading of empty file 2015-12-15 16:48:19 -06:00
Sky Morey
ae256f2943 mssql limit and offset for sql2012 2015-12-15 14:56:56 -06:00
Sky Morey
afd6b66624 Final build of mssql provider, all tests pass 2015-12-09 17:53:53 -06:00
Sky Morey
7c1120e0e2 in progress 2015-12-08 11:37:31 -06:00