cloudflare/d1 have no export named json_array
cloudflare/d1 have no export named json_array
.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}, '$')settings
:
"{\"hello\":[\"world\",\"there\"]}"SELECT json_extract('{"hello":["world","there"]}', '$.hello');'["world","there"]'SELECT json_extract('{"hello":["world","there"]}', '$');'{"hello":["world","there"]}'console.log(JSON.parse(user?.settings?.hello))message: "undefined" is not valid JSONconsole.log(JSON.parse(user?.settings))

wrangler d1 execute your-db —command="SELECT json_extract(…) FROM yourtable" is a good way to experiment.

.where(sqlraw sql query'select json_array_length(colname) as x from table'userTable.settings