@mrnafisia/type-query
Advanced tools
Comparing version 1.0.30 to 1.0.31
@@ -21,3 +21,3 @@ import type { ClientBase } from 'pg'; | ||
declare const dropTableSQL: (table: Table) => string; | ||
declare const getSequenceName: (tableTitle: string, columnKey: string, column: { | ||
declare const getSequenceName: (tableSchema: string, tableTitle: string, columnKey: string, column: { | ||
title?: string; | ||
@@ -24,0 +24,0 @@ seqTitle?: string; |
@@ -317,3 +317,3 @@ "use strict"; | ||
// build query | ||
var tokens = ["CREATE SEQUENCE ".concat(getSequenceName(table.title, key, column))]; | ||
var tokens = ["CREATE SEQUENCE ".concat(getSequenceName(table.schema, table.title, key, column))]; | ||
if (column.type === 'smallint') { | ||
@@ -341,3 +341,3 @@ tokens.push('as smallint'); | ||
// add query to the result | ||
queries.push("DROP SEQUENCE ".concat(getSequenceName(table.title, key, column), " ;")); | ||
queries.push("DROP SEQUENCE ".concat(getSequenceName(table.schema, table.title, key, column), " ;")); | ||
} | ||
@@ -357,3 +357,3 @@ return queries; | ||
if (column.default === 'auto-increment') { | ||
tokens.push("DEFAULT nextVal( '".concat(getSequenceName(table.title, key, column), "'::regClass )")); | ||
tokens.push("DEFAULT nextVal( '".concat(getSequenceName(table.schema, table.title, key, column), "'::regClass )")); | ||
} | ||
@@ -397,4 +397,4 @@ else if (column.default === true) { | ||
exports.dropTableSQL = dropTableSQL; | ||
var getSequenceName = function (tableTitle, columnKey, column) { var _a, _b; return (_a = column.seqTitle) !== null && _a !== void 0 ? _a : (tableTitle + '_' + ((_b = column.title) !== null && _b !== void 0 ? _b : columnKey) + '_seq'); }; | ||
var getSequenceName = function (tableSchema, tableTitle, columnKey, column) { var _a, _b; return "\"".concat(tableSchema, "\".\"") + ((_a = column.seqTitle) !== null && _a !== void 0 ? _a : (tableTitle + '_' + ((_b = column.title) !== null && _b !== void 0 ? _b : columnKey) + '_seq')) + '"'; }; | ||
exports.getSequenceName = getSequenceName; | ||
//# sourceMappingURL=schema.js.map |
{ | ||
"name": "@mrnafisia/type-query", | ||
"version": "1.0.30", | ||
"version": "1.0.31", | ||
"description": "mini-orm with full type support for postgres.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
521005