Files
klz-cables.com/.pnpm-store/v10/files/91/61df2ca3958fb2beab2903fc41313e62cc993698b91b301ec2a0e41545a9a22c2bd297fea6df017af4e5be078da15675dc9e0e3627901dd73c3467e2c14e95
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

20 lines
684 B
Plaintext

import { alias } from 'drizzle-orm/pg-core';
import { alias as aliasSQLite } from 'drizzle-orm/sqlite-core/alias';
import toSnakeCase from 'to-snake-case';
import { v4 as uuid } from 'uuid';
export const getTableAlias = ({ adapter, tableName })=>{
const newAliasTableName = toSnakeCase(uuid());
let newAliasTable;
if (adapter.name === 'postgres') {
newAliasTable = alias(adapter.tables[tableName], newAliasTableName);
}
if (adapter.name === 'sqlite') {
newAliasTable = aliasSQLite(adapter.tables[tableName], newAliasTableName);
}
return {
newAliasTable,
newAliasTableName
};
};
//# sourceMappingURL=getTableAlias.js.map