© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•2y ago•
2 replies
Varna

text mode json for sqlite Dq doesn't parse by default

I get
SyntaxError: "undefined" is not valid JSON
SyntaxError: "undefined" is not valid JSON
for
json_string: text("json_string", { mode: "json" })
json_string: text("json_string", { mode: "json" })
field.
When I use methods like:
db.query.Issue.findMany();
db.query.Issue.findMany();

or
db.select().from(Issue)
db.select().from(Issue)

while it does work and return string, If I manually select it by:
db.select({
  json_string: Issue.json_string
}).from(Issue)
db.select({
  json_string: Issue.json_string
}).from(Issue)


I'm using D1 db.
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

default to empty object for sqlite text field with JSON mode
Drizzle TeamDTDrizzle Team / help
2y ago
Using default with `text` json mode creates empty `DEFAULT`
Drizzle TeamDTDrizzle Team / help
2y ago
createInsertSchema forgets .$type() on text json mode fields in sqlite
Drizzle TeamDTDrizzle Team / help
3y ago
sqlite DEFAULT is not JSON-encoded
Drizzle TeamDTDrizzle Team / help
3y ago