
users table with a address column that you can search over? That seems fairly "real world" for a lot of D1 use cases. Or an orders table with a similar approach?)

.where(sql…) per https://orm.drizzle.team/docs/sql#sql-in-where
It's not a js function. you need to include it within your raw sql query , like sql'select json_array_length(colname) as x from table'.

userTable.settings ?

json function


parse/extract json, so u are using the wrong functionsjson_extract
json_extract(${usersTable.settings}, '$')CREATE TABLE sensor_readings (
-- other columns omitted
location as (json_extract(raw_data, '$.measurement.location')) STORED
-- now you can create an index on data derived from your JSON data!
);usersaddressorders.where(sql)raw sql query'select json_array_length(colname) as x from table'userTable.settingsjsonparse/extract jsonjson_extractjson_extract(${usersTable.settings}, '$')