swc/crates/swc_bundler/tests/.cache/untrusted/a4219dc461d072599e78126072e4c8fb065f8e20.ts
2021-11-09 20:42:49 +09:00

31 lines
836 B
TypeScript

// Loaded from https://raw.githubusercontent.com/denjucks/dex/master/lib/migrate/table-resolver.js
//Get schema-aware table name
export function getTableName(tableName, schemaName) {
return schemaName ? `${schemaName}.${tableName}` : tableName;
}
//Get schema-aware query builder for a given table and schema name
export function getTable(trxOrKnex, tableName, schemaName) {
return schemaName
? trxOrKnex(tableName).withSchema(schemaName)
: trxOrKnex(tableName);
}
export function getLockTableName(tableName) {
return tableName + '_lock';
}
export function getLockTableNameWithSchema(tableName, schemaName) {
return schemaName
? schemaName + '.' + getLockTableName(tableName)
: getLockTableName(tableName);
}
export default {
getLockTableName,
getLockTableNameWithSchema,
getTable,
getTableName,
};