Hey guys, i would like to return the number of fil...
# javascript
b
Hey guys, i would like to return the number of files that a user has on storage, can i query the storage schema through the sdk?
g
Probably yes, but you would have to init the client with that schema and a client can only access one schema at a time. Default is public. I would use an rpc function to do it.
b
great, another question, lets say i need to use the logged in user inside the query of this new RPC, i would probably use auth.uid(), is there any way i could mock its value for debugging purposes?
yeah, just found out you can create consts, dont worry
g
Using auth.uid() is the way to go so then you don't have to worry about it being a parameter the client could change.
b
but that creates another interesting question, lets say i need to login as a specific user to debug my app, is that possible somehow?
manually update the jwt payload and use it on the sdk?
g
Not sure how that is different than RLS. You could have a fake jwt you make with a long expiration time then use it.
b
makes sense
thank you for the help gary!