diff --git a/lib/helpers/table-name.js b/lib/helpers/table-name.js index dbda3502..7ae977e0 100644 --- a/lib/helpers/table-name.js +++ b/lib/helpers/table-name.js @@ -153,8 +153,11 @@ npm.utils.addInspection(TableName, function () { * * @returns {Table} */ -function _TN(s) { - const [schema, table] = (s.raw ? s[0] : s).split('.'); +function _TN(a, ...args) { + if (Array.isArray(a) && a.raw) { + a = args.length ? args.map((b, i) => a[i] + b).join('') : a[0]; + } + const [schema, table] = a.split('.'); return table === undefined ? {table: schema} : {schema, table}; } diff --git a/package.json b/package.json index a7d8ad0a..ca8380e8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pg-promise", - "version": "11.7.1", + "version": "11.7.2", "description": "PostgreSQL interface for Node.js", "main": "lib/index.js", "typings": "typescript/pg-promise.d.ts", diff --git a/typescript/pg-promise.d.ts b/typescript/pg-promise.d.ts index 98d51899..3365a109 100644 --- a/typescript/pg-promise.d.ts +++ b/typescript/pg-promise.d.ts @@ -708,7 +708,7 @@ declare namespace pgPromise { ColumnSet: typeof ColumnSet TableName: typeof TableName - _TN: (data: TemplateStringsArray | string) => ITable + _TN: (data: TemplateStringsArray | string, ...args: Array) => ITable } interface IGenericPromise {