masto
masto
DTDrizzle Team
Created by masto on 9/27/2024 in #help
Drizzle Studio incompatibility with generatedAlwaysAsIdentity
9 replies
DTDrizzle Team
Created by masto on 9/27/2024 in #help
Drizzle Studio incompatibility with generatedAlwaysAsIdentity
Thanks. I came here first to double check it was actually a problem because of my limited experience but it's pretty clear it's a thing, so I'll file an issue tomorrow.
9 replies
DTDrizzle Team
Created by masto on 9/27/2024 in #help
Drizzle Studio incompatibility with generatedAlwaysAsIdentity
Here's a trivial case to reproduce this problem: https://github.com/masto/drizzle-studio-bug
9 replies
DTDrizzle Team
Created by masto on 9/27/2024 in #help
Drizzle Studio incompatibility with generatedAlwaysAsIdentity
If you're talking about the screenshot above, that's from the editor in Drizzle Studio. I think it's a minor issue compared to not being able to use the table editor to add rows, since you can just ignore the error and run the code anyway.
9 replies
DTDrizzle Team
Created by masto on 9/27/2024 in #help
Drizzle Studio incompatibility with generatedAlwaysAsIdentity
No description
9 replies
DTDrizzle Team
Created by masto on 9/27/2024 in #help
Drizzle Studio incompatibility with generatedAlwaysAsIdentity
Now that I've gone a little further, I'm wondering if it's possible to use identity columns at all. If I define a column as:
id: integer("id").primaryKey().generatedAlwaysAsIdentity()
id: integer("id").primaryKey().generatedAlwaysAsIdentity()
Then I can't even use db.insert(...).values({...}) because the id column is required by Drizzle but forbidden by PostgreSQL. (Unless I do something ugly like id: sql`DEFAULT. This isn't the case with serial, so again I feel like I'm really missing something. Was any support added for identity columns beyond just creating them? Ok, never mind that.. it does work, I was just confused by it being flagged as an error in the "Drizzle runner" editor. But if I execute the line, it runs. Still can't use the actual table editor, though.
9 replies