https://supabase.com/ logo
Join Discord
Powered by
# help
  • h

    HarryET

    10/14/2021, 7:58 PM
    And here is the next.js use of it:
    Copy code
    ts
    import { Provider as SupabaseProvider } from 'react-supabase';
    import { AuthProvider } from "components/authProvider";
    import { supabase } from "services/supabase";
    import React from 'react';
    
    const App = ({ Component, pageProps }) => {
      return (
          <SupabaseProvider value={supabase}>
            <AuthProvider>
              <Component {...pageProps} />
            </AuthProvider>
          </SupabaseProvider>
      )
    }
    
    export default App;
  • s

    shuckle

    10/14/2021, 8:55 PM
    Is there a way to do FKs in the dashboard? Just found it smh
  • h

    HarryET

    10/14/2021, 9:13 PM
    You could always search for issues. And the make one of you can't find it
  • l

    logikal

    10/14/2021, 10:04 PM
    Anyone been able to combine multiple
    contains
    filters?
  • l

    logikal

    10/14/2021, 10:05 PM
    I have combined, but they work as an
    and
    and I need it to work as an
    or
  • l

    logikal

    10/14/2021, 10:05 PM
    have opened this discussion: https://github.com/supabase/supabase/discussions/3540 with a bit more detail
  • u

    ulisses

    10/14/2021, 10:32 PM
    if I call the signUp function like this:
    Copy code
    js
    const {error} = supabase.auth.signUp({email, password}, {data: {account_type}})
    how do I get the data value in the backend?
  • h

    HarryET

    10/14/2021, 10:49 PM
    I believe it's stored in the auth.users table. To view it you need an external postgres client. Although it looks like the UI is starting to add support for multiple schemas
  • u

    ulisses

    10/14/2021, 10:54 PM
    Yes. Thanks for the information. I found it in the column
    raw_user_meta_data
  • h

    HarryET

    10/14/2021, 10:55 PM
    Awesome! Glad you got it working, have you got a trigger setup to automatically copy that to your own users table in the public schema? As the Auth schema is hard to work with if you use it as a foreign key
  • u

    ulisses

    10/14/2021, 10:57 PM
    Oh. That exactly how I was planning to use it (foreign key).
  • h

    HarryET

    10/14/2021, 10:58 PM
    I can get you an example from a project of mine if it helps? It uses a trigger so whenever a user signs up it makes a row in our own table that way it's easier to manage
  • u

    ulisses

    10/14/2021, 10:59 PM
    Isn't trigger in Alpha preview yet?
  • h

    HarryET

    10/14/2021, 10:59 PM
    Triggers are out fully afaik
  • h

    HarryET

    10/14/2021, 10:59 PM
    Also there just a feature of postgresql not a supabase implemented thing
  • u

    ulisses

    10/14/2021, 11:00 PM
    I would like to see your example project.
  • h

    HarryET

    10/14/2021, 11:02 PM
    Sure! https://github.com/HarryET/github-chat
  • h

    HarryET

    10/14/2021, 11:02 PM
    If you look in the database folder that has everything todo with our supabase!
  • c

    carlomigueldy.eth

    10/15/2021, 12:51 AM
    How do we write a RLS policy for
    auth.users
    table? For purposes of a demo account and I want to prevent from anyone who can access that to update the password.
  • k

    khacvy

    10/15/2021, 2:26 AM
    I haven't done it before but I think
    auth.users
    just like other tables, you can write the RLS normally.
  • m

    mikebarkmin

    10/15/2021, 6:02 AM
    I am trying to limit the file size a user can upload to a bucket. I thought it would be possible to use a RLS for that.
    Copy code
    sql
    (
      (bucket_id = 'avatars':: text)
      AND ((uid()):: text = split_part(name, '.':: text, 1))
      AND (((metadata ->> 'size':: text)):: integer <= 200000)
    )
    This is my attempt, but it does not work. This on the other hand does work:
    Copy code
    sql
    (
      (bucket_id = 'avatars':: text)
      AND ((uid()):: text = split_part(name, '.':: text, 1))
    )
    Is metadata not present, when inserting or updating an image? When I use the SQL console this query returns the correct objects, when uploading the files through the supabase web ui.
    Copy code
    sql
    SELECT * FROM storage.objects WHERE (((metadata ->> 'size':: text)):: integer <= 200000)
  • p

    philbookst

    10/15/2021, 9:10 AM
    hey how can i return multiple rows with a rpc call to a postgres function?
  • p

    philbookst

    10/15/2021, 9:22 AM
    do i have to wrap it to give me json data back like this? https://www.jeffreyknox.dev/blog/postgresql-functions-in-supabase/
  • d

    Deleted User

    10/15/2021, 11:24 AM
    Is there a way to implement 2FA for email/password login users?
    s
    • 2
    • 4
  • s

    silentworks

    10/15/2021, 12:09 PM
    2FA with email password
  • k

    kennethcassel

    10/15/2021, 1:54 PM
    does supabase have alerting based on metrics available? i.e. if my db CPU usage goes above 90% send me an email
  • x

    Xzeta

    10/15/2021, 3:01 PM
    does supabase automatically check if session expires?
  • x

    Xzeta

    10/15/2021, 3:02 PM
    or refresh
  • h

    Hal

    10/15/2021, 3:07 PM
    I have 2 tables 'user_public' and 'user_uploaded_contents'. Both have user_id column referencing user.id. How does the query looks like to join those 2 using supabase js? I've tried multiple ways but keep having 'could not find a relationship...'
  • h

    Hal

    10/15/2021, 3:08 PM
    yes it does and it automatically grants new session token if you use the supabase js
1...110111112...316Latest