mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-08 19:20:05 +00:00
node-crate: Add createIfNotExists; fix cut & paste error in project URL (#29747)
* Add createIfNotExists; fix cut & paste error in project URL * Add test
This commit is contained in:
committed by
Sheetal Nandi
parent
ad59680eed
commit
ed9ad1949f
6
types/node-crate/index.d.ts
vendored
6
types/node-crate/index.d.ts
vendored
@@ -1,5 +1,5 @@
|
||||
// Type definitions for node-crate 2.0
|
||||
// Project: https://github.com/arobson/rabbot
|
||||
// Project: https://github.com/megastef/node-crate
|
||||
// Definitions by: Greg Jednaszewski <https://github.com/gjednaszewski>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
@@ -30,6 +30,10 @@ declare namespace crate {
|
||||
* Creates a table with the given schema.
|
||||
*/
|
||||
create: (schema: object) => Promise<DBResultObject>;
|
||||
/**
|
||||
* Creates a table if it doesn't already exist.
|
||||
*/
|
||||
createIfNotExists: (schema: object) => Promise<DBResultObject>;
|
||||
/**
|
||||
* Drops a table.
|
||||
*/
|
||||
|
||||
@@ -10,6 +10,8 @@ crate.insert('users', {id: 'test', password: 'password'});
|
||||
|
||||
crate.create({users: {id: 'string primary key', password: 'string'}});
|
||||
|
||||
crate.createIfNotExists({users: {id: 'string primary key', password: 'string'}});
|
||||
|
||||
crate.drop('users');
|
||||
|
||||
crate.update('users', {password: 'newPassword'}, "id = 'test'");
|
||||
|
||||
Reference in New Issue
Block a user