Pramus
Pramus
Explore posts from servers
KKinde
Created by Pramus on 4/26/2024 in #💻┃support
Separate login per organization
No description
27 replies
DTDrizzle Team
Created by Pramus on 4/24/2024 in #help
SQLite functions not being called
No description
1 replies
DTDrizzle Team
Created by Pramus on 4/23/2024 in #help
SQLean's uuid4() in SQLite CREATE TABLE
I'm using Turso, enabled SQLean uuid extension and I would like to generate a table via drizzle-kit with a following id:
id: text("id")
.primaryKey()
.default(sql`uuid4()`),
id: text("id")
.primaryKey()
.default(sql`uuid4()`),
and the output:
`id` text PRIMARY KEY DEFAULT uuid4() NOT NULL,
`id` text PRIMARY KEY DEFAULT uuid4() NOT NULL,
If I'm not mistaken, this should be possible but throws an error. Is there any workaround?
7 replies
DTDrizzle Team
Created by Pramus on 4/5/2024 in #help
libSQL/SQLite: Issue with CAST and ILIKE
I'm trying to cast number and date to string inside the 'where' statement. Unfortunately I'm getting a SQL syntax error around ILIKE. What's the issue with this code?:
.where(
or(
ilike(customers.name, `%${query}%`),
ilike(customers.email, `%${query}%`),
sql`CAST(invoices.amount AS TEXT) ILIKE ${`%${query}%`}`,
sql`CAST(invoices.date AS TEXT) ILIKE ${`%${query}%`}`,
ilike(invoices.status, `%${query}%`),
),
)
.where(
or(
ilike(customers.name, `%${query}%`),
ilike(customers.email, `%${query}%`),
sql`CAST(invoices.amount AS TEXT) ILIKE ${`%${query}%`}`,
sql`CAST(invoices.date AS TEXT) ILIKE ${`%${query}%`}`,
ilike(invoices.status, `%${query}%`),
),
)
2 replies