diff --git a/docs/interfaces/config.html b/docs/interfaces/config.html index 4f71674..3d02adb 100644 --- a/docs/interfaces/config.html +++ b/docs/interfaces/config.html @@ -204,7 +204,7 @@

Optional createIndex
createIndexFile: boolean
diff --git a/package.json b/package.json index 929b64f..dd92e6e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sql-ts-knex-generator", - "version": "1.7.3", + "version": "1.8.0-beta01", "main": "./dist/index.js", "description": "A simple command line tool to generate typescript CRUD operations from database schemas.", "bin": "./bin/sql-ts-knex-generator", diff --git a/templates/interfaces-and-functions.handlebars b/templates/interfaces-and-functions.handlebars index 6ad6281..c8a4edf 100644 --- a/templates/interfaces-and-functions.handlebars +++ b/templates/interfaces-and-functions.handlebars @@ -137,6 +137,17 @@ export async function update{{name}} ({client, data, where, whereRaw}: UpdateFnI return query.update(data); } {{/inline}} +{{#*inline "funcBatchInsertPartial"}} +interface BatchInsertFnInput { + client: Knex; + data: {{interfaceName}}Input; +} +export async function batchInsert{{name}} ({client, data}: BatchInsertFnInput) { + const query = client<{{interfaceName}}>("{{name}}"); + + return query.batchInsert({{table.name}}, data); +} +{{/inline}} /* eslint-disable @typescript-eslint/camelcase */ /* eslint-disable @typescript-eslint/class-name-casing */ /*