https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • Nextjs Auth Helper Error
    s

    Shelby

    10/01/2022, 7:20 AM
    After wrapping nextjs auth helper tags on _app.js this error comes
    n
    • 2
    • 8
  • can you self host from supabase cli (local development)?
    t

    Thoth Trismegistus

    10/01/2022, 7:58 AM
    can you self host a supabase project that you build using the supabase cli?
  • Do Supabase DB queries work in the Edge?
    c

    Cory

    10/01/2022, 8:12 AM
    If I run a DB query in the edge via Netlify, will it still be able to run?
    g
    • 2
    • 2
  • Helper postgres function `safe_auth_json`
    c

    CanRau

    10/01/2022, 1:06 PM
    I was trying to make a helper function to convert a
    auth.users
    row to json stripping away sensitive data. Using just
    row_to_json
    within the trigger function works perfectly fine. It would just make things "cleaner" and I'd especially like to understand why I don't get it working 😅 Following a few versions I tried, probably not all versions, though all error trying them in the Dashboards SQL Editor
    Copy code
    sql
    CREATE FUNCTION safe_json(_row json)
      RETURNS json
    AS $$
      BEGIN
      RETURN row_to_json(_row)::jsonb-ARRAY['encrypted_password', 'confirmation_token', 'recovery_token', 'phone_change_token', 'email_change_token_new', 'reauthentication_token', 'email_change_token_current'];
      END;
    $$ LANGUAGE plpgsql;
    Copy code
    sql
    CREATE OR REPLACE FUNCTION safe_auth_json(_row auth.users)
      RETURNS json
    AS $$
      SELECT row_to_json(_row)::jsonb-ARRAY['encrypted_password', 'confirmation_token', 'recovery_token', 'phone_change_token', 'email_change_token_new', 'reauthentication_token', 'email_change_token_current'];
    $$ LANGUAGE sql;
    Copy code
    sql
    CREATE OR REPLACE FUNCTION safe_auth_json(_row auth.users)
      RETURNS json
    AS $$
      SELECT row_to_json(*)::jsonb-ARRAY['encrypted_password', 'confirmation_token', 'recovery_token', 'phone_change_token', 'email_change_token_new', 'reauthentication_token', 'email_change_token_current'] FROM _row;
    $$ LANGUAGE sql;
    Copy code
    sql
    CREATE OR REPLACE FUNCTION safe_auth_json(_row auth.users)
      RETURNS json
    AS $$
      SELECT row_to_json(_row)::jsonb-ARRAY['encrypted_password', 'confirmation_token', 'recovery_token', 'phone_change_token', 'email_change_token_new', 'reauthentication_token', 'email_change_token_current'];
    $$ LANGUAGE sql;
    j
    • 2
    • 4
  • Trying to insert in bulk fails if one of the items already exists
    h

    HunterAndersonX

    10/01/2022, 1:15 PM
    I'm trying to create an entry if one like it doesn't already exist (i.e. if there's no UNIQUE conflict). I want to do this in bulk (it's for inviting users to a project) but if any of the rows conflicts, the whole op fails. I tried using
    .insert(payload)
    as well as
    .upsert(payload, {ignoreDuplicates: true})
    and both had the same issue... I'm using supabase-js (with Next.js)
    j
    • 2
    • 11
  • Clarification of Realtime PG Changes Filter Syntax
    i

    ixxie

    10/01/2022, 1:58 PM
    Is the
    filter
    argument described in the guide page [1] would seem to follow the syntax of the
    .or
    filter [2] but in the API reference for RC2 it seems to reference the
    event
    argument instead. Can you confirm the correct syntax for the this parameter? [1] https://supabase.com/docs/guides/realtime/postgres-changes [2] https://supabase.com/docs/reference/javascript/next/or [3] https://supabase.com/docs/reference/javascript/next/subscribe
    g
    • 2
    • 7
  • how to have an array of foreign keys (one to many relationship)?
    t

    Thoth Trismegistus

    10/01/2022, 2:19 PM
    I have these 2 tables setup: room: -id groups: -id -members (I want to make this an array of foreign keys pointing to users table) A room can have multiple groups. and a group can have multiple users.
    p
    j
    • 3
    • 11
  • Problems with Supabase SDK, error 400 on DB Fetch.
    h

    Heitor Ramon (Vue Storefront)

    10/01/2022, 2:53 PM
    I'm developing an app with Supabase, and trying to use the JS SDK to fetch some information from the DB. When the app first run I got no problems at all, but when I refresh I always get
    FetchError: Request with GET/HEAD method cannot have body
    My code:
    Copy code
    js
     await DiscordMessage.select(baseCols, {
            count: 'exact',
          }).gte('created_at', (() => startOfToday().toISOString())());
    I dont know why this is happening :/
    g
    • 2
    • 11
  • Upgrade TimeScaleDB to Community edition
    d

    Denis_

    10/01/2022, 8:17 PM
    Hey! I installed TimescaleDB extension using web UI, however, I would like to upgrade to community edition since it enables more features I need. Is that possible while hosting on Supabase? Thanks!
    g
    • 2
    • 1
  • Can't use auth.uid() inside functions
    k

    Kornel

    10/01/2022, 9:31 PM
    Hey guys, I can promise you I could used
    auth.uid()
    and
    auth.email()
    inside my PostgreSQL functions like over a week ago. That's how I wrote my
    delete_user
    which I use with
    .rpc()
    from code:
    Copy code
    sql
    begin
    raise log 'auth.uid(): %', auth.uid();
    delete from auth.users where id = auth.uid();
    end;
    But now I noticed I can't delete my users anymore and I can see from logs the reason is that
    auth.uid()
    returns me
    <NULL>
    . It doesn't matter whether I do
    SECURITY DEFINER
    or
    SECURITY INVOKER
    for my func.
    auth.email()
    doesn't work as well. Did something happen over this week?
    j
    g
    • 3
    • 22
  • super new to supabase and BaaS as a whole
    b

    bennypc

    10/01/2022, 10:59 PM
    hi guys, i currently have a personal website that id like to link up with supabase but im not sure how, could anyone help?
    j
    • 2
    • 1
  • Are there any best practices for when writing a function that you know will be queried many times?
    o

    oski啦

    10/01/2022, 11:07 PM
    Are there any best practices for when writing a function that you know will be queried many times? Like for counting views/like button?
    n
    j
    g
    • 4
    • 9
  • Update Impacts Too Many Records
    k

    kavla

    10/01/2022, 11:11 PM
    Seeing an
    update impacts too many records
    when I try to trigger a mutation that changes multiple rows. I know I've got to be holding it wrong. What am I missing here? Both senderId and recipientId are definitely set correctly
    Copy code
    mutation RequestAllTools($senderId: UUID!, $recipientId: UUID!) {
      updateToolsV2Collection(
        filter: { state: { eq: "ACTIVE" }, senderId: { eq: $senderId } }
        set: { state: "REQUESTED", recipientId: $recipientId }
      ) {
        __typename
      }
    }
    j
    g
    • 3
    • 5
  • How to fetch with 2.0.0-rc.10 and Typescript
    u

    user8923

    10/01/2022, 11:54 PM
    Typescript is barking at me when trying to fetch data with 2.0.0-rc.10 as follows:
    Copy code
    const response = await supabase
                .from<Task>("tasks")
                .select("*");
    I get a "No overload expects 1 type arguments, but overloads do exist that expect either 0 or 2 type arguments." error. I can't figure out what it's expecting as a second generic type parameter. Thanks!
    n
    j
    +3
    • 6
    • 9
  • Can you use the .gt() or .lt() filter for timez type columns?
    k

    konga

    10/02/2022, 1:44 AM
    I have been trying to filter by .gt() and .lt() on a column that is of type timez and it hasn't been working. Is it possible?
    g
    • 2
    • 1
  • How to sign a user in using a QR Code?
    h

    Homemadesteam58

    10/02/2022, 2:03 AM
    I am trying to sign users into my app using a QR Code. Previously, we would encode the email and password in the QR Code. My app would then fetch those credentials and use them to log in. I am trying to make this process more secure, but I want to keep the simplicity of the QR code sign in. Does anyone know of a way to do this? I was wondering if an OTP system would work, but supabase doesn't have the ability to create an OTP and then display that in the app.
    s
    m
    g
    • 4
    • 21
  • upload() upsert option
    t

    timmy

    10/02/2022, 6:54 AM
    I want to overwrite images with the same filename in my bucket. I am using upsert: true, which claims it will update it if true. Unfortunately this is not accomplished.
    j
    g
    v
    • 4
    • 26
  • RAW_USER_META_DATA
    n

    NanoBit

    10/02/2022, 8:22 AM
    You can create a trigger On Insert/Update to the auth.users to insert/update the public.profile
    s
    j
    • 3
    • 4
  • Database error saving new user
    s

    silentworks

    10/02/2022, 12:42 PM
    Do you have a trigger setup in your database? normally this is caused by a trigger requirements not being met. Go to https://app.supabase.com/project/_/database/triggers and check if you have a trigger on the auth schema and get back to me.
    h
    b
    • 3
    • 3
  • Find rows that aren't linked to another join table (Supabase js)
    u

    매튜

    10/02/2022, 9:23 AM
    Hello I have two tables and am pulling data from table 1, but I only want to pull rows that aren't joined to table 2. Has anyone done this in supabase js before?
    s
    • 2
    • 1
  • How do you handle language servers in a supabase project?
    s

    semipiccolo

    10/02/2022, 10:34 AM
    As supabase uses deno for edge functions this poses a challenge for LSP configuration. The typescript files for the edge functions should use the deno language server whereas the other typescript files (at least in my case) should use the regular typescript language server. I'm using neovim and I'm getting deno errors in files that don't really use deno and vice versa. VSCode seems to by default only use denols on all the ts files so this is not a neovim specific problem apparently. Any advice on how to handle this?
    o
    • 2
    • 14
  • Can I call edge with a HTTP Request webhook?
    v

    VWL Tobias Hassebrock

    10/02/2022, 11:10 AM
    Since Supabase webhooks do not support calling supabase edge functions directly, can I call them with a HTTP request? In case yes, how do I do that? In case no, are there any news on calling supabase edge functions through webhooks or is there a differnt approach to trigger edge functions on database inserts? https://supabase.com/blog/supabase-functions-updates#database-webhooks-alpha
    m
    • 2
    • 13
  • Deleting cache when deleting file
    s

    Sebb

    10/02/2022, 11:25 AM
    Hey! Is there a way to delete the file cache instantly when deleting a file with
    from.remove()
    . Thanks in advance!
    g
    • 2
    • 2
  • Return data on insert
    r

    rlee128

    10/02/2022, 2:59 PM
    Is there anyway to get the row id back after an insert? I am using supabase_flutter 1.0.0-dev.9
    j
    • 2
    • 2
  • image not updating
    t

    timmy

    10/02/2022, 4:42 PM
    I am updating an image via my app, that change is reflected in the supabase ui— correct modified timestamp and image priview. when I click "copy url" it goes to the old image. this is reflected on my front end as well with
    getPublicUrl()
    video of issue attached
    screen-recording-2022-10-02-at-11-42-35-am
    g
    • 2
    • 3
  • Can you add metadata to a user that is signing up with email OTP?
    v

    Vik

    10/02/2022, 5:57 PM
    As the title says, I'm currently trying to add a field to users who sign up. When I added
    options
    to the
    signInWithOtp
    function, instead of getting a OTP email I got a confirm email link. Is this currently not possible in V2?
    Copy code
    const handleSignIn = async (email: string) => {
        setLoading(true);
        const { error } = await supabase.auth.signInWithOtp({
          email: email,
          options: {
            data: {
              onboarded: false,
            },
          },
        });
    g
    • 2
    • 21
  • Free vs Pro pricing - Consumption pricing models
    m

    michmich112

    10/02/2022, 6:44 PM
    Hi there, I have more than 2 projects (+/- 4 right now) I'd like to have running but I wouldn't need all the added scale of the Pro plan. I would also turn them off/pause them often. How can i do this without paying 25$/month per new project :/ is there a way to have consumption based pricing and scale the projects from the free tier feature as need be? Thank you for your help with this
    g
    • 2
    • 1
  • Coumpound filters
    j

    Julien

    10/02/2022, 9:14 PM
    I have a page where I'm using paged data and I would like my users to be able to filter the data as they wish. Is it possible to have complex logic to conditions like this page shows: https://postgrest.org/en/stable/api.html#logical-operators ?
    g
    • 2
    • 11
  • Use connection pooling with supabase-js
    z

    zander

    10/02/2022, 9:35 PM
    Is it possible to use connection pooling with supabase-js? Does it do it already? Or would I need to connect directly to the db using the connection string?
    g
    • 2
    • 2
  • Updating a field and unable to do so!
    b

    besimon

    10/02/2022, 10:42 PM
    I am trying to update an entry in a table and whenever I run the PATCH request, it returns the following:
    "Error in $: string at 'name=Updated'"
    s
    j
    • 3
    • 7
1...363738...230Latest