© 2026 Hedgehog Software, LLC

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

Using default with `text` json mode creates empty `DEFAULT`

Hi all,

entries: text('entries', { mode: 'json' }).$type<number[]>().default([]),
entries: text('entries', { mode: 'json' }).$type<number[]>().default([]),

results in

CREATE TABLE `User` (
    `id` integer PRIMARY KEY NOT NULL,
    `entries` text DEFAULT ,
    `createdAt` integer DEFAULT CURRENT_TIMESTAMP,
    `updatedAt` integer NOT NULL,
    `lastSyncedAt` integer
);
CREATE TABLE `User` (
    `id` integer PRIMARY KEY NOT NULL,
    `entries` text DEFAULT ,
    `createdAt` integer DEFAULT CURRENT_TIMESTAMP,
    `updatedAt` integer NOT NULL,
    `lastSyncedAt` integer
);


which then throws an error when i try to push to Turso. I suspect it's the empty
entries
entries
default, when i remove all works fine.

Is this expected or show i create a issue on github?
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
text mode json for sqlite Dq doesn't parse by default
Drizzle TeamDTDrizzle Team / help
2y ago
adding default to array of text creates invalid migrations
Drizzle TeamDTDrizzle Team / help
3y ago
Invalid default value when using defaultNow()
Drizzle TeamDTDrizzle Team / help
3y ago