king.edwards
DTDrizzle Team
•Created by king.edwards on 9/13/2023 in #help
Help with improving database query
Thank you!
50 replies
DTDrizzle Team
•Created by king.edwards on 9/13/2023 in #help
Help with improving database query
and the update query:
50 replies
DTDrizzle Team
•Created by king.edwards on 9/13/2023 in #help
Help with improving database query
for any one who had a similar question to this post
here is the new tagPromptLinkTable and it's relations
50 replies
DTDrizzle Team
•Created by king.edwards on 9/13/2023 in #help
Help with improving database query
forgot to give an update, was able to successfully refactor to using a many-to-many model
50 replies
DTDrizzle Team
•Created by king.edwards on 9/13/2023 in #help
Help with improving database query
@angelelz @dane.stevens
And thank you both for taking the time to help, much appreciated!!
I am going to apply these lessons and work on getting the new structure with the intermediate table in place
50 replies
DTDrizzle Team
•Created by king.edwards on 9/13/2023 in #help
Help with improving database query
sweet i'll give that a shoot
50 replies
DTDrizzle Team
•Created by king.edwards on 9/13/2023 in #help
Help with improving database query
ok great, cause i was using a trigger for my current method of storing the tagIds in array, but casdaing makes that part simpler
50 replies
DTDrizzle Team
•Created by king.edwards on 9/13/2023 in #help
Help with improving database query
posgres
50 replies
DTDrizzle Team
•Created by king.edwards on 9/13/2023 in #help
Help with improving database query
ah i see, thank you for taking the time to help and also make that visual !
that would mean i would take more more space in the DB, would that be a problem if each year has about 100 rows in their promptTagLink table?
also if a tag get's deleted, i imagine that i would be able to delete all the rows that had it in the promptTagLink table with a trigger function?
50 replies
DTDrizzle Team
•Created by king.edwards on 9/13/2023 in #help
Help with improving database query
ok so say if
<prompt1> has <tag1>
<prompt2> has <tag1, tag2>
<prompt3> has <tag1, tag7>
that would mean 3 rows is created in the intermediate promptTagLink table?
50 replies
DTDrizzle Team
•Created by king.edwards on 9/13/2023 in #help
Help with improving database query
ah ok i'll try that out
50 replies
DTDrizzle Team
•Created by king.edwards on 9/13/2023 in #help
Help with improving database query
I did it that way partly due to my lack of experiences with DB's and so that user can be able to assign as many tags to a prompt as they want from the list of tags they created
how would i go about doing this without keeping track of the tags currently assigned to a prompt without an array?
50 replies
DTDrizzle Team
•Created by king.edwards on 9/13/2023 in #help
Help with improving database query
ah ok so i am guessing i would have to do a many-to-many relation if I want a prompt to be able to have multiple tags, and tag to be able to be assigned to multiple prompts?
50 replies
DTDrizzle Team
•Created by king.edwards on 9/13/2023 in #help
Help with improving database query
part 2:
50 replies
DTDrizzle Team
•Created by king.edwards on 9/13/2023 in #help
Help with improving database query
yes here it is
have to break it into two parts due to text limit on discord
part 1:
50 replies
DTDrizzle Team
•Created by king.edwards on 9/13/2023 in #help
Help with improving database query
and my query
50 replies
DTDrizzle Team
•Created by king.edwards on 9/13/2023 in #help
Help with improving database query
My schema's
50 replies
DTDrizzle Team
•Created by king.edwards on 9/13/2023 in #help
Help with improving database query
Using relational queries looks awesome and does look to be better approach but I am getting en error with it as well 😭
but this is due me being new to DB and not knowing how to do things properly
this was the error i got
50 replies
DTDrizzle Team
•Created by king.edwards on 9/13/2023 in #help
Help with improving database query
I tried this but getting this error:
`
50 replies
DTDrizzle Team
•Created by king.edwards on 9/13/2023 in #help
Help with improving database query
My query
50 replies