2646 Commits

Author SHA1 Message Date
Igor Savin
8dc0a716f9
Fix CWD parameter support for CLI (#2935)
* Fix cwd support for knex-cli. Add test

* Remove redundant code

* Remove commented out code
2018-12-03 23:14:34 +01:00
Mikael Lepistö
fdd68f68f1 Updated changelog and package version for release 0.16.0 2018-11-27 11:22:40 +02:00
moonchang, Jang
8173e3fbfd Add queryContext to type declarations (#2931) 2018-11-26 14:37:38 +01:00
Igor Savin
0115f933ca
Align signature for PG datetime and timestamp methods with docs (#2919)
* Align signature for PG datetime and timestamp methods with documentation. Add precision support

* Remove redundant method

* Add upgrade note for the change

* Changes after code review

* Improve API
2018-11-26 10:22:27 +01:00
Kévin Berthommier
c92339ff85 remove useless 'use strict' (#2927)
* remove useless 'use strict'

'use strict' and import/export are not meant to be together.

* Update ref.js
2018-11-23 15:59:53 +01:00
Randy Garces
ab35e97614 GH-2915 Oracledb tests are failing (#2924)
* GH-2915 Oracledb tests are failing

- fixes oracledb failing tests

* Fixes oracledb increment() and decrement() empty query

- Error: The query is empty

* Add ToDo for fixing Oracle bug
2018-11-23 12:58:23 +01:00
Igor Savin
33bb7710b8 Bump versions and update changelog (#2926) 2018-11-23 13:08:35 +02:00
Daniel Hensby
b56ff04e61 Support patched MSSQL lib (#2861)
* PATCH Support patched MSSQL lib

* Add code coverage ignores to mssql monkey-patching

* Fix compatibility description
2018-11-23 11:48:33 +01:00
Igor Savin
461868b614
Fix knexfile resolution. Add missing test (#2923)
* Fix knexfile resolution. Add missing test

* Try fixing Jake test execution

* Avoid having non-test files in jake folder

* Fix test compatibility with Node 6

* Fix the fix
2018-11-22 10:19:06 +01:00
Igor Savin
7a6e817eef Update changelog and version number (#2918) 2018-11-21 10:21:04 +02:00
Igor Savin
3d636b3215 Fix execution of Oracle tests on Node 11 (#2920) 2018-11-21 10:18:41 +02:00
Igor Savin
1eac063b28
Do not postprocess internal queries in Migrator (#2914)
* Do not postprocess internal queries in Migrator

* Fixes

* Fix var -> const autofix

* Fix regression
2018-11-19 12:55:50 +01:00
EthanHur
723346f7c5 fix client typo in test script (#2912) 2018-11-16 14:36:33 +01:00
Igor Savin
a61cf2a7a0
Fix markdown for reference to upgrade instructions (#2911) 2018-11-16 13:46:17 +01:00
Igor Savin
b341a5bc42
Version upgrade guide (#2894)
* Version upgrade guide

* Use more consistent style

* Slightly improve wording

* Add reference to upgrading instructions
2018-11-16 13:44:02 +01:00
Igor Savin
887fb53929
CLI cleanup. Do not require client for creating seeds or migrations (#2905)
* Specify jakefile explicitly to ensure it being run. Do not require client when creating seeds or migrations. cli.js cleanup. Formatting

* Fix message

* Fix typo

* Ignore console rule in CLI tests

* Fix rimraf import

* Improvements after code review

* One more arrow function
2018-11-16 13:23:22 +01:00
Neil Gentleman
833829aff1 Fix failed migration filename (#2910)
* Fix migration test assertions

* Report failing migration instead of latest migration

Migrator._activeMigration needs to be set twice: once when loading the
migration, and again when running it.
2018-11-16 01:23:13 +01:00
Igor Savin
a589520800
Update dependencies (#2904) 2018-11-13 22:49:26 +01:00
Douglas Nassif Roma Junior
931c157a2e Added option to pass indexType for MySQL dialect (#2890)
* Added option to pass indexType for MySQL dialect.

* Added test for: test adding index with type

* Removing extra space when no type is provided.
2018-11-10 16:36:10 +01:00
Igor Savin
c3fb954af1
Execute tests on Node.js 11 (#2873)
* Execute tests on Node.js 11

* Update dependencies

* Lock mssql version to the supported one
2018-11-10 16:34:11 +01:00
Eric Kennedy
1c0dc2c913 Add option of existingType to .enum method to support repeated use of enums (#2719)
* Update table column .enu to take an option that does not manually create the type

* Add tests for psql enum existingType

* Avoid utilizing enum values when using an existing type
2018-11-09 09:47:15 +01:00
Igor Savin
1bc24dfe4d
Add tests for specifying explicit pg version (#2895) 2018-11-07 12:57:25 +01:00
EthanHur
4db047df02 support multiple columns in .orderBy() (#2881)
* support multiple columns in `.orderBy()`

* add unit tests of order by

* orderByArray function to private

* use isString in string check
2018-11-06 22:30:06 +01:00
Igor Savin
76ec1d0f4f
Update dependencies (#2893) 2018-11-06 22:08:16 +01:00
Aurélio A. Heckert
bb5da4b200 Migrations with CLI and without knexfile (#2884)
* Migrations with CLI and without knexfile

Allows to create and run migrations.

closes #2819

* Apply tweaks to migrate without knexfile

Thanks to @kibertoad comments!
The bigger change was to remove the bash script to test knex's cli command, and replace it with a jake file. I believe this jake file may be used as a base for future cli tests.

* Replace `fs.promises` with `new Promise`
2018-11-06 11:03:18 +02:00
Casey Foster
c0838053bd Add withRecursive() (#2889)
* Add withRecursive()
2018-11-04 20:30:04 -05:00
Maddie Kreamer
c500d771ef spelling/grammar updated (#2877)
* spelling/grammar updated

* throw to thrown
2018-10-26 19:47:34 +02:00
Igor Savin
c00ddd5137 Cleanup based on analysis by https://lgtm.com (#2870)
* Cleanup based on analysis by https://lgtm.com

* Fix linting
2018-10-22 14:38:17 +03:00
Igor Savin
132b79ed16 Add link to wiki (#2866) 2018-10-19 17:24:50 +03:00
Igor Savin
8c269ca0d9
Add test for retrieving null dates (#2865)
* Add test for retrieving null dates

* Also test date and time columns

* Fix default value for TIMESTAMP type

* Make timestamp nullable
2018-10-19 16:21:39 +02:00
Henry Williams
2611e5a300 Fix linter errors in tests (#2859)
* fix lint errors for tests
2018-10-15 22:29:53 -04:00
sgoll
cdccb12b72 Adjust typing for forUpdate()/forShare() variant with table names (#2858) 2018-10-14 19:39:43 -04:00
Igor Savin
e527fae785 Update changelog (#2853)
* Update changelog

* Add missing reference and restore wrongly removed entry

* Minor tweaks

* Add missing changelog entry
2018-10-11 23:54:20 +03:00
Igor Savin
20deaa7ac1 Minor documentation fixes and updates (#2846)
* Minor documentation fixes and updates

* Few more spelling fixes
2018-10-11 19:32:05 +03:00
Igor Savin
ff8431998f Remove Node 7. Minor dependency bump (#2848)
* Pass migration config object as an argument to the migrations themselves, to allow custom parameters to be set for migrations. (#2014)

* Run prettier

* Remove unneeded change

* Remove more unneeded changes

* Fix Node 10 support

* Update documentation based on a new design

* Restore test execution (oops)

* Fix withUserParams method

* Fix knex instance cloning

* Remove unused import

* Fix reference to knex from migrator

* Do not lose user params on transactions

* Remove unneeded require

* Address review comments

* Fix setting event emitter and listeners on Knex copies. Use knex copies to run tests in CI

* Remove knex cloning

* Fix event listener leak

* Remove Node.js 7 from Travis configuration. Minor dependency updates
2018-10-11 19:17:29 +03:00
Igor Savin
96a8e3a4d8 Add support for named unique, primary and foreign keys to SQLite3 (#2840)
* Add support for named unique, primary and foreign keys to SQLite3

* Add integration testing for named keys

* Improve tests for primary and unique keys

* Improve tests for foreign keys

* Run prettier

* Fix tests

* Fix additional test
2018-10-11 19:14:26 +03:00
Tim Griesser
b2450a94dc
Manage types internally (#2845)
* Manage types internally
* Update CONTRIBUTING
2018-10-08 17:54:26 -04:00
Igor Savin
14261a2aa6 Update dependencies. Run husky-upgrade script (#2842) 2018-10-08 07:06:43 +02:00
Dale Anderson
46dbe917d7 Throw instead of process.exit when client module missing (#2843)
* Change process.exit to throw

* Add error message to wrapped error
2018-10-08 07:04:28 +02:00
Simon Lidén
66acbe7719 Allow chaining of increment, decrement, and update (#2740)
* Allow chaining of increment, decrement, and update
* Adds clearCounters
2018-10-06 10:10:56 -04:00
sgoll
1c782cf2c8 Allow table names with forUpdate/forShare (tgriesser/knex#2834) (#2835)
* Allow table names with forUpdate/forShare (tgriesser/knex#2834)

* Add integration test for partial table locks

* Simplify code of table name concatenation

* Add changelog entry
2018-10-04 09:39:24 -04:00
Daniel Cohen Gindi
6bf30a9586 Resolve unnecessary circular dependencies in code (#2716) (#2838)
* Removed Raw->Formatter->Raw circular dependency

This was cause due to the backwards compatibility feature for client-less raw()

* Removed circular dependency between helpers<->compilers

What they really need is a common interface, and perhaps a base class
2018-10-03 17:25:05 -04:00
Tim Griesser
cae8960622 Update Changelog 2018-10-03 17:18:53 -04:00
Tim Griesser
051bdc7e2a
whereColumn (#2837)
Adds: 
  - whereColumn
  - orWhereColumn
  - andWhereColumn
  - whereNotColumn
  - andWhereNotColumn
  - orWhereNotColumn
2018-10-03 11:26:19 -04:00
Bas van Schaik
d4a181994f Introduce LGTM.com badge (#2755)
Suggested by @Siilwyn: https://github.com/tgriesser/knex/issues/2731
2018-10-03 09:43:00 -04:00
Tim Griesser
ca00ddb9c5 Revert "onVal -> onColumn for #2746"
This reverts commit b83fc4db476d596d3fb136f187cd91cb7f1dbcfe.
2018-10-03 09:32:29 -04:00
Katharina Irrgang
c746deaf12 Added support for renameColumn and double slashes (#2833)
refs #2763
2018-10-02 23:02:37 -04:00
Tim Griesser
b83fc4db47 onVal -> onColumn for #2746 2018-10-02 22:49:12 -04:00
Simon Lidén
0b417e5371 Feature/join onVal andOnVal orOnVal (#2746)
* Added onVal, andOnVal, orOnVal to JoinClause
2018-10-02 22:44:46 -04:00
anggiaj
0bcdcec991 Typescript migration stub (#2816)
* add typings on typescript migration stub

* address feedback
2018-09-27 16:12:14 +03:00