fix(db): cast columns to text for LIKE/ILIKE queries
Some checks failed
Build , Vet Test, and Lint / Run Vet Tests (1.23.x) (push) Successful in -29m15s
Build , Vet Test, and Lint / Run Vet Tests (1.24.x) (push) Successful in -29m7s
Build , Vet Test, and Lint / Build (push) Successful in -32m31s
Build , Vet Test, and Lint / Lint Code (push) Successful in -31m40s
Tests / Integration Tests (push) Failing after -33m31s
Tests / Unit Tests (push) Successful in -31m4s

This commit is contained in:
Hein
2026-04-13 14:05:17 +02:00
parent 354ed2a8dc
commit aef1f96c10
9 changed files with 49 additions and 28 deletions

View File

@@ -274,7 +274,7 @@ func TestBuildFilterCondition(t *testing.T) {
Value: "test",
Logic: "AND",
},
expected: "description ILIKE '%test%'",
expected: "CAST(description AS TEXT) ILIKE '%test%'",
},
{
name: "Starts with operator",
@@ -284,7 +284,7 @@ func TestBuildFilterCondition(t *testing.T) {
Value: "john",
Logic: "AND",
},
expected: "name ILIKE 'john%'",
expected: "CAST(name AS TEXT) ILIKE 'john%'",
},
{
name: "Ends with operator",
@@ -294,7 +294,7 @@ func TestBuildFilterCondition(t *testing.T) {
Value: "@example.com",
Logic: "AND",
},
expected: "email ILIKE '%@example.com'",
expected: "CAST(email AS TEXT) ILIKE '%@example.com'",
},
{
name: "Between operator",