ijd
ijd
DTDrizzle Team
Created by Graeme on 6/27/2023 in #help
Unexpected type mismatch for sqlite integer boolean mode
I think this is likely the intended behavior. If you have a boolean column, you’re trying to store a true/false. This is the mapping between two language-specific expressions of true/false.
9 replies
DTDrizzle Team
Created by ijd on 6/23/2023 in #help
Optional filtering
then just select()...where(...where)
10 replies
DTDrizzle Team
Created by ijd on 6/23/2023 in #help
Optional filtering
Dug through some earlier threads, apparently conditionally constructing the where array is the way to go! so in this case:
const where: SQL[] = [
// not embedded yet
isNull(chunks.embedding),
// bootleg job runner system - if no embedding 15s after last attempt,
// pick up with next job cycle
or(
isNull(chunks.embeddedAt),
lt(
chunks.embeddedAt,
new Date(Date.now() - (args.timeoutMs ?? DEFAULT_TIMEOUT_MS))
)
),
];
if (args.documentId) {
where.push(eq(chunks.documentId, args.documentId));
}
const where: SQL[] = [
// not embedded yet
isNull(chunks.embedding),
// bootleg job runner system - if no embedding 15s after last attempt,
// pick up with next job cycle
or(
isNull(chunks.embeddedAt),
lt(
chunks.embeddedAt,
new Date(Date.now() - (args.timeoutMs ?? DEFAULT_TIMEOUT_MS))
)
),
];
if (args.documentId) {
where.push(eq(chunks.documentId, args.documentId));
}
10 replies