How can I read rows on JavaScript? I'm not good at...
# javascript
t
How can I read rows on JavaScript? I'm not good at Javascript. I don't think this might help, but I will write my source code down.
Copy code
const username = async () => {
    return await supabase.from('users').select('username').eq('id', user?.id)
}
s
Yes that code should read the row, but you don't want to be allowing users to pass that
user.id
down, you should rather use a row level security policy to get things like this working. Also please take a look at the Supabase guides to learn a bit more about how to use the JavaScript library, the guides for JavaScript are really good.
t
Thanks for your advice.