JT
JT
Explore posts from servers
DTDrizzle Team
Created by JT on 4/4/2024 in #help
How to do a foreign key with cascades
Genius! Thank you. That totally worked.
3 replies
DTDrizzle Team
Created by JT on 3/13/2024 in #help
Can I pay for a new feature to be added?
Thanks for the feedback. I should have said that sooner. Glad to know you are working on it.
3 replies
DTDrizzle Team
Created by JT on 2/18/2024 in #help
query to text
Thank you!
5 replies
DTDrizzle Team
Created by JT on 2/11/2024 in #help
where has iterator gone?
@Andrew Sherman hoping you can help me find it
5 replies
DTDrizzle Team
Created by JT on 2/1/2024 in #help
How to get the name of the table
Actually, I think I figured it out. For those that may be looking:
import { getTableName } from "drizzle-orm";
\\...
const tableName = getTableName(UserTable);
import { getTableName } from "drizzle-orm";
\\...
const tableName = getTableName(UserTable);
2 replies
DTDrizzle Team
Created by JT on 3/16/2023 in #help
.andWhere()
admittedly it would be easier if there was an .andWhere() option, but there are work arounds
28 replies
DTDrizzle Team
Created by JT on 3/16/2023 in #help
.andWhere()
Or if you don't like that solution, another solution I came up with in another situation was to pass around an object like :
const ands = [];
ands.push(eq(someColumn, someValue));
ands.push(or(like(column1, `%${query.search}%`), like(column2, `%${query.search}%`)));
// ands gets passed around to various functions and built up over a series of complex conditional operations
// and when it comes time to merge it all together, do:
for (const item of ands) {
if (where === undefined) {
where = item;
}
else {
where = and(where, item);
}
}
const ands = [];
ands.push(eq(someColumn, someValue));
ands.push(or(like(column1, `%${query.search}%`), like(column2, `%${query.search}%`)));
// ands gets passed around to various functions and built up over a series of complex conditional operations
// and when it comes time to merge it all together, do:
for (const item of ands) {
if (where === undefined) {
where = item;
}
else {
where = and(where, item);
}
}
28 replies
DTDrizzle Team
Created by JT on 3/16/2023 in #help
.andWhere()
and that would allow me to then and(existingWhereClause, eq(someColumn, someValue)) as needed
28 replies
DTDrizzle Team
Created by JT on 3/16/2023 in #help
.andWhere()
@bloberenober had a reasonable solution, but I ended up finding that it was ultimately too complicated for me. So instead of passing a complete query around, I would just pass around the where clause.
28 replies
DTDrizzle Team
Created by Cory on 4/8/2023 in #help
Is there currently a way to utilize onUpdate?
FYI, this is not mentioned in the docs anywhere.
7 replies
DTDrizzle Team
Created by JT on 3/18/2023 in #help
MySqlInsertValue<> vs typeof Table type mismatch
🙂
25 replies
DTDrizzle Team
Created by JT on 3/18/2023 in #help
MySqlInsertValue<> vs typeof Table type mismatch
just ran into another weird TS quirk. it thinks this is bad:
let out: Describe<T> = { props: { id : this.get('id') } };
let out: Describe<T> = { props: { id : this.get('id') } };
but this is good:
let out: Describe<T> = { props: {} };
out.props.id = this.get('id');
let out: Describe<T> = { props: {} };
out.props.id = this.get('id');
They are effectively the same thing TS!
25 replies
DTDrizzle Team
Created by JT on 3/18/2023 in #help
MySqlInsertValue<> vs typeof Table type mismatch
holy cow that breaks my code so much...i guess i've got a lot of ts debugging to work out. not your problem, but thanks for solving this one.
25 replies
DTDrizzle Team
Created by JT on 3/18/2023 in #help
MySqlInsertValue<> vs typeof Table type mismatch
thank you so much
25 replies
DTDrizzle Team
Created by JT on 3/18/2023 in #help
MySqlInsertValue<> vs typeof Table type mismatch
heh. typescript is so damn weird!
25 replies
DTDrizzle Team
Created by JT on 3/18/2023 in #help
MySqlInsertValue<> vs typeof Table type mismatch
^ you get that problem in vs code
25 replies
DTDrizzle Team
Created by JT on 3/18/2023 in #help
MySqlInsertValue<> vs typeof Table type mismatch
25 replies
DTDrizzle Team
Created by JT on 3/18/2023 in #help
MySqlInsertValue<> vs typeof Table type mismatch
this gist simplifies down the problem
25 replies
DTDrizzle Team
Created by JT on 3/18/2023 in #help
MySqlInsertValue<> vs typeof Table type mismatch
25 replies
DTDrizzle Team
Created by JT on 3/18/2023 in #help
MySqlInsertValue<> vs typeof Table type mismatch
i'm sorry
25 replies