Darren
DTDrizzle Team
•Created by chepracio on 11/23/2024 in #help
TS2353: Object literal may only specify known properties, and where does not exist in type
25 replies
DTDrizzle Team
•Created by chepracio on 11/23/2024 in #help
TS2353: Object literal may only specify known properties, and where does not exist in type
Yes, of course I see the images, but I'm unable to replicate this behaviour, whether a uuid is defined as not null or not it always shows up in a set operation.
So the idea is to go to drizzle.run and recreate the behaviour you see using your code so we can see it happening. And if you can't replicate it then you know it's an issue in your files, probably a rogue import statement of a schema or something.
25 replies
DTDrizzle Team
•Created by chepracio on 11/23/2024 in #help
TS2353: Object literal may only specify known properties, and where does not exist in type
put an example in drizzle run
25 replies
DTDrizzle Team
•Created by roze789 on 11/30/2024 in #help
DrizzleKit won't regenerate my schemas because of index keys
it doesn't add anything, you can check the sql, it uses that exact name for the index, so if it's the same in your other tables, then thats the error, check what sql is generated
44 replies
DTDrizzle Team
•Created by roze789 on 11/30/2024 in #help
DrizzleKit won't regenerate my schemas because of index keys
And those index names aren't used in your other tables?
44 replies
DTDrizzle Team
•Created by Ganbatte on 11/27/2024 in #help
Why Isn't RLS Working with Drizzle and Supabase?
then jsut grant the specialrole to admins, and add the extra policy so admins using return true, you can also do this with no extra roles, and just use the using sql to check role for that user from users table along with id, for example an update checks if id matches or user is in admin role.. etc its up to you
42 replies
DTDrizzle Team
•Created by Ganbatte on 11/27/2024 in #help
Why Isn't RLS Working with Drizzle and Supabase?
so i would remove roles for basic user and just use builtin authenticatedRole
42 replies
DTDrizzle Team
•Created by Ganbatte on 11/27/2024 in #help
Why Isn't RLS Working with Drizzle and Supabase?
also note 'authenticatedRole' covers everything that isnt anon
42 replies
DTDrizzle Team
•Created by Ganbatte on 11/27/2024 in #help
Why Isn't RLS Working with Drizzle and Supabase?
policy wise im not sure your user would ever be able to select anything: this is sort of an example:
The above would be sort of like say an email table, each user can only select/insert/update/delete their own entries if it was says posts the select would just return true in using
Note the authUid here is from drizzle which maps to the supabase auth function for comparing the sub, this would not work if youre using auth js, since the users arent in the supabase auth schema you would need to use the auth js function they give you
Also if youre validating cross tables you would use something like:
Note: you have 'using' on all bar insert (this checks the sub jwt against the row) then you have 'with checks' for insert and update (this checks the sub jwt against the user that is inserted/updated so can only input their own id)
Lastly, the error you are getting refers to a user cant change role to a role they do not have
now i dont know how you created this role, but usually if you GRANT authenticated thats enough, but it looks like you are using different roles here
42 replies
DTDrizzle Team
•Created by mattiskristensen on 11/26/2024 in #help
Passing transaction to functions
think this is one way, tho your query just looks like a join would be sufficient, no need to make 2 queries
6 replies
DTDrizzle Team
•Created by Ganbatte on 11/27/2024 in #help
Why Isn't RLS Working with Drizzle and Supabase?
the auth js docs show how to also generate compatible supabase jwt, you would only need to alter the rls function to use next_auth.uid() not auth.uid()
42 replies
DTDrizzle Team
•Created by Ganbatte on 11/27/2024 in #help
Why Isn't RLS Working with Drizzle and Supabase?
the ssr isnt required no, nor supabase auth, you just need some way of validating what role and id the 'user' has in the rls functions, for supabase auth its using the auth schema and the sub/role from the jwt, if youre using seperate auth, then you would need to use your own function to validate who the user is.
42 replies
DTDrizzle Team
•Created by Ganbatte on 11/27/2024 in #help
Why Isn't RLS Working with Drizzle and Supabase?
rls is overridden if youre only using the 'postgres' role to access the tables, you need to use a non postgres/superuser role for rls to take effect
42 replies
DTDrizzle Team
•Created by chepracio on 11/23/2024 in #help
TS2353: Object literal may only specify known properties, and where does not exist in type
actually totally forgot, you cant use nested wheres currently i dont think
25 replies
DTDrizzle Team
•Created by chepracio on 11/23/2024 in #help
TS2353: Object literal may only specify known properties, and where does not exist in type
@chepracio can you try change with: {user to with : {users
25 replies
DTDrizzle Team
•Created by Ali on 11/3/2024 in #help
Depreciated table
New version uses an array now, see docs
10 replies
DTDrizzle Team
•Created by Ganbatte on 10/25/2024 in #help
Middleware Issues in Next.js Using Drizzle, Supabase, and NextAuth
9 replies
DTDrizzle Team
•Created by Ganbatte on 10/25/2024 in #help
Middleware Issues in Next.js Using Drizzle, Supabase, and NextAuth
i assume you have this
9 replies
DTDrizzle Team
•Created by Ganbatte on 10/25/2024 in #help
Middleware Issues in Next.js Using Drizzle, Supabase, and NextAuth
doesnt build normally tell you if something wont work in node edge runtime
9 replies