diff --git a/types/node-crate/index.d.ts b/types/node-crate/index.d.ts index 8fa75581e0..971c71db24 100644 --- a/types/node-crate/index.d.ts +++ b/types/node-crate/index.d.ts @@ -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 // 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; + /** + * Creates a table if it doesn't already exist. + */ + createIfNotExists: (schema: object) => Promise; /** * Drops a table. */ diff --git a/types/node-crate/node-crate-tests.ts b/types/node-crate/node-crate-tests.ts index d98f8c2694..117fdcbcdf 100644 --- a/types/node-crate/node-crate-tests.ts +++ b/types/node-crate/node-crate-tests.ts @@ -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'");