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

    Bicijay

    04/02/2022, 5:37 PM
    Hey guys, im trying to use a lib from Expo, which can upload files to a URL in the background, but it only accepts an endpoint using POST. Is there any way i could upload a file to supabase storage via URL and not the supabase client?
    n
    s
    g
    • 4
    • 9
  • j

    joshcowan25

    04/02/2022, 7:17 PM
    When building you DB, do you use the JSONB type or do you simply use Text? Why use JSONB? What is the difference with JSON?
    n
    s
    s
    • 4
    • 5
  • l

    laznic

    04/02/2022, 7:35 PM
    Is there a way to query if authenticated user satisfies the RLS checks without sending any data? As in, a way to first check permissions e.g. for INSERT, and then later send the data when user is ready to do so.
    n
    g
    s
    • 4
    • 11
  • d

    DanMossa

    04/02/2022, 9:28 PM
    I've made a few PRs. How do I get the contributor role as well as XP for it?
    n
    s
    • 3
    • 4
  • t

    The Noah

    04/03/2022, 1:08 AM
    I've been using Supabase as my database, but am now moving auth from Auth0 over to Supabase Auth. It's been going fairly smoothly, however I've now run into a roadblock. I'm using SvelteKit and all Supabase code is server-side. When a user signs in, their access token is stored in a cookie and read in
    src/hooks.ts
    . The user data is correctly fetched using
    supabase.auth.api.getUser(accessToken)
    . The issue comes in when I try to query my
    profiles
    table. I query it by the user's
    id
    . The
    profiles
    table
    id
    column is related to the
    auth.users
    id
    column. Everything properly matches, but the query returns nothing. This is where things start getting strange. I have a
    profiles.ts
    file with helper functions which is what I use to call to Supabase. If I edit this file, SvelteKit hot reloads and the function then returns data as it should. However, just reloading the page does not make it return properly. As a sanity check I made it return the entire table instead of just the correct user, and it just returns an empty array. I don't think I've ever run into an error quite like this, any help would be much appreciated.
    n
    g
    +3
    • 6
    • 84
  • j

    jdgamble555

    04/03/2022, 1:20 AM
    How do I use the
    exists
    function like
    select exists(select 1 from contact where id=12)
    in supabase?
    n
    g
    b
    • 4
    • 31
  • s

    samΓΌel

    04/03/2022, 1:22 AM
    I've been trying to get the
    pg_graphql
    functionality up over the last two days, but for some reason tables are not registering in the gql schema. https://github.com/supabase/supabase/discussions/6262 I've detailed most of my current troubleshooting steps here, but thought it might be worth checking here as well. 1. Fresh project with
    pg_graphql
    enabled. 2. Table
    countries
    created via the dashboard on the
    public
    schema. 3. No
    countries
    showing in gql schema.
    Copy code
    json
    {
        "data": {
            "__schema": {
                "queryType": {
                    "name": "Query"
                },
                "directives": [],
                "mutationType": null,
                "subscriptionType": null
            }
        },
        "errors": []
    }
    n
    • 2
    • 1
  • j

    jdgamble555

    04/03/2022, 3:16 AM
    Is it possible to access the auth.users table publicly? I would like the email and created_at to be public data...
    n
    t
    s
    • 4
    • 10
  • a

    ak4zh

    04/03/2022, 4:14 AM
    Copy code
    bash
    keeplearning@pop-os:~/CodeProjects/test-edge$ supabase functions deploy hello-world
    Error: Platform linux/386 is currently unsupported for Functions.
    Unable to deploy edge functions.
    n
    g
    • 3
    • 7
  • a

    Ape R Us

    04/03/2022, 7:20 AM
    hey everyone, im practicing authentication at the moment with sveltekit RLS is on one of the issues im having is after i log out, and i sign in with another email, i can see the info from the previous session and when i hard refresh, then i see the correct data. Im not sure how to fix this in my store
    Copy code
    export const user = readable(null, (set) => {
        set(supabase.auth.user());
        const unsubscribe = supabase.auth.onAuthStateChange((_, session) => {
            session ? set(session.user) : set(null);
        });
        return () => {
            unsubscribe.data.unsubscribe();
        };
    });
    n
    • 2
    • 2
  • h

    hero76

    04/03/2022, 8:11 AM
    hi
    n
    • 2
    • 1
  • h

    hero76

    04/03/2022, 8:12 AM
    using rpc i keep getting this error yet using direct sql this works just fine
    n
    • 2
    • 1
  • h

    hero76

    04/03/2022, 8:13 AM
    {"hint":"No function matches the given name and argument types. You might need t o add explicit type casts.","details":null,"code":"42883","message":"function st _astext(extensions.geography) does not exist"}
    n
    g
    • 3
    • 3
  • n

    Needle

    04/03/2022, 11:22 AM
    Hello @theuknowner! This thread has been automatically created from your message in #843999948717555735 a ``few seconds ago``. Pinging @User so that they see this as well! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ... menu) and select Leave Thread to unsubscribe from future updates. Want to change the title? Use the
    /title
    command! We have solved your problem? Click the button below to archive it.
  • n

    Needle

    04/03/2022, 1:31 PM
    Hello @lavenderlav! This thread has been automatically created from your message in #843999948717555735 a ``few seconds ago``. Pinging @User so that they see this as well! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ... menu) and select Leave Thread to unsubscribe from future updates. Want to change the title? Use the
    /title
    command! We have solved your problem? Click the button below to archive it.
    g
    • 2
    • 2
  • g

    GuardianXT705

    04/03/2022, 2:04 PM
    I guys, maybe a stupid question but I don't want to have the option for a magic link. But I can't find any settings to turn it off. My auth sign is already set on email and password. But whenever the password is empty it still sends the user a magic link
    n
    g
    • 3
    • 4
  • p

    pocin

    04/03/2022, 2:43 PM
    Trying to understand supabase-cli migrations. Is there a way to start supabase without running existing migrations? I would like to keep a file with the whole schema [big sql file] around (so i can quickly inspect it). When making changes to database schema i have two options 1) hand written migration 2) change the full schema [big sql file] 2.1) run
    psql -f schema.sql
    against freshly started supabase instance 2.2) run a
    supabase db changes
    with 2.1 against a supabase with all existing migrations to get a diff 2.3) (check diff + update where necessary) apply diff to production to end up with a same state as in 2.1 currently when you run
    supabase start
    it seems to run all existing migrations so i can't easily execute 2.1) and i have to essentially hand write my migrations. Or is the intended workflow the other way around and i should not maintain a hand written
    schema.sql
    but instead do
    pg_dump
    of the final database to get it? But this would still mean i have to hand write migrations or do manual changes to the database (i prefer to do it in code).
    n
    • 2
    • 2
  • n

    Needle

    04/03/2022, 3:02 PM
    Hello ! This thread has been automatically created from your message in a ``few seconds ago``. Pinging @User so that they see this as well! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ... menu) and select Leave Thread to unsubscribe from future updates. Want to change the title? Use the
    /title
    command! We have solved your problem? Click the button below to archive it.
    s
    • 2
    • 2
  • a

    Aruzo

    04/03/2022, 3:27 PM
    How can I make author_id field auto filling based on logged user?
    n
    • 2
    • 5
  • n

    Needle

    04/03/2022, 3:49 PM
    Hello @Aruzo! This thread has been automatically created from your message in #843999948717555735 a ``few seconds ago``. Pinging @User so that they see this as well! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ... menu) and select Leave Thread to unsubscribe from future updates. Want to change the title? Use the
    /title
    command! We have solved your problem? Click the button below to archive it.
    • 1
    • 3
  • y

    Yeehawlerz101

    04/03/2022, 3:59 PM
    Howdy there everyone I'm getting an error for "CreateClient is not defined" here is my code for the supabaseClient.js
    Copy code
    js
    // @ts-nocheck
    const supabaseUrl = "XXX"
    const supabaseAnonKey = "XXX"
    // Create a single supabase client for interacting with your database
    export const supabase = createClient(supabaseUrl, supabaseAnonKey);
    note the XXX is where my url and key is. any help would be huge! I also did
    npm ci
    to clean install my modules incase that was the issue
    n
    g
    • 3
    • 5
  • a

    ak4zh

    04/03/2022, 5:31 PM
    why does the dashboard tries to apply sorting by itself if your table contains a column called
    name
    it applies a sorting always on name column for no reason, I have to always remove filter every-time I refresh page or open the table viewer again to be able to see my data sorted by id which should be the default.
    n
    g
    • 3
    • 5
  • p

    pcj127

    04/03/2022, 7:16 PM
    I'm calling a plpgsql function in the same way that the generated API docs recommend (supabase-js):
    Copy code
    js
    await client.rpc<Foo>('create_foo', { name }).select().single();
    function:
    Copy code
    sql
    CREATE OR REPLACE FUNCTION create_foo(
      "name" text
    ) 
    RETURNS setof foo 
    ...
    But getting this following error:
    Copy code
    sh
    404 Not Found: Could not find the public.create_foo() function or the public.create_foo function with a single unnamed json or jsonb parameter in the schema cache (undefined)
    Any idea what I could be missing?
    n
    g
    • 3
    • 5
  • n

    NatoNathan

    04/03/2022, 7:57 PM
    Hi, i'm trying to setup twitter oauth, but when i call
    Copy code
    js
    supabase.auth.signIn({
      provider: 'twitter',
    })
    i just get redirected to
    https://<project-ref>.supabase.co
    ( is my projects ref) not
    https://<project-ref>.supabase.co/auth/v1/callback
    n
    b
    d
    • 4
    • 7
  • m

    Manuel Coffin

    04/03/2022, 8:28 PM
    hey guys! I have this error that seems to come out of nowhere, I left my computer a few hours ago, and apparently now the connection to the database is not working:
    Copy code
    Can't reach database server at `db.<my-id>.supabase.co`:`5432`
    
    Please make sure your database server is running at `db.<my-id>.supabase.co`:`5432`.
    I saw some other people getting this, but didn't find a solution... Nothing has changed in my db configuration
    n
    b
    • 3
    • 6
  • s

    sbr

    04/03/2022, 8:58 PM
    Does onAuthStateChange trigger in all open tabs when the user logs in via a magic link in a different tab? It seems like https://github.com/supabase/supabase/issues/2739 fixed this but it doesn't seem to work for me? This is my code-
    Copy code
    useEffect(() => {
        supabaseClient.auth.onAuthStateChange((event, session) => {
          if (event === "SIGNED_IN") {
            supabaseClient.auth.api
              .getUser(session.access_token)
              .then(({ user, error }) => {
                if (user) {
                  setUser(user);
                }
              });
          } else if (event === "SIGNED_OUT") {
            setUser(null);
          }
        });
    }, []);
    n
    g
    +2
    • 5
    • 30
  • d

    Duckstroyer

    04/04/2022, 1:27 AM
    I can't seem to be able to edit my triggers and function hooks. Is this not something that the free plan can do? I am following along with this tutorial atm and it looks like Jon has the ability to edit his, but I cannot edit mine, I have to delete them and reimplement: https://egghead.io/lessons/supabase-automatically-create-a-stripe-customer-for-each-user-with-supabase-function-hooks
    n
    g
    • 3
    • 16
  • n

    Needle

    04/04/2022, 1:29 AM
    Hello @garyaustin! This thread has been automatically created from your message in #843999948717555735 a ``few seconds ago``. Pinging @User so that they see this as well! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ... menu) and select Leave Thread to unsubscribe from future updates. Want to change the title? Use the
    /title
    command! We have solved your problem? Click the button below to archive it.
  • j

    jjaimealeman

    04/04/2022, 2:35 AM
    Hello all πŸ‘‹ I've been playing with the headlessCMS Directus. I have it installed locally and it uses sqlite3 for it's DB. I need help converting the DB to postgresql πŸ₯³ I learned how to dump
    data.db
    from my local instance into
    data.sql
    . I wish to import that file into Supabase but not sure how to?! πŸ˜– I ran
    Copy code
    > sqlite3 data.db
    SQLite version 3.38.2 2022-03-26 13:51:10
    Enter ".help" for usage hints.
    sqlite> .output data.sql
    sqlite> .dump
    sqlite> .exit
    then
    Copy code
    > sqlite3 data.db`
    sqlite> .output data_structure.sql
    sqlite> .schema
    sqlite> .quit
    I now have
    data.sql
    with all data and
    data_structure.sql
    πŸ˜‰ Just don't know where to go from there. Been Googling for a while and most solutions seem to point to Rails and Gems πŸ˜•
    n
    s
    s
    • 4
    • 4
  • s

    sbr

    04/04/2022, 4:30 AM
    Hi, I'm using the
    auth-helpers
    for NextJS and not sure if my issue is a bug or expected behavior. The app is a simple todo list with authentication. But once I'm signed-in and if I sign out in another tab, I'm still able to write to the table by creating new todos in the first tab. Is this expected?
    n
    s
    t
    • 4
    • 16
1...251252253...316Latest