JavaDad
JavaDad
Explore posts from servers
DTDrizzle Team
Created by JavaDad on 12/22/2023 in #help
How to select part of a string in Drizzle?
I have dates in ISO format (Stored as Strings) in my SQLite database. I need to be able to find a match only querying the year-month-day. Attached are two different ways I have tried this and neither seem to work.
const timers = await db.select().from(timerSchema).where(sql`to_tsvector ('simple', '${timerSchema date}') @@ to_tsquery('simple', '${queryDayString}'))`;
const timers = await db.select().from(timerSchema).where(sql`to_tsvector ('simple', '${timerSchema date}') @@ to_tsquery('simple', '${queryDayString}'))`;
const timers = await db.select().from(timerSchema).where(sql`timer_date like '%${queryDayString}%'`);
const timers = await db.select().from(timerSchema).where(sql`timer_date like '%${queryDayString}%'`);
4 replies