1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

fix: use custom elements wrapper for foreign column and description in query

This commit is contained in:
2025-03-28 12:50:01 +01:00
parent eb706c3e51
commit 973b0fc4be

View File

@@ -440,16 +440,17 @@ export default (connections: Record<string, antares.Client>) => {
ipcMain.handle('get-foreign-list', async (event, { uid, schema, table, column, description }) => { ipcMain.handle('get-foreign-list', async (event, { uid, schema, table, column, description }) => {
if (!validateSender(event.senderFrame)) return { status: 'error', response: 'Unauthorized process' }; if (!validateSender(event.senderFrame)) return { status: 'error', response: 'Unauthorized process' };
const { elementsWrapper: ew } = customizations[connections[uid]._client];
try { try {
const query = connections[uid] const query = connections[uid]
.select(`${column} AS foreign_column`) .select(`${ew}${column}${ew} AS foreign_column`)
.schema(schema) .schema(schema)
.from(table) .from(table)
.orderBy('foreign_column ASC'); .orderBy('foreign_column ASC');
if (description) if (description)
query.select(`LEFT(${description}, 20) AS foreign_description`); query.select(`LEFT(${ew}${description}${ew}, 20) AS foreign_description`);
const results = await query.run<Record<string, string>>(); const results = await query.run<Record<string, string>>();