https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • Get data from Supabase from Wordpress
    j

    JuanFcoRomero

    02/23/2023, 10:47 AM
    Hello, I have data on my supabase database and I need to get it from wordpress to create post with that information. I'm going to need that wordpres, somewhat be authenticated in Supabase to have access to the data. How can I do that?
    s
    • 2
    • 1
  • Storage egress, CDN and pricing
    j

    jimzer

    02/23/2023, 11:19 AM
    Do CDN hits count towards the storage egress pricing? Let's say I have a 1GB file in storage and one user request it. Then it count for 1 GB. Then another user request the same file, but gets it from the CDN. Will I get billed 2GB storage egress or only 1GB? And if it's only 1GB storage egress cost, is there any additional costs associated with the CDN? Thanks for the help, the tool is amazing!
  • "relation "public.stripeData" does not exist"
    a

    Amara

    02/23/2023, 11:45 AM
    I keep trying to save data to my database but it says stripeData does not exist, but it exists as a table on my supabase database
    s
    g
    • 3
    • 10
  • Limit on the number of databases within a single cluster
    j

    jg247

    02/23/2023, 12:05 PM
    Hi, We might be using a multi tenant approach where each user has its own database in the cluster, are there limits or performance bottlenecks that might be introduced by supabase? As far as I know some of these limits are due to the kernel or file system, e.g. with ext3 the maximum number of database is 31995 due to the limits on the number of directories
  • Realtime app keeps getting paused
    t

    tom

    02/23/2023, 12:19 PM
    We've got a game using supabase realtime on the free tier, it's being worked on and used / tested daily but the project keeps getting paused every week. Does realtime usage not count towards 'activity' to stop a project getting paused? We tried adding a
    keep-alive
    rest api call too from the UI but this doesn't seem to work either. Any advice please?
  • How to modify queryParams for signInWithOAuth to get a large picture from facebook?
    a

    andrew.belong

    02/23/2023, 1:15 PM
    I know that by doing this with facebook graph url: "https://graph.facebook.com/me?fields=picture.type(large)" we can get avatar picture like 200x200 (not 50x50 as returned by default) So my question is can I somehow modify the default request to graph.facebook api to get a large picture? I tried to do something like this.But it doesnt work.
    Copy code
    const { data, error } = await supabase.auth().signInWithOAuth({
          provider: "facebook",
          options: {
            redirectTo: `${window?.location?.origin}/profile`,
    
            queryParams: {
              fields: "picture.type(large)",
            },
          },
        });
    Thanks in advance for any help. PS. Maybe there is a chance to make a handle_new_user function in supabase to retrieve a big picture?
    g
    • 2
    • 8
  • SignInWithOAuth only returning data.provider and data.url
    r

    Razoth

    02/23/2023, 2:17 PM
    in the example on the website it shows that you can get the provider_token and work with it after login, how would i do that, to query data from the provider after login?
    j
    • 2
    • 7
  • Remove from a backet
    g

    georgeg3g3g3

    02/23/2023, 2:25 PM
    How to delete a file from a backet when a record is removed from a table?
    g
    • 2
    • 2
  • not able to insert data, error "relation \"public.waiting_list\" does not exist"
    u

    useless

    02/23/2023, 2:58 PM
    i have a function and i am using ts in next framework const AddToWaitingList = async () => { const { error } = await supabase .from("waiting_list") .insert({ email: "example@mail.com" }); console.log("error", error); }; it makes me insert an email, however, i get this error, code: "42P01" details: null hint: null message: "relation \"public.waiting_list\" does not exist"
    g
    s
    • 3
    • 10
  • Set upload size limit per user
    f

    floitsch

    02/23/2023, 3:15 PM
    Is there a way to set the storage upload limit per user? There seems to be a global limit on the maximum upload size (50MB for the free tier), but I can't seem to find a way of limiting uploads depending on the user (and their properties, like whether they are a paying customer).
    g
    • 2
    • 2
  • Realtime issues
    n

    nmau

    02/23/2023, 3:18 PM
    Hey all šŸ™‚ Today the realtime connections don't work very well for me. Sometimes an event is triggered, but often much later and sometimes three times. I am a bit confused, as it was working yesterday. I have the issue with two separate codebases but the same supabase project. Does anyone have issues today as well? Already restarted my Project, but no luck. Thx for reading!
    • 1
    • 1
  • Property 'on' does not exist on type 'PostgrestQueryBuilder<any, any>'
    a

    Aadarsh805

    02/23/2023, 3:41 PM
    Copy code
    useEffect(() => {
         const mySubscription = supabase
          .from("interested_products")
          .on("INSERT", (payload: any) => {
            console.log("change in table", payload);
          })
          .subscribe();
    
        return () => {
          supabase.removeSubscription(mySubscription);
        };
      }, []);
    Property 'on' does not exist on type 'PostgrestQueryBuilder Property 'removeSubscription' does not exist on type 'SupabaseClient'
    g
    • 2
    • 2
  • Getting error from client.invoke.function call?
    d

    drewbie

    02/23/2023, 4:05 PM
    I couldn't find any docs about best practices for error handling Edge Functions so I wanted to see if anyone has any advice. In an edge function - should I explicitly throw an error, or return an error in the response? If I do throw an explicit error in the edge function, can I have access to it in the client? I just get the response
    Copy code
    [FunctionsHttpError: Edge Function returned a non-2xx status code]
    Should I be returning it in the response and parsing that in the client? I also want to make sure that errors are clear for devs in the Function logs so that any problems are can be easily seen, so thats why I was leaning towards explicitly throwing an error so that the edge function fails. Will returning a 500 with the error in the response be good for the logs as well? Any input on error handling Edge Functions would be appreciated. Thanks
    g
    • 2
    • 2
  • Delete multiple/all users
    s

    slavendjervida

    02/23/2023, 4:31 PM
    I tried to migrate users from firebase to supabase but there was some error and it moved some number of users. Confirm emails had not been sent and there is not option to resent them as far as I know. Is there any faster way wihtout deleting whole project? edit 1: I used sql editor and run:
    Copy code
    sql
    DELETE FROM users
    Not sure is this the best idea
    a
    • 2
    • 2
  • View Full Logs of an Edge Function
    i

    ICAZ117

    02/23/2023, 5:19 PM
    Hey yall, this should hopefully be a very quick question. I've got a Stripe webhook connected to a Supabase Edge Function. When the Edge Function receives and event from the webhook, it prints the body of the request, which is a fairly long JSON object. When I view these logs on the Supabase website, the output gets cut off, and is not all displayed. I assume this is simply because Supabase isn't displaying the full log due to length. How can I view the full output of the edge function?
  • User.id treatment when calling auth.signUp twice
    n

    neidelson

    02/23/2023, 5:50 PM
    In an effort to allow our users to re-send email verification emails if needed, I followed some guidance on GitHub suggesting I call auth.signUp() multiple times for the same email / password combination. I assumed that the value of data.user.id in the response would remain constant, but have noticed strange behavior in our database that seems to indicate this is often but not always the case (we have been saving the id value in two places, and notice that the values sometimes diverge between the first and second calls). Is it incorrect to assume data.user.id will remain constant for consecutive calls to auth.signUp for the same email? Is the answer the same for consecutive calls to auth.admin.createUser?
    g
    • 2
    • 3
  • Custom login form for Supabase
    v

    Vimes

    02/23/2023, 6:19 PM
    I want to create my own login form to authenticate users instead of using the supabase one. Using Nextjs, but couldn't figure out how. Is this possible? Any tips on how? šŸ™‚
    a
    g
    • 3
    • 4
  • When is RLS evaluated?
    s

    shawntoubeau

    02/23/2023, 6:20 PM
    Hi! I'm connecting to my DB with a Golang ORM and it doesn't get restricted by any of the RLS policies I have in place. I tested them by curling an API endpoint and confirmed it works there. So my question is, does RLS only work when interacting with Supabase through a client or API endpoint but not a direct DB connection?
    g
    • 2
    • 4
  • Duplicate rows fetched when paginating.
    g

    gtims123

    02/23/2023, 7:03 PM
    Hi, I am receiving duplicate rows sometimes when paginating using the supabase .range() function. I am providing a range of 10, so something like .range(0, 9) and .range(10, 19). I'm not sure why; perhaps it's a limitation of postgres that we will get duplicates when paginating. One solution I came up with is doing a "not in" filter: if (alreadyFetchedRows.length > 0) { query = query.not( 'name', 'in',
    (${alreadyFetchedRows.map(row => row.name).join(',')})
    , ); } This works somewhat, but unfortunately if postgres is unable to fetch 10 items I get 0 items back. This means that if there's still 4 items that I need to fetch for example, I can't get those items. It's related to the following PostgREST error: https://github.com/PostgREST/postgrest/issues/2470 I'm wondering if anybody has a workaround or can give me some insight on how to resolve this problem. Thanks šŸ˜„
    g
    • 2
    • 17
  • JSONB in GraphQL Mutation
    t

    TSIA_SN

    02/23/2023, 7:40 PM
    We've started getting errors while trying to perform GraphQL update mutations against a JSONB field in our table:
    Invalid input for JSON type
    . It was working fine previously, and I'm not sure when the issue began happening. It looks like the last time there was a successful insert on the table was back in October, so I don't know if pg_graphql updated and broke it or what. This is how we're setting the field within the mutation:
    Copy code
    js
    set: {
      Body: {
        rating: 4
      }
    }
    Where
    Body
    is the name of the column and
    { rating: 4 }
    is what we want to store in it. Could someone point out what's wrong with the approach? Do I need to
    JSON.stringify
    the object first?
    • 1
    • 1
  • How to guarantee the order of Stripe events with Supabase Functions?
    q

    Quentin

    02/23/2023, 7:51 PM
    Hello everyone, I just succeeded using Stripe Webhook with Supabase Edge Function with the EgyEdgeFunctions tuto. I listen to the events: - 'customer.subscription.created' - 'customer.subscription.updated' - 'customer.subscription.deleted' I see that the events are sent in the wrong order (updated before created), in my code I had written a check that was going to look for the subscription with the same ID in my supabase table to check if the new event had its created key that was created after the one in the DB, but I realize that the supabase edge functions have a variable execution time (probably because of the network)... My problem is that in my 'subcriptions' table the status is 'incomplete' when in reality it is 'active' on the stripe side, because the event created is the last one to be executed while the first event is not yet recorded in the database... What is the best practice for Webhook events when the database has a variable access time?
  • How to count columns across Rows
    r

    Romi

    02/23/2023, 7:55 PM
    I want to total all my total hours for reports that have week 4. Is this something I do on Supabase or on my framework (Nuxt)
    g
    • 2
    • 1
  • Sign in With Apple on Android
    g

    gtims123

    02/23/2023, 8:02 PM
    I attempted to Sign in With Apple on android today, and for some reason I was immediately locked out of my Apple account. Has anyone else experienced this? For reference, I have never logged onto this Android with this Apple account, but I'm wondering if it's a supabase related issue or something else.
  • Is there a built-in "create_profile()" function in Supabase?
    u

    Unknown Member

    02/23/2023, 8:35 PM
    I am playing around with functions, but I might have deleted a function called "create_profile()". Is there a built-in function with that name? If there is, how can I restore it?
    g
    • 2
    • 3
  • Auth Provider changes
    s

    SeeSharp

    02/24/2023, 12:00 AM
    Is it possible to listen to changes of the auth providers? Whether it's getting enabled or disabled.
    g
    s
    b
    • 4
    • 20
  • E AttributeError: 'Client' object has no attribute 'functions'
    x

    xdotcommer

    02/24/2023, 12:04 AM
    Just trying to call a remote function following the example on the website: func = supabase.functions() @asyncio.coroutine async def test_func(loop): resp = await func.invoke("hello-world",invoke_options={'body':{}}) That's the error I get
  • Help Designing Database Structure
    g

    GreekShai

    02/24/2023, 2:10 AM
    Hi guys! I want to create a CRM that allows each business to have their own customized data structure. How would i go about doing this with supabase? For example, User A is a pizza shop and User B is a cleaning business. User A wants to create certain tables and columns for their business and User B wants to create certain tables and columns for their business. Would supabase be a good option for this?
  • Nested Queries with TypeScript
    k

    Kellen Mace

    02/24/2023, 2:11 AM
    The Supabase docs say that for "nested tables, you may want to construct your own types", and a simplistic code example is provided: https://supabase.com/docs/reference/javascript/typescript-support#nested-tables This ends up being overly complex in my app, though. Example:
    Copy code
    ts
    type RuleResponse = Awaited<ReturnType<typeof getRule>>;
    
    type RuleSuccess = NonNullable<RuleResponse["data"]> & {
      rule_channels: {
        channel_id: Pick<
          Database["public"]["Tables"]["channels"]["Row"],
          "id" | "thumbnail_url" | "title"
        >;
      }[];
    } & {
      rule_keywords: {
        keyword_id: Database["public"]["Tables"]["keywords"]["Row"];
        type: Pick<Database["public"]["Tables"]["rule_keywords"]["Row"], "type">;
      }[];
    };
    
    async function getRule() {
      return await supabaseClient
        .from("rules")
        .select(
          `
            id,
            rule_channels (
              channel_id( id, title, thumbnail_url )
            ),
                    rule_keywords (
                        keyword_id( id, keyword ),
                        type
                    )
          `
        )
        .eq("id", $page.params.id)
        .single();
    }
    I have to do a ton of manual work to compose the
    RuleSuccess
    type. Not only that, but this code is really fragile. If a developer modifies the fields within one of the nested queries and forgets to manually update the
    RuleSuccess
    type, that type would then be wrong. The TS compiler may not complain since it's just going by the hardcoded types it was given originally, and your dev team may be inadvertently shipping bugs to production. I've found some threads in this Discord talking about pulling in additional libraries like Prisma to avoid dealing with the lack of TS support. 😬 I guess another option would be to manually add a bunch of types inside of the `Row: {}`s of the generated types file. But then you're stuck manually maintaining the generated types file and you risk it getting out-of-sync with the database. Is there really no better way to handle this?
    s
    • 2
    • 2
  • Another developer struggling with 'permission denied for schema public'
    e

    ejkreboot

    02/24/2023, 2:52 AM
    I am unable to query my supabase tables with the
    @supabase/supabase-js
    library. I have no problem retrieving items from supabase storage, but when I try to query from my database tables I get:
    Copy code
    {
      "data": null,
      "error": {
        "code": "42501",
        "details": null,
        "hint": null,
        "message": "permission denied for schema public"
      }
    }
    The code to query the table I am using is:
    Copy code
    import { createClient } from '@supabase/supabase-js'
    import { SECRET_SUPABASE_PUBLIC_KEY, SECRET_SUPABASE_URL } from '$env/static/private'
    
    export async function GET({ params, url }) {
        const supabase = createClient(SECRET_SUPABASE_URL, SECRET_SUPABASE_PUBLIC_KEY);
        const { data, error } = await supabase
          .from('test')
          .select()
        return new Response(JSON.stringify({data, error}));
    }
    I have created RLS policies allowing SELECT access for the
    service_role
    and
    public
    roles to no avail. After reading some similar questions here, I have tried a freshly created table, and I have restarted the server but the problem persists. Any pointers would be much appreciated!
    g
    • 2
    • 22
  • Failed to create trigger: failed to create pg.triggers: zero-length delimited identifier at or near
    b

    BigSamHam

    02/24/2023, 2:59 AM
    Whenever I try to make a trigger, I get this error: Failed to create trigger: failed to create pg.triggers: zero-length delimited identifier at or near """". I have no idea why. It doesn't matter what I choose for the fields, either. Does anyone have any experience with this?
    • 1
    • 1
1...143144145...230Latest