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

    vMInvincible

    07/21/2022, 1:16 PM
    Hey ,can we create a policy for a table in which users in that table can only access it.
    n
    g
    • 3
    • 10
  • g

    geordi

    07/21/2022, 2:54 PM
    Hi there, I'm facing this issue here: https://github.com/supabase/supabase/issues/4883 And ran the SQL suggested as a fix in the comment thread - but now hitting another error of: "URL using bad/illegal format or missing URL" In the postgres logs - could someone please help investigate? πŸ™‚ I had just unpaused my project today after a few weeks
    n
    g
    • 3
    • 13
  • u

    1337

    07/21/2022, 2:59 PM
    Is there any issues with ordering by foreign table column via JS SDK?
    Copy code
    js
    const { data, error } = await client
      .from('otherdeeds')
      .select('id,prices!inner(price)')
      .not('prices.price', 'is', null)
      .order('price', { nullsFirst: false, foreignTable: 'prices' })
      .limit(10)
    Always returns unordered list.
    n
    g
    • 3
    • 3
  • r

    RenΓ© Goretzka

    07/21/2022, 4:19 PM
    Is there any chance to describe models and authorization rules (RLS) as code instead of using the supabase UI?
    n
    s
    • 3
    • 2
  • f

    FaisalNawaz

    07/21/2022, 5:17 PM
    Hi Folks..I am facing issue with supabase realtime.I am working on my project after 6 months but when i left the project everything was working perfectly fine with current configurations but now realtime has stop working unexpectedly.I have all the current configuration in my supabase dashboard as suggested by latest supabase docs and tried different suggested ways but still not able to make it work
    n
    g
    • 3
    • 5
  • o

    oxlory

    07/21/2022, 7:02 PM
    Hello is there way to call the https://supabase.com/docs/reference/javascript/auth-update to update a user's email from serverside? without having the jwt of the user?
    n
    g
    • 3
    • 4
  • c

    CrypticPlasma

    07/21/2022, 8:18 PM
    I just recently starting getting the error
    canceling statement due to statement timeout
    when trying to truncate or drop a certain table. Weirdly it is showing that there are 0 rows but still 11mb of data in it. What could be causing this to happen? (I tried creating a new table and deleting it and it works fine so it seems to be a problem with this specific table)
    n
    • 2
    • 3
  • o

    omri

    07/21/2022, 9:17 PM
    i have a couple of tables, all of which have something along the likes of
    id: uuid
    and
    created_at: timestamp
    , and the following additions: - the table
    urls
    has a
    host_and_path: string
    column containing a normalized url - the table
    website_data
    has (among other columns) a
    url_id: uuid
    column pointing to a
    urls
    entry both were created through the ui, no special sql wizardry going on here when creating a
    website_data
    entry from my input data (which includes a url that i normalize) i'd like to create a
    urls
    entry if one doesn't exist, then take its id and use it as the newly created
    website_data
    entry's
    url_id
    , all in one go, and possibly for many entries in one call. is that possible today or do i need to resort to an ugly and inefficient multi-step solution (upsert url returning id and normalized address, iterate through input data to match url ids to data objects, create
    website_data
    entry for each input datum using the info i need and the correct
    url_id
    )?
    n
    g
    • 3
    • 5
  • k

    Kam

    07/21/2022, 10:36 PM
    Is it possible to install/use ffmpeg in an supabase function?
    n
    • 2
    • 2
  • s

    Sree

    07/22/2022, 2:32 AM
    Hi I am using graphql to interface with my Supabase database. I've added RLS to my table and attached individual policies for SELECT, INSERT, UPDATE, and DELETE (attached image). I am able to SELECT without any issues, however my INSERT fails with:
    Copy code
    new row violates row-level security policy for table \"projects\"
    I've been stuck for a while now and not sure what to do. This is my mutation query:
    Copy code
    mutation MyMutation {
      insertIntoprojectsCollection(objects: {assets: ["test01"], name: "test", scene: "testscene", sensors: [{name: "camera1"}], user_id: "ca3ca3b8-9146-48e3-9106-1d8e42f8f5b5"}) {
        affectedCount
      }
    }
    n
    g
    • 3
    • 12
  • s

    stewiethepro

    07/22/2022, 4:31 AM
    Hey guys! I'm trying to post some form data to Supabase in an async function.
    Copy code
    const makeRequest = async (formData, userId) => {
      const supabase = getSupabase(userId)
      const { data: users, error } = await supabase
        .from("users")
        .update({ 
          user_type: formData.userType,
          first_name: formData.firstName,
          last_name: formData.lastName,
          is_onboarding: false 
        })
        .eq('user_id', userId)
    
        error ? console.log("Supabase error:", error) : console.log(data);
      }
    But I'm getting this error: secretOrPrivateKey must have a value utils/supabase.js (18:20) @ supabase.auth.session
    Copy code
    16 | 
      17 |     supabase.auth.session = () => ({
    > 18 |       access_token: jwt.sign(payload,  process.env.SUPABASE_SIGNING_SECRET),
         |                    ^
      19 |     })
      20 |   }
    Here's where I'm signing the JWT:
    Copy code
    // utils/supabase.js
    import { createClient } from '@supabase/supabase-js'
    import jwt from 'jsonwebtoken'
    
    const getSupabase = (userId) => {
      const supabase = createClient(
        process.env.NEXT_PUBLIC_SUPABASE_URL,
        process.env.NEXT_PUBLIC_SUPABASE_KEY
      )
    
      if (userId) {
        const payload = {
          userId,
          exp: Math.floor(Date.now() / 1000) + 60 * 60,
        }
    
        supabase.auth.session = () => ({
          access_token: jwt.sign(payload,  process.env.SUPABASE_SIGNING_SECRET),
        })
      }
    
      return supabase
    }
    I have my SUPABASE_SIGNING_SECRET in my .env.local file in the root directory. I'm signed in and retrieving a user id from the session, but when I submit the form it throws this error. Anyone able to point me in the right direction?
    n
    s
    • 3
    • 4
  • h

    HEAVYPOLY

    07/22/2022, 5:31 AM
    Hi all, with a supabase function hook, how would you send record data with the httprequest? eg:
    Copy code
    {
      "record": {
        "email": "asd@gmail.com",
        "id": "16c34376-54ff-49dc-a374-f32b063ef5da"
      }
    }
    n
    g
    • 3
    • 6
  • a

    Anoushk

    07/22/2022, 6:50 AM
    Hey guys i setup custom smtp with supabase and sendgrid folowing the instructions exactly as they said but i still get error sending magic link on frontend when i send the login email
    n
    g
    • 3
    • 3
  • u

    unknown1337

    07/22/2022, 7:20 AM
    Hi all, i'm trying to join tables using the REST api (postgrest resource embedding). Goal: get the projects.name and something.externalId in a single request. Tried: /rest/v1/projects?id='0805c7c6-ebdf-4d51-84fe-feaa50a17b05'&select=\*,something(externalId). Response: PGRST200 - could not find a relationship between projects and something in the schema cache. Question: how to join the table projects & something when the table workspaces is __not__ a join table. Thanks! any input is very much appreciated πŸ™‚
    n
    • 2
    • 3
  • a

    Anoushk

    07/22/2022, 8:18 AM
    Mjml doesnt work in supabase template
    n
    s
    • 3
    • 2
  • u

    unknown1337

    07/22/2022, 9:23 AM
    Hi All, I'm unable to drop a column though I removed the foreign key constrain on the column using the UI and made the cells NULL. What is going wrong? thanks!!!!
    n
    g
    s
    • 4
    • 3
  • j

    Julien

    07/22/2022, 2:00 PM
    Is it possible to remove the extra level of depth on select request? For instance, I have this select request:
    Copy code
    js
                .select(`
                    organization(id, name)
                `)
    Which gives me the following result: [ Β Β { organization: { id: dqzdqz, name: "dqdqdq" } }, { organization: { id: dqdqdqdqzd, name: "dqdqdq" } } ] And I would like to have: [ { id: dqdqdq, name: "dqdqd" }, ... ]
    n
    • 2
    • 2
  • d

    Derek

    07/22/2022, 2:53 PM
    Row level security best practice for join tables -- curious if anyone has advice / experience setting RLS on a join table? I have a many-to-many relationship between artists and tags. Users can assign many tags to different artists. Is it necessary to have a user_id column on the join table?
    n
    g
    • 3
    • 4
  • j

    jaitaiwan

    07/22/2022, 3:25 PM
    This is a question for the team, particularly the functions crew. I see that edge functions are using the deno deploy platform; based on that I tried to deploy the fresh framework as an example and hit a "Only POST or OPTIONS requests allowed". Is this an artificial requirement or a technical limitation?
    n
    s
    • 3
    • 6
  • g

    gesusc

    07/22/2022, 3:34 PM
    I am trying to work the Edge Functions locally but I can't seem to connect directly to the database using https://deno.land/x/postgresjs@v3.2.4. I keep getting
    Connection refused
    . Do I need to allow Deno to access the locally running DB? If so how can I do that? I tried appending the
    --allow-net=localhost:54322
    flag via
    supabase functions serve
    it didn't like that.
    n
    s
    • 3
    • 2
  • g

    gorbypark

    07/22/2022, 4:08 PM
    any ideas why
    let {data, error} = await supabase.from('food').select('*');
    might just "fail" with a
    Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.
    warning? Inspecting the network shows it's not even making a call to the api. I have calls to superbase.auth.signUp working fime...
    Copy code
    js
      let {user, error} = await supabase.auth.signUp({
        email: email,
        password: password,
      });
    i'm not quite sure what i'm doing wrong here...
    n
    s
    • 3
    • 6
  • g

    gesusc

    07/22/2022, 4:42 PM
    Are there any examples anywhere showing how to connect directly to the Postgres DB in an Edge Function? I am trying to connect but I keep getting
    502 Bad Gateway
    . I am using the provided
    SUPABASE_DB_URL
    environment variable when connecting to the DB.
    n
    • 2
    • 1
  • j

    joshcowan25

    07/22/2022, 5:02 PM
    Is there a way to receive the user metadata in the auth response?
    n
    n
    • 3
    • 4
  • t

    th_m

    07/22/2022, 5:21 PM
    Hello gang, new to supabase and loving it. I wondered if there was any way to get a swagger.json or openapi.json spec of the postgrest api.
    n
    • 2
    • 2
  • b

    bmccormick

    07/22/2022, 6:22 PM
    noob question for you all: just started using supabase and i have created some tables via Prisma and i can see them in the webUI. If i want to write a sql query against those tables, how do i do that? I go to the sql editor but it doesn't let me select either of the tables i created.
    n
    s
    • 3
    • 3
  • c

    Chris_Acrobat

    07/22/2022, 9:06 PM
    I get
    Error: unknown flag: --no-verify-jwt
    when I call
    supabase functions deploy my-function --no-verify-jwt
    . Am I misunderstanding something?
    n
    g
    • 3
    • 6
  • d

    Darren lau

    07/23/2022, 5:42 AM
    Realtime suddently doesn't work
    n
    j
    s
    • 4
    • 4
  • g

    gorbypark

    07/23/2022, 9:01 AM
    I'm not quite sure of exactly what I want, but is there a callback to run something when authentication happens or a token is refreshed? I'd like to keep the user object in react-query, which works by wrapping up
    supabase.auth.signIn()
    into a react-query custom hook, but of course that doesn't stay in sync when supabase refreshes the token and etc..
    n
    g
    • 3
    • 4
  • g

    gorbypark

    07/23/2022, 3:13 PM
    Bug? When editing a row, the timestamp defaults to 12:30PM of today, which throws an error. Moving the date to sometime in the future makes it work, but obviously the created_at time shouldn't change on an edit. Not sure how it's possible to not touch it at all? This is just using the standard timestamp column as suggested by default.
    n
    g
    • 3
    • 4
  • r

    reemwn

    07/23/2022, 5:11 PM
    I'm using Supabase DB with Prisma in an Express REST API project. My dataset is in CSV. My dataset is extremely large. So I have a smaller dataset that I want to seed into the database. How can I seed a csv into the database with Prisma? Second question is my dataset is large. Two csv. One with 500 rows and another with 3 million 100k rows. Is it too big for free tier? The csv size is 300mb and 36kb.
    n
    s
    n
    • 4
    • 5
1...305306307...316Latest