In the latest version, using .jsonPathQueryFirst with .equals like this broke sql, but it has no type error.
// using it in `where`
const filtered = await db.table.where((q) =>
// filtering records by the `name` property from the `data` JSON column
q.get('data').jsonPathQueryFirst('$.name').equals('name'),
);
We can use it like contains.
const filtered = await db.table.where((q) =>
// filtering records by the `name` property from the `data` JSON column
q.get('data').jsonPathQueryFirst('$.name', (t) => t.string()).equals('name'),
);
Maybe we need to update the type check and docs to use (t) => t.string(). Or maybe we need to support.jsonPathQueryFirst('$.name').equals('name')` like previous versions.
It's a regression, equals and other basic operations shouldn't require a type, I'll fix it in a few days, and temporary please add the (t) => t.string().
https://orchid-orm.netlify.app/guide/json.html#jsonpathqueryfirst
In the latest version, using
.jsonPathQueryFirst
with.equals
like this broke sql, but it has no type error.We can use it like
contains
.Maybe we need to update the type check and docs to use
(t) => t.string(). Or maybe we need to support
.jsonPathQueryFirst('$.name').equals('name')` like previous versions.