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

    bhaskar

    07/29/2022, 10:07 PM
    Hi team, I am using
    auth.role() = 'authenticated'
    in a function. it returns false when i refresh the page on the ui, even when i have a valid cookie.
    n
    o
    g
    • 4
    • 55
  • h

    HEAVYPOLY

    07/30/2022, 12:51 AM
    Is there a way to edit the address of a function hook once it's been created? I'm using ngrok and every time the address expires I have to recreate the hook
    n
    g
    • 3
    • 2
  • p

    pocin

    07/30/2022, 9:26 AM
    does anyone know how to actually run
    pgTAP
    tests against localhost deployment? (or install
    pg_prove
    fwiw) https://supabase.com/docs/guides/database/extensions/pgtap#running-a-test ? I have troubles understanding the docs https://pgtap.org/pg_prove.html
    n
    • 2
    • 4
  • m

    mhaezaragoza

    07/30/2022, 12:11 PM
    hello! is it possible to upload a file to root or .well-known folder?
    n
    g
    s
    • 4
    • 5
  • p

    pocin

    07/30/2022, 2:26 PM
    is there a way to configure gotrue (https://github.com/supabase/cli/blob/main/internal/start/start.go#L639 ?) when using localhost dev instance? I want to enable oauth provider and disable email confirmations for local development purposes
    n
    g
    • 3
    • 10
  • t

    The AI

    07/30/2022, 2:33 PM
    Hi Can i add column programmatically?
    n
    p
    +2
    • 5
    • 12
  • s

    stukennedy

    07/30/2022, 5:18 PM
    struggling to run supabase "locally" on Gitpod. I've got installed and running. Used
    supabase link
    and the
    subabase db reset
    but when I run it, there's no tables or anything in the setup. The link to supbase studio works but everything is empty and just continually loading. So it feels like I'm just missing some way of getting a migration running or something to clone the data of my actual project onto the local instance. Any ideas? Anyone got this working. Supabase running inside gitpod with my whole dev env in there would be total magic.
    n
    i
    s
    • 4
    • 12
  • u

    unknown1337

    07/30/2022, 7:23 PM
    Dear, if in an edge function I want to fetch a API call, which might take multiple seconds (up till 1 minute for e..g the FB API). In the fetch callback I want to process the data (do some magic with the data and store it in the supabase DB. *Question: the time awaiting the fetch (callback), is that concidered as '1. edge function worktime hours (2. deno cpu time) '? or is there a better way for these long async callback await functions?
    n
    • 2
    • 1
  • b

    b----nessmen

    07/30/2022, 8:37 PM
    Hello, how to remove/update table view, I added one new column to main table and it didn't add to table view.
    n
    g
    • 3
    • 4
  • s

    sudoramen

    07/30/2022, 10:16 PM
    Hi All, I'm just trying to run
    await supabase.storage.listBuckets()
    but I get an error message:
    Migration failed. Reason: An error occurred running 'pathtoken-column'. Rolled back this migration. No further migrations were run. Reason: relation "storage.objects" does not exist
    . Am I missing something?
    n
    o
    • 3
    • 4
  • b----nessmen (2022-07-30)
    n

    Needle

    07/30/2022, 11:20 PM
    Hello @b----nessmen! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! 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.
    b
    • 2
    • 2
  • a

    AlexRodgers

    07/30/2022, 11:38 PM
    Hi everyone! A bit of a noob question here. What are the best practices regarding creating unique names for files in supabase storage? I want to have users be able to upload profile photos but can't retrieve the correct image if everyone names their photo
    profile.png
    . Is there a way to create a unique file name in supabase like how unique ids are generated for db rows using
    uuid
    or do I have to create the unique name myself?
    n
    g
    • 3
    • 6
  • s

    Sree

    07/31/2022, 6:23 AM
    Hi, I created a
    projects
    and a
    runs
    table, where
    runs.project_id
    has a foreign key mapping
    projects.id
    . Another column on the
    projects
    table is the
    user_id
    which maps to the user who created the project. I've also created a RLS policy on the
    runs
    table as such:
    Copy code
    create or replace function get_runs_for_user(user_id uuid) returns setof uuid as $$
      select runs.id from runs, projects where runs.project_id = projects.id AND projects.user_id = $1
    $$ stable language sql security definer;
    
    create policy "Allow individual read access for user's runs" on runs
    for select using (
      id in ( select get_runs_for_user(uid()))
    );
    Essentially the user selecting into the
    runs
    table must match the project's
    user_id
    . However, as a result of this policy my inserts are failing (due to the default insert + select behavior). I was wondering if anyone has a suggestion to do the insert? I use graphql to create the mutation that does the insert and I do the insert into the
    projects
    and
    runs
    table in the same mutation
    n
    • 2
    • 2
  • r

    Rían

    07/31/2022, 9:21 AM
    How do people using supabase/RLS implement roles? Ideally i'd like to be able to have some form of auth.role() == "administrator" that way I can associate UIDs with a given role, or potentially multiple roles? Essentially, I need to be able to create teacher and student accounts, where teachers have many students and the UI is presented differently depending on role, as well as limiting access to certain things -- I read something about implementing claims but I'm not entirely sure how to go about this
    n
    g
    • 3
    • 4
  • v

    Vilian

    07/31/2022, 10:59 AM
    Hey guys, I'm having issue self hosting on a machine on my network
    n
    g
    • 3
    • 39
  • t

    TARS

    07/31/2022, 11:37 AM
    Hello, I have two two tables. Let's call them 'hosts' and 'hosts objects', hosts can have many objects, but one object can only have one host. I think I set the relational columns structure in the right way. So, there will come data for a new host+object in "one chunk" from the front-end (meaning website don't have host login yet). How will I structure the logic here? I guess first populate one row in host, then somehow get a callback with the newly generated host id. And then populate one row in host object with the host id? Am I on the right track here? Thanks, supabase seems super great! 😄
    n
    o
    +2
    • 5
    • 10
  • s

    STILLWATER;

    07/31/2022, 1:30 PM
    Altering table says u must be owner, what perms im missing so i can ask for them
    n
    o
    s
    • 4
    • 11
  • l

    Lior539

    07/31/2022, 2:36 PM
    Hi folks. I was exploring using Supabase for a project but have decided to stop using it. I really what you are doing and want to support what you are doing, so I thought to share my feedback: Context: My background is mobile+frontend engineering. I have some experience with backend, particularly with API creation but nothing really at the database level. I have basic SQL experience Why I chose Supabase: * I want to spend time iterating quickly on the frontend. I don't want to spend time putting a backend together. Why I chose Supabase and not Firebase: * Im not super familiar with NoSQL. I prefer to spend that time on the frontend for now. * Quality of the supabase docs+videos+examples make it very easy to onboard v.s Firebase What I like: * Simplicity of Authentication and many options out the box * High quality docs, video and examples. This is super helpful * Row-level security. Love how this helps me feel more confident in my data-separation and making sure users don't access data they're not supposed to. What I don't like/ Why I've decided to stop use it * I find it incredibly difficult to debug any issues with Postgres function. The Postgres logs on Supabase show me what the error was, but there's no help beyond. This makes it a guessing game when it comes to fixing your postgres code. Ultimately I ended wasting a ton of time debugging issues with postgres functions and my project is still very simple. I shudder to think what would happen as it grows more complex * On a similar note, there is no ability to add unit+integration for postgres functions/triggers/Row-level policies. This would certainly make it easier to debug things I've opened issues https://github.com/supabase/supabase/issues/7311 and https://github.com/supabase/supabase/issues/7971 for the above.
  • q

    QBeast

    07/31/2022, 6:10 PM
    Hello, I'm having an issue with Supabase and React. I've just started trying to learn Supabase so I may be doing something wrong, but hopefully someone can help. I've followed the quick starts and other sample projects and have it where I can login with the Google authentication provider. Users are created in the auth.users table correctly. What I want to do is show a list of contacts for a user, where a contact is also a user in the users table. So I created a contacts table with a user_id and a contact_id. I get the id of the logged in user from useAuth, which is a custom React hook used to get the user from the supabase client:
    Copy code
    const session = supabase.auth.session();
    setUser(session?.user ?? null);
    This part works. The part that I can't get to work is getting the list of contacts. The SQL is easy:
    Copy code
    select * from auth.users where id in (select c.contact_id from public.contacts  f where f.user_id = '<uuid>')
    I created an rpc function called getUserContacts that returns a set of users:
    Copy code
    create or replace function getUserContacts(userId uuid)
    returns setof users
    language sql
    as $$
      select * from auth.users where id in (select c.contact_id from public.contacts  f where f.user_id = userId)
    $$
    Calling the function returns this error: {"code":"42501","details":null,"hint":null,"message":"permission denied for table users"} Is the auth.users table not supposed to be referenced? This is a brand new database I just created from scratch. Is there a way to do this kind of query using the supabase client? I couldn't figure that part out which is why I created the rpc function. Any tips or help would be greatly appreciated!
    n
    g
    • 3
    • 3
  • a

    aetinx

    07/31/2022, 6:16 PM
    i tried to connect to twitter and this happened
    Copy code
    {
      "message": "No API key found in request"
    }
    n
    g
    s
    • 4
    • 12
  • a

    Albert [tox/cis]

    07/31/2022, 6:45 PM
    Are RLS rules in the supabase studio only limited to the
    public
    schema?
    n
    g
    • 3
    • 6
  • p

    Pragy

    07/31/2022, 7:32 PM
    When generating types for the API via openapi-typescript, the generated definitions have all fields as optional! This happens for views (not for tables). Is there a workaround for this? Usecase I want to serve some additional data for each row for a table. To accomplish that, I put the table in a non-public schema, and exposed a view via the public schema. Schema
    Copy code
    sql
    create table example
    (
        id          uuid        default uuid_generate_v4() not null primary key,
        name        text                                   not null,
        description text                                   not null,
        created_at  timestamptz default now()              not null
    );
    
    
    create view public.example_view as
    select *
    from example;
    Generated definitions:
    Copy code
    ts
    example: {
      id: string;
      name: string;
      description: string;
      created_at: string;
    };
    
    example_view: {
      id?: string;
      name?: string;
      description?: string;
      created_at?: string;
    };
    PS: just to point out - it seems that nullable columns on views is a limitation of Postgres - it doesn't seem to keep track of nullability properly. https://stackoverflow.com/questions/17301323/why-are-my-views-columns-nullable/17310913 So my question basically is, is there a simple workaround for this via supabase? Some way we could force the view API to have the same nullability as the underlying table?
    n
    • 2
    • 1
  • r

    rizistt

    07/31/2022, 7:42 PM
    New to Supabase, is there a way to rename the default project (and default organization) in a self-hosted (docker) scenario?
    n
    • 2
    • 1
  • v

    Village

    07/31/2022, 10:43 PM
    What scale can a single Supabase Real-time server operate at? Can it handle a query that updates tens or hundreds of thousands of rows at once? It’d only be distributing to a handful of clients but can it process that much data in an expeditious manner?
    n
    g
    • 3
    • 10
  • a

    aetinx

    08/01/2022, 12:09 AM
    will supabase auth ever support reddit
    n
    o
    a
    • 4
    • 7
  • u

    unalive8

    08/01/2022, 1:10 AM
    hey, I am trying to get discord and twitter login using nextjs. it's in. a useEffect but the
    onAuthStateChange
    is never called unless I changed tabs. if I stay on the page even for 5 min after being redirect nothing happens
    n
    g
    i
    • 4
    • 27
  • i

    Ize_Cubz

    08/01/2022, 4:01 AM
    How would I use Supabase auth with prisma, I would like to keep more data on the user such as balance and not just login data?
    n
    n
    • 3
    • 4
  • m

    Markeem

    08/01/2022, 8:26 AM
    Hey! I have have created a view for my app, which works ( I can access it in my app), but doesn't display data in the supabase admin UI. The loading spinner doesn't stop.
    n
    • 2
    • 1
  • s

    shiro44

    08/01/2022, 9:44 AM
    Hey, can i create a function to add few database fields and return the sum dynamically? Also is it possible to directly fetch data from API into a table cell?
    n
    s
    • 3
    • 10
  • l

    looni

    08/01/2022, 10:09 AM
    Do I need to use raw sql if I want to select distinct rows in a table? Example:
    Copy code
    SELECT
       DISTINCT column1
    FROM
       table_name;
    n
    p
    • 3
    • 2
1...310311312...316Latest