Commit Graph

44 Commits

Author SHA1 Message Date
Travis Hill
19cc1c2dda Fixed formatting 2016-07-05 09:42:23 -04:00
Travis Hill
18396bd284 Added missing methods to JoinClause object 2016-07-05 09:40:51 -04:00
Travis Hill
696537ab6e Knex - Added more definitions
Added additional overloads for the Join interface and extra description for the callback function, including a description of the parameter passed to it, which is an instance of JoinClause. Therefore, also added the JoinClause interface description. Finally, added two new method overloads for Where.
2016-06-22 15:39:10 -04:00
Travis Hill
d1b270f02a Added missing WHERE methods
Added missing WHERE methods and one missing HAVING method (`andHaving`). Reordered some WHERE methods to be more consistent.
2016-06-21 14:48:16 -04:00
Mohamed Hegazy
2f4ad65f54 Merge pull request #9698 from slathrop/master
Add public Knex APIs: TableBuilder.bigIncrements, SchemaBuilder.createTableIfNotExists, QueryBuilder.on()
2016-06-20 13:28:08 -07:00
Alexander Sychev
7ad54fcef1 Missed an existing knex schema method (#9689)
See: http://knexjs.org/#Schema-createTableIfNotExists
2016-06-19 12:22:37 +09:00
Scott Bessler
9dba999267 [knex] allow object for .raw parameters (see http://knexjs.org/#Raw-Bindings) (#9674) 2016-06-19 11:37:05 +09:00
SLathrop
229eb44eaf Add public Knex API QueryBuilder.on() event hook 2016-06-18 17:25:18 -04:00
SLathrop
74ae4799a8 Add public Knex API SchemaBuilder.createTableIfNotExists 2016-06-17 13:55:30 -04:00
SLathrop
29a02fd8d4 Add public Knex API TableBuilder.bigIncrements 2016-06-17 10:46:58 -04:00
Adam Charron
51ffec4ea3 Fix method .returning() and check if Promise exists before polyfilling it. (#9590)
* Check if Promise exists and fix returning

* Remove the bluebird check
2016-06-13 23:41:14 +09:00
thynson
512ffae8cc Support Array as Value type (#9382) 2016-05-26 22:38:10 +09:00
Tanguy Krotoff
bb5d8ea26c Improve bookshelf.d.ts and tests (#9297)
* Switch to ES6 imports

* Add attributes and length

* Various improvements + add more tests

- Fix destroy()
- Fix detach()
- Fix map()
- Add NotFoundError, NoRowsUpdatedError and NoRowsDeletedError on Model

* serialize() and toJSON() should return Object/Object[] instead of any

* Fix map()

* More tests taken from Bookshelf website + various fixes

- Fix Bookshelf.transaction return type
- Add id attribute on ModelBase
- Improve ModelBase.parse()
- Fix Model.query()
- Add a constructor to CollectionBase
- Fix CollectionBase.map()
- Fix Collection.attach()
- Fix Collection.query()
- Add Collection.EmptyError
- Fix LoadOptions and FetchOptions withRelated

* No need to specify Knex.QueryBuilder

* toJSON(): Object/Object[] is too restrictive, revert back to any/any[]

* Model.through() returns R, Collection.through() returns Collection<R>
2016-05-15 02:43:57 +09:00
Emanuel Henrique do Prado
bc5a137b59 Added type definition for Knex.Migration (#9227)
* Added type definition for Knex.Migration

Signed-off-by: Emanuel Henrique do Prado <emanuel@tls.inf.br>

* Corrected Knex test according documentation (http://knexjs.org/#Migrations-currentVersion)

* Change name Migration to Migrator, according the original source
2016-05-10 00:35:20 +09:00
AmirSaber Sharifi
3a0f632200 fix bluebird refrence and add dropForeign function (#9105) 2016-05-02 00:44:30 +09:00
Ryan Smith
84ae09b624 Attempts to fix remaining errors.
```
knex/knex-tests.ts(502,9): error TS2345: Argument of type '(names: string) => void' is not assignable to parameter of type '(value: string[]) => void | PromiseLike<void>'.
  Types of parameters 'names' and 'value' are incompatible.
    Type 'string' is not assignable to type 'string[]'.
knex/knex-tests.ts(522,4): error TS2339: Property 'bind' does not exist on type 'QueryBuilder'.
knex/knex-tests.ts(533,35): error TS2339: Property 'return' does not exist on type 'QueryBuilder'.
```

https://travis-ci.org/DefinitelyTyped/DefinitelyTyped/builds/119593429
2016-03-30 18:29:30 +01:00
Ryan Smith
ff6d2d2b90 Attempts to fix new errors.
```
knex/knex-tests.ts(500,16): error TS2339: Property 'name' does not exist on type 'string'.
knex/knex-tests.ts(502,9): error TS2345: Argument of type '(names: string) => void' is not assignable to parameter of type '(value: any[]) => void | PromiseLike<void>'.
  Types of parameters 'names' and 'value' are incompatible.
    Type 'string' is not assignable to type 'any[]'.
```

https://travis-ci.org/DefinitelyTyped/DefinitelyTyped/builds/119592117
2016-03-30 18:22:39 +01:00
Ryan Smith
905ee7e6f5 Attempts to fix more TS2339 errors.
```
knex/knex-tests.ts(498,45): error TS2339: Property 'map' does not exist on type 'QueryBuilder'.
knex/knex-tests.ts(506,45): error TS2339: Property 'reduce' does not exist on type 'QueryBuilder'.
```

https://travis-ci.org/DefinitelyTyped/DefinitelyTyped/builds/119590526
2016-03-30 18:18:16 +01:00
Ryan Smith
7fb76f6e39 Fixes most TS2339 and all TS7006 errors. 2016-03-30 18:11:16 +01:00
Ryan Smith
18fad79175 Fixes for ES6. 2016-03-30 15:05:16 +01:00
Alexander Hense
bae73a583a Make connection optional for knex Config
It is possible to use knex as a pure query builder without any database
connection. This is specified in the knex documentation.
2016-03-21 16:09:06 +01:00
vvakame
56295f5058 replace https://github.com/borisyankov/DefinitelyTyped to https://github.com/DefinitelyTyped/DefinitelyTyped 2016-03-17 00:55:26 +09:00
Lucas Lacroix
a6f733fb40 Add definitions for table.foreign 2016-03-08 11:09:03 -05:00
Jon Sheppard
2085793a2c Update knex.d.ts MariaConnectionConfig to support all properties defined for mariasql driver 2016-02-20 19:42:26 +11:00
Jon Sheppard
51e1f71209 Add a configuration config object that supports mariasql client syntax 2016-02-17 23:00:21 +11:00
DomiR
808a31e15f (feature) Fist step to upgrade lodash to 4.0.0 2016-01-23 14:39:10 +01:00
Tanguy Krotoff
0d7e1be8b4 Remove trailing spaces
Trailing spaces make it hard to contribute
2015-12-13 18:58:34 +01:00
Tanguy Krotoff
39c9c5637d Should be knex-tests.ts instead of knex-test.ts 2015-10-23 20:27:56 +02:00
Jonny Stoten
2222f9504b Fix tests! 2015-10-19 21:02:09 +01:00
Jonny Stoten
0fe43e1a83 Add test code for additions 2015-10-19 20:49:57 +01:00
Jonny Stoten
a3633084f4 Add some extras to knex that we've needed 2015-10-19 18:01:55 +01:00
Ben Nelson
f7e4e53b48 Knex: fix arguments for TableBuilder.enu/enum 2015-09-25 04:22:09 -04:00
yortus
1bdaa7d80f spacing (no code changes)
Added this commit purely to trigger first CI build as per contribution guidelines.
2015-08-10 19:02:16 +08:00
yortus
bd876d257d fix indentation only (NO other changes) 2015-08-10 18:46:53 +08:00
yortus
ac75761608 export all interfaces by wrapping them in exported Knex namespace 2015-08-10 18:44:38 +08:00
yortus
3ece183e16 remove KnexStatic, which is no longer used 2015-08-10 18:37:41 +08:00
Tanguy Krotoff
0c3aca7cf5 Improve returning type for insert, update and delete 2015-07-02 18:47:57 +02:00
Norbert Wagner
878c6889f4 Knex: Added primary(), index() and unique() for TableBuilder 2015-06-10 17:48:10 +02:00
Norbert Wagner
efaab812e1 Changed export to make Knex interface available without
creating an instance. Allows to define migrations in Typescript
2015-06-09 17:21:31 +02:00
yortus
ebae8dab21 knex.d.ts: All SchemaBulder functions promises 2015-03-30 14:15:55 +08:00
kubo_takaichi
16b8577157 Modify migration samples 2015-03-27 23:57:27 +09:00
kubo_takaichi
837b520227 Add definitions 2015-03-27 23:53:26 +09:00
kubo_takaichi
11d3d8db09 Add sample code 2015-03-27 23:53:26 +09:00
kubo-takaichi
070ce8218c Create files 2015-03-27 23:53:26 +09:00