Matt
Explore posts from serversDTDrizzle Team
•Created by Matt on 4/21/2024 in #help
Struggling when changing tables relationships or columns
I find myself getting errors such as quite regularly
[cause]: [ResponseError: SQLite error: no such table: main.old_push_business] {
code: 'SQLITE_UNKNOWN',
proto: {
message: 'SQLite error: no such table: main.old_push_business',
code: 'SQLITE_UNKNOWN'
}
}
}
It normally happens when I've changed a relationship or a column. I'll push the changes, it appears to be successful, I'll then try to run studio, which just gives me the loading spinner on the left where the columns normally are. I'll then try and push again and errors such as the above.
This happens a lot, the work around I've found, at least locally, is to recreate the local db and push again which then seems to reset everything (I'm using LibSQL/Turso).
Am I doing something fundamentally wrong that's causing these issues?
2 replies
DTDrizzle Team
•Created by Matt on 4/18/2024 in #help
How do I filter with date in SQLite (Turso)
I can't find an answer in the docs but I have a timestamp defined in my schema like this
updatedAt: text('updated_at').default(sql``(CURRENT_TIMESTAMP)``).notNull(),
I'm trying to see whether this timestamp was in the last 24 hours but because the type is seen as a string it won't let me check it with Date and lt etc.
What am I missing? Thanks.6 replies
DTDrizzle Team
•Created by Matt on 3/14/2024 in #help
Error when trying to create a unique constraint
I have this in my schema
I'm trying to create a unique constraint on the business and image ids but get an error
I thought I may have missed something so I lifted the example from the docs but get the same error. Example:
What am I missing?
3 replies
DTDrizzle Team
•Created by Matt on 1/20/2024 in #help
Have I got inserts right for MySQL(Planetscale)?
I'm switching over to Drizzle from Prisma, just wanted to make sure I have inserts written correctly, specifically inserts with relationships, for example, this is inserting a business with an associated businessAddress, does that look right? Ctx is just TRPC.
Appreciate the input, thanks.
3 replies