jsonb_extract in sqlite

This commit is contained in:
Charlie Kolb 2025-10-28 17:10:26 +01:00
parent 40bd906835
commit 2a39294add
No known key found for this signature in database

View File

@ -417,7 +417,7 @@ export function resolvePath(
// this is mostly for sqlite, behavior in MariaDB and MySQL mostly aligns though there are subtle
// difference we don't care for in the face of imminent removal of support
const path = toSQLitePath(pathArray);
const base = `json_extract(${ref}, '${path.replaceAll("'", "\\'")}')`;
const base = `jsonb_extract(${ref}, '${path.replaceAll("'", "\\'")}')`;
if (typeof value === 'number') {
return `CAST(${base} as ${dataTableColumnTypeToSql('number', dbType)})`;