cobite
DTDrizzle Team
•Created by cobite on 9/24/2023 in #help
Making a column only allow letters and characters, including capitals
Yeah i'm just validating it on the backend via yup, was just wondering if I could do it on the database side also. Thanks
4 replies
DTDrizzle Team
•Created by cobite on 9/24/2023 in #help
Trying to generate a short id via a random string function
Just wondering if the search isn't great, or if it's something on my side.
18 replies
DTDrizzle Team
•Created by cobite on 9/24/2023 in #help
Trying to generate a short id via a random string function
I so have trouble with the search functionality on the documentation. I've searched for inferselectmodel and infermodel before I asked etc but nothing shows.
18 replies
DTDrizzle Team
•Created by cobite on 9/24/2023 in #help
Trying to generate a short id via a random string function
Just a side question, since updating, the following is deprecated:
But it shows too much data (the whole PgTable):
18 replies
DTDrizzle Team
•Created by cobite on 9/24/2023 in #help
Trying to generate a short id via a random string function
thanks! Going to try the following now:
18 replies
DTDrizzle Team
•Created by cobite on 9/24/2023 in #help
Trying to generate a short id via a random string function
hmm when I try $default I get:
18 replies
DTDrizzle Team
•Created by cobite on 9/24/2023 in #help
Trying to generate a short id via a random string function
Thank you, I will try that now, I assume it's something along the lines of:
18 replies
DTDrizzle Team
•Created by cobite on 9/24/2023 in #help
Trying to generate a short id via a random string function
Hey!
I want the shortId to use the generateRandomString function to populate when a new item for that schema is generated on the database.
18 replies
DTDrizzle Team
•Created by cobite on 8/28/2023 in #help
How to get the count of records? Here is my normal sql, trying to translate into drizzle
I do have a level and an amountChildren (only gets direct children) so far, but I guess I need a totalDescendents too
100 replies
DTDrizzle Team
•Created by cobite on 8/28/2023 in #help
How to get the count of records? Here is my normal sql, trying to translate into drizzle
I've seemed to have come full circle.
So by just getting some of the comments back to the client, i'm only getting the amount of children within the data in the client, not the entire dataset.
So I do actually need to get this at the server side 😅
100 replies
DTDrizzle Team
•Created by cobite on 8/28/2023 in #help
How to get the count of records? Here is my normal sql, trying to translate into drizzle
Hey, it's a project that me and a bunch of friends are working on. I managed to get it working with (based on your tip) :
How would adding the metadata on insert work if I don't know how many replies a comment would get beforehand? You mean on each reply, update the parent ids hasChildren?
100 replies
DTDrizzle Team
•Created by cobite on 8/28/2023 in #help
How to get the count of records? Here is my normal sql, trying to translate into drizzle
The complexity creep is real.. 🥲
I'm trying to add a little feature that if it reaches the level 3 comments, it will check if they have children, and if they do then add a field called hasChildren.
The reason for this is to be able to determine on the client side if a level 3 comment has children so that a load more button can be shown.
Was trying something like:
and below:
No luck yet!
I could just get max levels + 1, and then on the client side add the amount of children to level 3 objects and just do nothing with the level 4s, but I think it might be cleaner to just find out the amount via sql
100 replies
DTDrizzle Team
•Created by cobite on 9/1/2023 in #help
Transforming SELECT from case to camelCase via sql with execute
😂 so simple!
6 replies
DTDrizzle Team
•Created by cobite on 9/1/2023 in #help
Transforming SELECT from case to camelCase via sql with execute
What i'm doing at the comment is this after the execute:
6 replies
DTDrizzle Team
•Created by cobite on 8/28/2023 in #help
How to get the count of records? Here is my normal sql, trying to translate into drizzle
Think I have it working:
100 replies
DTDrizzle Team
•Created by cobite on 8/28/2023 in #help
How to get the count of records? Here is my normal sql, trying to translate into drizzle
Oh ok, I was just adding username to the select and added your inner join, and the error was:
error rendering: PostgresError: column reference "id" is ambiguous
Get back to work though there's no rush with this. I'm learning a ton from you though so thanks!
100 replies
DTDrizzle Team
•Created by cobite on 8/28/2023 in #help
How to get the count of records? Here is my normal sql, trying to translate into drizzle
I was previously doing it the other way:
and
100 replies
DTDrizzle Team
•Created by cobite on 8/28/2023 in #help
How to get the count of records? Here is my normal sql, trying to translate into drizzle
Yes finally!
Now I just need to add a join to use the comment.user_id to get the username from the users table.
Not sure where to fit that in, but i'll get there eventually 🙂
100 replies
DTDrizzle Team
•Created by cobite on 8/28/2023 in #help
How to get the count of records? Here is my normal sql, trying to translate into drizzle
Had to just add the c to:
100 replies
DTDrizzle Team
•Created by cobite on 8/28/2023 in #help
How to get the count of records? Here is my normal sql, trying to translate into drizzle
If I remove the trailing , from here:
I get:
100 replies