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
This could be considered more of a Laravel issue, but I thought I would raise it here in case it seemed worthwhile to work-around it. Currently, Laravel treats sqlite like any other PDO database, however sqlite doesn't support the "->" shorthand syntax for JSON columns, which means Tag::findFromString fails.
e.g.: This fails: Tag::findFromString('asdf') => null
SQL: select * from "tags" where "name->en" = ? and "type" is null limit 1
Workaround: Tag::whereRaw("json_extract(`name`, '$.en') = 'asdf'")->first() => Tag object
SQL: select * from "tags" where json_extract(`name`, '$.en') = 'asdf'
Unfortunately this is causing my integration tests that use an in-memory sqlite database to fail.
The text was updated successfully, but these errors were encountered:
This could be considered more of a Laravel issue, but I thought I would raise it here in case it seemed worthwhile to work-around it. Currently, Laravel treats sqlite like any other PDO database, however sqlite doesn't support the "->" shorthand syntax for JSON columns, which means
Tag::findFromString
fails.e.g.: This fails:
Tag::findFromString('asdf')
=> nullSQL:
select * from "tags" where "name->en" = ? and "type" is null limit 1
Workaround:
Tag::whereRaw("json_extract(`name`, '$.en') = 'asdf'")->first()
=> Tag objectSQL:
select * from "tags" where json_extract(`name`, '$.en') = 'asdf'
Unfortunately this is causing my integration tests that use an in-memory sqlite database to fail.
The text was updated successfully, but these errors were encountered: