3.1 relational bug fixes

This commit is contained in:
Francis Cao committed 2026-04-15 10:31:21 -07:00
1 parent b7f51b3b01
commit 04eb4b675e
8 files changed
+33 -16

No files matched your search

+3 -3
View File
@@ -90,9 +90,9 @@ function mapFilter(
case OPERATORS.doesNotContain:
return `positionCaseInsensitive(${column}, ${value}) = 0`;
case OPERATORS.regex:
return `match(${column}, ${value})`;
return `match(${column}, concat('(?i)', ${value}))`;
case OPERATORS.notRegex:
return `not match(${column}, ${value})`;
return `not match(${column}, concat('(?i)', ${value}))`;
default:
return '';
}
@@ -161,7 +161,7 @@ function getCohortQuery(filters: Record<string, any>) {
}
function getExcludeBounceQuery(filters: Record<string, any>) {
if (!filters.excludeBounce === true) {
if (filters.excludeBounce !== true) {
return '';
}
+4 -4
View File
@@ -97,9 +97,9 @@ function mapFilter(
case OPERATORS.doesNotContain:
return `${table}.${column} not ilike ${value}`;
case OPERATORS.regex:
return `${table}.${column} ~ ${value}`;
return `${table}.${column} ~* ${value}`;
case OPERATORS.notRegex:
return `${table}.${column} !~ ${value}`;
return `${table}.${column} !~* ${value}`;
default:
return '';
}
@@ -173,7 +173,7 @@ function getCohortQuery(filters: QueryFilters = {}) {
}
function getExcludeBounceQuery(filters: Record<string, any>) {
if (!filters.excludeBounce === true) {
if (filters.excludeBounce !== true) {
return '';
}
@@ -278,7 +278,7 @@ async function rawQuery(sql: string, data: Record<string, any>, name?: string):
if (process.env.DATABASE_REPLICA_URL && '$replica' in client) {
return client.$replica().$queryRawUnsafe(query, ...params);
}
console.log(query, params);
return client.$queryRawUnsafe(query, ...params);
}