You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey folks.. this package is quite neat! Thanks for sharing it.
quick question: The code does not seem like it is able to support maps (like JSONBs) or structs?
type User struct {
PikaTableName string `pika:"users"`
ID string `db:"id"`
Name string `db:"name"`
Age int32 `db:"age"`
Active bool `db:"active"`
Score float64 `db:"score"`
CreatedAt time.Time `db:"created_at"`
Tags pq.StringArray `db:"tags"`
Roles pq.StringArray `db:"roles"`
Preferences []byte `db:"preferences"`
Metadata []byte `db:"metadata"`
}
the : operator on repeating cases works well. e.g., name = "Bob Smith" AND roles:"admin" works where roles is an array.
For the JSONB case:
e.g.,
// JSONB filters
// Check if key exists using JSONB operators
`metadata:department`, // Check if department key exists
// Check for specific values using JSONB operators
`metadata.department:"engineering"`, // Check if department is "engineering"
These filters fail with Error applying filter: unexpected identifier department.
Before I try to dig deeper, is this a known issue? Are there any workarounds?
Hey folks.. this package is quite neat! Thanks for sharing it.
quick question: The code does not seem like it is able to support maps (like JSONBs) or structs?
the
:operator on repeating cases works well. e.g.,name = "Bob Smith" AND roles:"admin"works whererolesis an array.For the JSONB case:
e.g.,
These filters fail with
Error applying filter: unexpected identifier department.Before I try to dig deeper, is this a known issue? Are there any workarounds?