Richard E
Explore posts from serversDTDrizzle Team
•Created by Richard E on 3/28/2024 in #help
How can I convert a null value to integer in a select?
I am doing a left join so joined table may contain null fields. In this case I have a player.ranking field that if null I want to default to 9999. I've tried numerous ways but nothing is working:
4 replies
DTDrizzle Team
•Created by Richard E on 3/7/2024 in #help
Is there a way to set foreign key on a bulk insert?
Apologies if this is a stupid question but I need to know if I'm missing something obvious. I have two tables where the second one has a foreign key relationship to the other, standard master/detail setup.
After I insert the master records, call the entity
Pool
I return the new id
and then I loop through an array of detail records and set that foreign key pool_id
to the newly acquired id
and then do a batch insert of those detail records PoolTeam
like so
Is there any way I can specify the master record id
in this insert statement without having to previous loop through the array setting the pool_id
property? It it possible to do this master/detail insert in a single call with Drizzle? It works the way I have it but just seems wrong to do it this way.2 replies
DTDrizzle Team
•Created by Richard E on 1/10/2024 in #help
Is there a way to introspect with specific order?
When I generate my schema file with introspect:pg the tables are not in any order was far as I can see. They are probably in whatever order I created them but it's very messy with a lot of tables. Is there any way to put some kind of order to this?
3 replies
DTDrizzle Team
•Created by Richard E on 12/6/2023 in #help
Infer select that includes a foreign key object collection?
If I have a query such as the following:
how can I use something like to infer users with posts included?
2 replies