https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • yjs, y-websocket
    b

    bhaskar

    10/24/2022, 12:10 AM
    i am trying to implement real time collaborative editor with yjs and y-websocket. is there anyway we could integrate supabase realtime broadcast with it? or just use supabase realtime with yjs provider?
  • partial string matching
    d

    draco

    10/24/2022, 12:46 AM
    Using supabase js. How do you partial matches on a column value. For example I want to find any rows where a column named “player” has a partial value of “gra”. This would match multiple rows with the values of “grad”, “Graham”, “gRate” Is this possible? I figure maybe using a regular expression but so far I have struck out. I have tried using textSearch(), like(), and contains() Let me know if anyone has any ideas.
    g
    • 2
    • 4
  • relation does not exist
    s

    smahs

    10/24/2022, 12:53 AM
    I created a new table called
    promo_waitlist
    , but when querying it, I get the error:
    relation "promo_waitlist" does not exist
    . I can, however, query the
    users
    table that existed before
    promo_waitlist
    was created.
    g
    • 2
    • 2
  • Still trying to send emails from SQL via Sendgrid
    a

    AlanK

    10/24/2022, 2:38 AM
    I have tested that I can send an email using the following cURL command:
    Copy code
    curl --request POST \
      --url https://api.sendgrid.com/v3/mail/send \
      --header "Authorization: Bearer <somekey>" \
      --header 'Content-Type: application/json' \
      --data '{"personalizations": [{"to": [{"email": "address@email.com.au"}]}],"from": {"email": "address@outlook.com"},"subject": "Sending with SendGrid is Fun","content": [{"type": "text/plain", "value": "and easy to do anywhere, even with cURL"}]}'
    and am now trying to translate this into SQL. Can anyone give me some pointers on how to restructure this to use in a SQL http request? So far I ahave this
    Copy code
    SELECT content::json
      FROM http((
              'POST',
               'https://api.sendgrid.com/v3/mail/send',
               ARRAY[http_header('Authorization','Bearer <somekey>'), http_header('Content-Type: application/json')],
               NULL,
               NULL
            )::http_request)
    g
    • 2
    • 4
  • export csv
    l

    londonparis

    10/24/2022, 3:54 AM
    Hi, how can I export the CSVs of the data on a paused project without restoring the project?
    g
    • 2
    • 3
  • OnSubmit for AuthUI component?
    a

    Austin

    10/24/2022, 5:19 AM
    Is there a way to setup a custom onSubmit action for this built-in component by chance?
    s
    • 2
    • 3
  • Create new table on row insert
    r

    robh

    10/24/2022, 5:23 AM
    Hi All. I would like to automatically create a new database table when a row is added to one of db tables. For example, if I have a table that stores basic city information (one column being city_name), I would like to automatically create a new table (called city_name) when a new city is added. I would like to do this with a database trigger if possible. Any help would be greatly appreciated. Thanks Rob
    s
    • 2
    • 4
  • The recommended way to transfer a database from one account to another
    o

    omar

    10/24/2022, 6:31 AM
    Hey all, I have been working on a client project and didn't realize I could not add them as a user to the project on the free tier nor transfer the project to their supabase account. How do I transfer a supabase DB from one account to another including all tables, functions, hooks and storage objects?
    s
    • 2
    • 1
  • can you reverse engineer the supabase database columns from code in a repo?
    l

    londonparis

    10/24/2022, 6:51 AM
    ie, figure out what tables and columns there were
    s
    • 2
    • 1
  • Supabase team roles
    j

    jaypinho

    10/24/2022, 7:50 AM
    Hi, I couldn't figure out a way to set up a developer role in my Supabase org team that has read-only database access. Is this possible?
    s
    • 2
    • 2
  • For Oauth auth, How can I get the search params from the redirect url?
    j

    jaynguyens

    10/24/2022, 8:08 AM
    I need to get the search params from the redirect url but not sure how can I get that, or can we replace supabase.io redirect url to one of our own?
    • 1
    • 1
  • String escaping in supabase-js filters
    n

    NED

    10/24/2022, 8:26 AM
    Hi! What recommendations would you give for escaping a string when using the
    or
    operator. Example
    .or(created_by.eq.${ authorisedUserId },visibility.cs.{${ ['all'] }})
    Where authorisedUserId can contain any characters.
    s
    b
    g
    • 4
    • 5
  • Allow CRUD for all auth users
    t

    TARS

    10/24/2022, 9:40 AM
    Hello, I'm making an admin app where the user just needs to be authenticated to be able to access a table. And of course the only way to get a user is to be invited directly through supabase. This is the policy I'm using:
    Copy code
    CREATE POLICY "Enable CRUD for authenticated users only" ON "public"."hosts"
    AS PERMISSIVE FOR ALL
    TO authenticated
    
    WITH CHECK (true)
    But it's not working, I can't fetch any data when I am logged in as a user. Please point me in the right direction.
    g
    • 2
    • 4
  • How to set proper URL and KEY when serving edge functions locally
    h

    Highgate

    10/24/2022, 11:33 AM
    I can't seem to understand how to connect to supabase without hardcoding values inside the function. When I log SUPABASE_URL inside the function it yields
    http://supabase_kong_Projects:8000
    . Obviously I want to set this to my account so I can get actual data. It works fine when deployed to supabase.
    n
    • 2
    • 1
  • is it not possible to do auth only serverside with nextjs?
    c

    Captain

    10/24/2022, 1:41 PM
    when is do auth with the frontend the page flikkers and the v2 of supabase is super hit and mis. what would go wrong if i set cookies in the api route?
    s
    • 2
    • 1
  • How can I rename the variable when I select a table?
    g

    garyaustin

    10/24/2022, 2:49 PM
    const {data:data1,error:error1} = await.....
    s
    • 2
    • 2
  • Get error code for authentication errors
    j

    jaf

    10/24/2022, 2:19 PM
    Is there a way to get the error code? Right now I'm checking for the error message string, which I guess could change at any moment, if someone decides to do so.
    Copy code
    javascript
    AuthApiError: User already registered
        at /home/.../node_modules/@supabase/gotrue-js/dist/main/lib/fetch.js:41:20
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
      __isAuthError: true,
      status: 400
    }
    s
    d
    • 3
    • 8
  • Super Noob - went from Heroku to Supbase Postgres - now facing timeout and pgbouncer cannot connect
    b

    BenzelWashington

    10/24/2022, 2:46 PM
    Hello GM, I am justing running a code that was working fine with the postgres from heroku but then without an changes from myside it was getting timeout errors so I swapped to supabase and now I cannot even get the bot online. sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "db.lmwonppsevbmkttutzow.supabase.co" (54.176.67.63), port 6543 failed: FATAL: query_wait_timeout connection to server at "db.lmwonppsevbmkttutzow.supabase.co" (54.176.67.63), port 6543 failed: FATAL: pgbouncer cannot connect to server PLS HALP
    s
    n
    • 3
    • 34
  • Gmail phishing alert
    j

    jaf

    10/24/2022, 2:50 PM
    Link is still not clickable after whitelisting. I assume I can configure the email service and sender?
    s
    g
    • 3
    • 5
  • AuthApiError Internal server error
    f

    floyare

    10/24/2022, 2:56 PM
    So I updated supabase-js from version
    1.35.7
    to
    2.0.4
    and after trying to get user data by
    getUser()
    I receive error message with value of "AuthApiError Internal server error". I looked up to auth logs in supabase dashboard and found this error log:
    Copy code
    {
      "component": "api",
      "error": "invalid claim: subject missing",
      "level": "error",
      "method": "GET",
      "msg": "Unhandled server error: invalid claim: subject missing",
      "path": "/user",
      "referer": "http://localhost:3000/",
      "remote_addr": "MY_IP",
      "time": "2022-10-24T14:52:21Z",
      "timestamp": "2022-10-24T14:52:21Z"
    }
    . Anybody have an idea how to fix it?
    s
    • 2
    • 2
  • Measure local instance performance
    a

    avalanche

    10/24/2022, 3:58 PM
    Is there any way to see some stats like average response time or response time per request on local Supabase instance?
  • Adding Supabase Vault Secrets extension to local development
    d

    drewbie

    10/24/2022, 4:37 PM
    Added an issue on GitHub and wanted to check here if anyone had any suggestions on how to get this to work. I am trying to enable Supabase Vault secrets locally but the extension is not available in a local development setup. It would nice to be able to enable this extension locally and have it installed via a migration, so that any further database code that relies on the vault secrets would have them available. The extension is also not visible on the Supabase Studio UI in local development. Any help is appreciated!! https://github.com/supabase/vault/issues/2
  • What is the best way to generate unique ID for entries?
    c

    Cory

    10/24/2022, 5:20 PM
    I need a unique ID set for each new row. Is it better to use something like short-key plugin to replace the primary key. Or should I just make a unique key for every column and check for duplicates?
    s
    • 2
    • 8
  • Auth and calls on behalf using Twitter
    f

    fernandops26

    10/24/2022, 6:05 PM
    Hi guys, after this update to v2, exist any documentation to take advantage of the logged twitter user using supabase, to make calls on behalf?
    s
    • 2
    • 2
  • Can I reset a remote supabase instance with the cli?
    v

    VWL Tobias Hassebrock

    10/24/2022, 6:18 PM
    I have a local folder with migrations. Can I reset the remote database with the cli to mirror the migrations folder? supabase db push creates an error
    supabase_migrations.schema_migrations table conflicts with the contents of supabase/migrations.;
    . Something like supabase db remote reset?
    • 1
    • 4
  • Using SQL to get information about a file in a storage bucket
    n

    niyogi

    10/24/2022, 9:13 PM
    I am able to get a list of buckets using SQL but i'm more interested in being able to use SQL to list files in a bucket and then get information about a file (public URL) that is in a bucket. Is the SQL Editor in Supabase capable of doing this? Thanks!
    g
    • 2
    • 1
  • supabase v2 fails to retrieve type definitions
    l

    Lukas V

    10/24/2022, 10:48 PM
    I am trying to get some data from my
    products
    collection, but the return type is:
    Copy code
    const data: any[] | null
    instead of the type that I gave in my
    Database
    type, why is that? here is the code:
    Copy code
    import type { Database } from 'types_db';
    
    export const supabase = createBrowserSupabaseClient<Database>();
    
    export const getActiveProductsWithPrices = async (): Promise<
      ProductWithPrice[]
    > => {
      const { data, error } = await supabase
        .from('products')
        .select('*, prices(*)')
    Can someone please confirm, that this is a bug?
  • REALTIME access token has expired
    g

    GemCollector — Never DMs You

    10/25/2022, 12:43 AM
    Getting thousands of errors a second from realtime saying the access token has expired. No data is showing up on the frontend. What could this be?
    g
    • 2
    • 12
  • how can you view db functions from different schema?
    c

    Cory

    10/25/2022, 12:56 AM
    I made some DB functions under the schema, extensions, and they do not appear under "public" and there is no way to switch
    g
    • 2
    • 5
  • Allowing users to view their own data
    a

    Austin

    10/25/2022, 1:03 AM
    Hey everyone. Frontend dev has been kicking my butt, and I have a quick question: I have RLS enabled for one of my tables with the notion that a user should only be able to view their own bills. I have a user_id foreign key on my table, and this works just fine in postman utilizing the users bearer token. My question is: How do I configure this on my getServerSideProps function if I can't pass in hooks (session, user_id, etc.)?
    Copy code
    export async function getServerSideProps() {
      const { data: bills } = await supabase
        .from('bills')
        .select(`name, amount`)
        .eq('paid', false)
    
      return {
        props: {
          bills,
        },
      };
    }
    I get an empty array back each time.
    d
    • 2
    • 8
1...525354...230Latest