From affa546159c48ddf3e7f7ff309fff5aadef9813d Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Tue, 16 Apr 2024 17:45:06 +0100 Subject: [PATCH] Fix tests. --- packages/server/src/integrations/base/sql.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/server/src/integrations/base/sql.ts b/packages/server/src/integrations/base/sql.ts index 4b85f1cea2..7ee22b5933 100644 --- a/packages/server/src/integrations/base/sql.ts +++ b/packages/server/src/integrations/base/sql.ts @@ -163,6 +163,9 @@ class InternalBuilder { table: Table, opts: { aliases?: Record; relationship?: boolean } ): Knex.QueryBuilder { + const tableName = + this.client === SqlClient.SQL_LITE ? table._id! : table.name + function getTableAlias(name: string) { const alias = opts.aliases?.[name] return alias || name @@ -175,7 +178,7 @@ class InternalBuilder { const updatedKey = dbCore.removeKeyNumbering(key) const isRelationshipField = updatedKey.includes(".") if (!opts.relationship && !isRelationshipField) { - fn(`${getTableAlias(table.name)}.${updatedKey}`, value) + fn(`${getTableAlias(tableName)}.${updatedKey}`, value) } if (opts.relationship && isRelationshipField) { const [filterTableName, property] = updatedKey.split(".")