30 Commits

Author SHA1 Message Date
Igor Savin
e37aeaa31c
Prepare for 0.21.0 release (#3811) 2020-04-19 00:40:23 +02:00
Igor Savin
4feefdf3d2 Enforce Unix (lf) line terminators (#3598) 2019-12-29 20:28:40 +01:00
Lorefnon
79ccb7d8bd Lift up dialect specific methods in the CreateTableBuilder (#3532) 2019-11-21 15:22:29 +01:00
Igor Savin
988fb24389
Fix MSSQL escaping (#3382) 2019-10-06 20:21:32 +02:00
Ricardo Graça
9aa7085b05 Rename src directory to lib (#3338) 2019-07-10 23:48:43 +02:00
Igor Savin
e971c5198b
Update dependencies, fix new eslint errors (#3339) 2019-07-10 20:47:56 +02:00
Igor Savin
c431ffc35a
Drop support for Node.js 6. Remove babel. (#3227) 2019-06-04 00:37:17 +02:00
Henry Williams
2611e5a300 Fix linter errors in tests (#2859)
* fix lint errors for tests
2018-10-15 22:29:53 -04:00
Igor Savin
89d2b3a5e1 #2758: Implement fail-fast logic for dialect resolution (#2776)
* Implement fail-fast logic for dialect resolution, clean-up code around.

* Remove method that was deprecated long time ago

* Address additional comments

* Try addressing comments

* Set client explicitly

* Fix compatibility with older Node versions
2018-08-29 18:13:16 +03:00
Caíque de Castro Soares da Silva
337455f63a Allow timestamp with timezone on mssql databases (#2724)
* Allow timestamp with timezone on mssql databases

* Change timestamp parameter to use object instead of boolean
2018-08-23 13:10:19 +03:00
Will Morgan
fac313f27f Use Datetime2 for MSSQL datetime + timestamp types (#2757)
* Use Datetime2 for MSSQL datetime + timestamp types

Datetime2 is now the recommended column type for new date work: https://docs.microsoft.com/en-us/sql/t-sql/data-types/datetime-transact-sql?view=sql-server-2017

* Add tests for MSSQL datetime2 changes
2018-08-13 15:33:37 -05:00
Fabian Kantereit
e08c14b7b1 Implement missing schema support for mssql dialect 2018-07-10 12:55:12 -04:00
Tim Griesser
232fe9f151
Add Prettier (#2697)
* Add prettier
* Run files through prettier
2018-07-09 08:10:34 -04:00
Igor Savin
3282d6a890 chore: Update dependencies. Remove estraverse (#2691)
* Update dependencies. Remove estraverse

* Fix compatibility with new Sinon

* Increase mssql timeout
2018-07-07 10:47:51 +03:00
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
Joel Mukuthu
bf1fa63118 Add queryContext to schema and query builders (#2314)
* feat(query-builder): add hookContext for wrapIdentifier

* refactor: use isUndefined

* test(transaction): test passing of hookContext

* feat(runnner): pass context to postProcessResponse

* test(runner): test postProcessResponse for raw responses

* test(raw): test passing of hookContext

* feat: add hookContext to Raw and SchemaBuilder

* test(transaction): fix test for hookContext

* chore: fix lint error

* fix: check for hookContext before calling it

* test(transaction): fix hookContext test

* chore: remove whitespace

* test(hookContext): test cloning of context object

* refactor: hookContext -> queryContext

* minor: use more descriptive variable name

i.e. refactor: `context` => `queryContext`

* fix: remove unnecessary checks for query builder

* fix(Raw): pass query builder to formatter

* fix(SchemaCompiler): pass schema builder to formatter

* refactor: add addQueryContext helper

* feat: add queryContext to TableBuilder and ColumnBuilder

* fix(TableCompiler): pass table builder to formatter

* fix(ColumnCompiler): pass column builder to formatter

* fix(pushQuery): fix passing builder to formatter

* test(Schema|Table|ColumnCompiler): test passing queryContext

* fix(SchemaCompiler): pass queryContext to TableCompiler

* fix(TableCompiler): pass queryContext to ColumnCompiler

* test: add queryContext tests for all schema dialects

* test(TableCompiler): test overwriting queryContext from SchemaCompiler

* test(Raw): test passing queryContext to wrapIdentifier

* tests: run all the tests
2018-02-02 00:41:01 +02:00
Ivo Meißner
fbf371f4e9 Added decimal variable precision / scale support (#2353)
* Added postgres decimal variable precision / scale support

* Decimal column no precision support all dialects + tests
2017-11-30 23:05:39 +02:00
Richard Ižip
74f2a031f3 Throw error on non-string table comment (#2126)
* Throw error on non-string table comment

* add unit tests for all dialects
* removed non-valid comments retyping to ''

* Change dockerode version

* reverted dockerode version locking
2017-11-01 00:22:07 +02:00
vellotis
fe4ec15ae0 Support custom foreign key names (continued work of #1311) (#1726)
* Added support for custom foreign key name

* Update unit test for #1311

* Fix TableCompiler::foreign to respect previous behavior + typo

* Add dialect specific unit tests

* Fixed comment

Actually trying to trigger travis to run tests with latest travis configuration... (maybe it just doesn't run tests against merged branch..)
2017-02-17 00:35:43 +02:00
Mikael Lepistö
77e67334a3 Alter column syntax for table, implements changing type, nullability and default (#1914)
* Added support for altering columns

* Add mysql dialect key for alter (modify)

* Added tests for .alter()

* Updated dialects for .alter() on column

* .alter() for mssql and tests

* Added an error for sqlite3 alter column

Sqlite does not support alter column at all

* Implemented schema alter column support for postgresql

* Added unit test for alter column and fixed postgres implementation

* Add test case for adding multiple columns at once (oracle check)

* Try upgrading CI mysql / postgres and distro

* Disabled adding multiple columns test from oracle

* Fixed node 0.12 test compatibility

* Fixed review comments
2017-02-16 20:34:59 +02:00
statyan
6ecd8f3793 Fixed knex #1577 (#1578)
* Fixed knex #1577
Aslo corrected tests for primarykey

* Fix for installing from github

* Fix for installing from github

* Fix for installing from github
2016-07-20 11:22:17 +10:00
statyan
4f28c992be Fixed knex #1463 issue
Fixed knex #1422 issue
2016-06-01 16:27:29 +03:00
wubzz
4ba581b362 Fix some unit tests 2016-05-19 21:36:30 +02:00
wubzz
5a6ab64d06 Ensure .primary() and .dropPrimary() are the same across all dialects. 2016-05-19 21:30:17 +02:00
Nick Whiteley
4161dab19e #1348 MSSQL adding and dropping multiple columns fix 2016-05-12 10:24:29 +01:00
Max Claus Nunes
8d6264e96b wrap index names 2016-03-16 21:52:51 -03:00
Sky Morey
f99d3952a1 changed mssql to compact create format. changed unique index to unique constraint 2015-12-14 16:20:45 -06:00
Sky Morey
371815d7e6 made SCHEMA upper case for mssql 2015-12-14 09:56:53 -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