settings raw as true in sqlite returns JSON as String #16900
Labels
dialect: sqlite
For issues and PRs. Things that involve SQLite (and do not involve all dialects).
pending-approval
Bug reports that have not been verified yet, or feature requests that have not been accepted yet
type: bug
Bug Description
when raw is true sequelize returns JSONs as string for
sqlite
database.for select queries
findOne
andfindAll
, when used with Postgres function returns JSON as object in JavaScript but when using with SQLite it return JSON's as strings when raw is true.Reproducible Example
here
user.preferences
is a JSON object but it is returned as string.For postgres it works well and returns a JSON object, but for sqlite it returns string.
I am moving my database from postgres to sqlite as I am moving to a VPS server.
I already have a codebase where there are many
raw
astrue
are used, and also in select queries most of the time we don't need actual models as we only return data from GET API, So I wanted to keep raw as true.What do you expect to happen?
JSONs should be returned as a js object for sqlite database
Environment
I am using
sequelize
version6.32.1
, with node 14 withSQLite
database withsqlite3
connector Library.Would you be willing to resolve this issue by submitting a Pull Request?
Indicate your interest in the resolution of this issue by adding the 👍 reaction. Comments such as "+1" will be removed.
The text was updated successfully, but these errors were encountered: