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

    Kellen Mace

    09/21/2021, 11:06 AM
    rule_channels
  • k

    Kellen Mace

    09/21/2021, 11:06 AM
    I can query for
    rules
    and get data about the
    channels
    related to them without a problem, using this syntax:
    Copy code
    js
    const response = await supabase
      .from('rules')
      .select(`
        id,
        words,
        rule_channels:channels( title, thumbnail_url )
      `);
  • k

    Kellen Mace

    09/21/2021, 11:07 AM
    As soon as I create a
    mentions
    DB table that has a column with a foreign key to the
    rule
    table's
    id
    column however, the query above begins throwing an error. The message prompts me to disambiguate the request:
  • k

    Kellen Mace

    09/21/2021, 11:07 AM
    It's still not clear to me how I need to modify my query, though.
  • k

    Kellen Mace

    09/21/2021, 11:07 AM
    Can anybody help me with that?
  • k

    Kellen Mace

    09/21/2021, 11:07 AM
    Thanks in advance for any tips you can provide! πŸ™Œ
  • t

    Tessellated

    09/21/2021, 11:19 AM
    https://postgrest.org/en/v8.0/api.html#embedding-disambiguation hope this helps
  • u

    user

    09/21/2021, 11:43 AM
    sucks, i am in the same case and allowing to create accounts for any provider through custom tokens would be awesome
  • u

    user

    09/21/2021, 11:44 AM
    isn't there anything new on that end ?
  • k

    Kellen Mace

    09/21/2021, 11:53 AM
    I’ve read through these docs several times. All the examples shown are GET request query string parameters or SQL queries. Do you know how I can disambiguate the request via the JavaScript client? It’s not clear to me how I need to modify my query.
  • p

    patrik

    09/21/2021, 2:14 PM
    Dooes magic link also support the redirect url? I can't figure out setting up the
    Site URL
    and
    Additional Redirect URLs
    so it works both on localhost and live. Anybody knows how to do that?
    Copy code
    const { user, session, error } = await supabase.auth.signIn({
      provider: 'github'
    }, {
      redirectTo: 'https://example.com/welcome'
    })
    s
    • 2
    • 3
  • t

    Tessellated

    09/21/2021, 2:19 PM
    guess you'll have to join rule_channels first - id,words,rule_channels(channels(title, thumbnail_url))
  • t

    Tessellated

    09/21/2021, 2:20 PM
    i don't see another way since original 'rules' table got no fk on channels in the first place
  • g

    GandalfG

    09/21/2021, 2:25 PM
    Hi folks! Quick question for all the members here. What is the most annoying thing when learning how to code online? πŸ±β€πŸ’»
  • m

    Mattias

    09/21/2021, 2:38 PM
    Error when calling stored procedure
    t
    • 2
    • 3
  • p

    petrlr14

    09/21/2021, 3:44 PM
    Hey there! Does any of you ever had a problem with a table policy like (uid() = user_id) only on server side? It works on client side but returns empty on server side. I think I'm missing something here but I can't figure out what. Here's the code:
    Copy code
    typescript
    export const getAllBoards = async () => {
      const { data, error } = await supabase.from<BoardType>('board').select('*');
      if (error) {
        console.log(error);
        return [];
      }
      return data;
    };
    And here's my
    getServerSideProps
    Copy code
    typescript
    export const getServerSideProps: GetServerSideProps = async (context) => {
      const { user } = await supabase.auth.api.getUserByCookie(context.req);
      if (user) {
        const boards = await getAllBoards();
        return {
          props: {
            _boards: boards,
          },
        };
      }
      return {
        props: {
          _boards: [],
        },
      };
    };
    s
    • 2
    • 2
  • s

    silentworks

    09/21/2021, 3:59 PM
    RedirectTo when using magic link
  • m

    Marky

    09/21/2021, 4:57 PM
    Has anyone successfully used pgdump to backup supabase? I am getting error unable to backup sequences using postgres user
    Copy code
    pg_dump: error: query failed: ERROR:  permission denied for sequence refresh_tokens_id_seq
    pg_dump: error: query was: SELECT last_value, is_called FROM auth.refresh_tokens_id_seq
  • s

    Scott P

    09/21/2021, 5:19 PM
    The postgres user isn't a superadmin on recent projects, so it can't do many things with the auth table
  • m

    Marky

    09/21/2021, 5:28 PM
    How do you go about backing up the entire db?
  • i

    ivanq3w

    09/21/2021, 7:20 PM
    How can we select all fields, and resolve all relationships?
    Copy code
    NOT supabase.from('posts').select('*, author(*), publisher(*)')
    LIKE THIS supabase.from('posts').select('*, *')
  • m

    Marky

    09/21/2021, 11:38 PM
    Doesn't seem support knows either.
  • m

    Miguel2390d

    09/22/2021, 1:42 AM
    Delete method doesn't seem to be working at all
  • m

    Miguel2390d

    09/22/2021, 1:42 AM
    Gives a 200 and returns the element that should be deleted, but it doesn't
  • m

    Miguel2390d

    09/22/2021, 2:06 AM
    Nevermind, needed to add a policy
  • m

    Miguel2390d

    09/22/2021, 2:06 AM
    It didn't give me errors though
  • m

    Marky

    09/22/2021, 4:36 AM
    Is there anyway to do a backup or is that impossible now?
  • j

    jason-lynx

    09/22/2021, 5:12 AM
    this might be tedious but for now, I think you can manually grant permission on that sequence to
    postgres
    via the SQL editor so that error doesn't occur (same for subsequent permission errors on any db objects). you might wanna remove them again after
  • j

    jason-lynx

    09/22/2021, 5:13 AM
    another alternative is of course to upgrade to a pro plan
  • m

    Marky

    09/22/2021, 5:31 AM
    Pro or not I would want my own back ups.
1...929394...316Latest