Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ require (
github.com/gorilla/securecookie v1.1.1
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0
github.com/jackc/pgconn v1.14.3
github.com/jackc/pgerrcode v0.0.0-20220416144525-469b46aa5efa
github.com/jackc/pgx/v4 v4.18.2
Expand All @@ -40,7 +39,7 @@ require (
github.com/ory/dockertest/v3 v3.10.0
github.com/pkg/errors v0.9.1
github.com/pkg/profile v1.7.0
github.com/raystack/salt v0.6.2
github.com/raystack/salt v0.6.3
github.com/robfig/cron/v3 v3.0.1
github.com/rs/cors v1.11.1
github.com/spf13/cobra v1.8.1
Expand Down Expand Up @@ -103,6 +102,7 @@ require (
github.com/google/go-tpm v0.9.0 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1922,8 +1922,8 @@ github.com/prometheus/statsd_exporter v0.22.7 h1:7Pji/i2GuhK6Lu7DHrtTkFmNBCudCPT
github.com/prometheus/statsd_exporter v0.22.7/go.mod h1:N/TevpjkIh9ccs6nuzY3jQn9dFqnUakOjnEuMPJJJnI=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/rakyll/embedmd v0.0.0-20171029212350-c8060a0752a2/go.mod h1:7jOTMgqac46PZcF54q6l2hkLEG8op93fZu61KmxWDV4=
github.com/raystack/salt v0.6.2 h1:GPUQ6j3h3cFd3k42Lds1xbG672yvhUjO9ut9oAJqW9M=
github.com/raystack/salt v0.6.2/go.mod h1:Dwc5VlPevdY56XgYjWd+Ubkil7ohCM4526dkAuWnGN4=
github.com/raystack/salt v0.6.3 h1:ZfSumyhvRIx9nf2g9aQKDRdSJQuQ+e6+TC2FnOfpv60=
github.com/raystack/salt v0.6.3/go.mod h1:3f9NBwwtuniW5xOsyQ3ntcugFVTFDDZBqHw6rX6+8w4=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
Expand Down
6 changes: 6 additions & 0 deletions internal/store/postgres/org_billing_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const (
OPERATOR_NOT_IN = "notin"
OPERATOR_LIKE = "like"
OPERATOR_NOT_LIKE = "notlike"
OPERATOR_ILIKE = "ilike"
OPERATOR_NOT_ILIKE = "notilike"
)

const (
Expand Down Expand Up @@ -415,6 +417,10 @@ func processStringDataType(filter rql.Filter, query *goqu.SelectDataset) *goqu.S
case OPERATOR_NOT_LIKE:
// some semi string sql types like UUID require casting to text to support like operator
query = query.Where(goqu.L(fmt.Sprintf(`"%s"::TEXT NOT LIKE '%s'`, filter.Name, filter.Value.(string))))
case OPERATOR_ILIKE:
query = query.Where(goqu.L(fmt.Sprintf(`"%s"::TEXT ILIKE '%s'`, filter.Name, filter.Value.(string))))
case OPERATOR_NOT_ILIKE:
query = query.Where(goqu.L(fmt.Sprintf(`"%s"::TEXT NOT ILIKE '%s'`, filter.Name, filter.Value.(string))))
default:
query = query.Where(goqu.Ex{filter.Name: goqu.Op{filter.Operator: filter.Value.(string)}})
}
Expand Down
9 changes: 1 addition & 8 deletions web/sdk/admin/utils/transform-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,11 @@ function transformFilter(
value = convertFilterValue(filter.value);
}

// TODO: add support for ilike in RQL and backend
// Transform ilike operator to like only for string values
const operator =
filter.operator === "ilike" && value.case === "stringValue"
? "like"
: filter.operator;

const fieldName = fieldNameMapping?.[filter.name] ?? filter.name;

return create(RQLFilterSchema, {
name: fieldName,
operator,
operator: filter.operator,
value,
});
}
Expand Down
Loading