https://supabase.com/ logo
Join Discord
Powered by
# javascript
  • z

    zaheeratwork

    07/25/2022, 6:54 PM
    Hi All - Any idea why my foreign key is returning
    null
    when I try to select. I have
    driver_locations
    table which has column
    driver
    which references
    id
    column of
    drivers
    table. Not sure what I am doing wrong?
  • g

    garyaustin

    07/25/2022, 7:04 PM
    Because your table is named drivers and not driver?
    z
    • 2
    • 21
  • h

    hoesmean

    07/25/2022, 11:32 PM
    #869406062036529193 hello, image is downloading slow how can handle it for download faster.
  • r

    React noob

    07/26/2022, 12:34 AM
    does anyone have already face this error ``TypeError: The "obj" argument must be an instance of Blob. Received an instance of Blob ``
    Copy code
    ts
    export const getStaticProps: GetStaticProps = async (context) => {
        let url=""
        const {data,error} = await supabase.storage
            .from("hiking-picture")
            .download("public/1658501487135-images.jpeg")
            if(data){
                url = URL.createObjectURL(data)
            }
        return {
            props: {
                x:url
            },
        };
    };
    j
    • 2
    • 2
  • s

    stukennedy

    07/26/2022, 9:47 AM
    anyone know how I can use
    .textSearch()
    using a partial match? e.g. "J" would return all records where the search column starts with a "J"
    g
    • 2
    • 1
  • j

    jaitaiwan

    07/26/2022, 9:54 AM
    does anyone have already face this error
  • l

    looni

    07/26/2022, 2:48 PM
    What is the correct syntax for ordering by multiple fields in Supabase?
  • l

    looni

    07/26/2022, 2:49 PM
    I need to order first by date and then by time of day
  • l

    looni

    07/26/2022, 2:49 PM
    I have those values in two different columns in the db
  • g

    garyaustin

    07/26/2022, 2:55 PM
    You should be able to just use multiple .order() calls.
  • l

    looni

    07/26/2022, 2:58 PM
    Oh you can just chain them?
  • l

    looni

    07/26/2022, 2:58 PM
    I tried to use an array
  • g

    garyaustin

    07/26/2022, 3:13 PM
    text search with partial matching
  • l

    looni

    07/26/2022, 3:45 PM
    I have something like this:
    Copy code
    const { data, error } = await locals.supabase.from('goals').select(`
        id,
        time,
        player:playerId (
          id,
          name
        ),
        team:teamId (
          id,
          name
        ),
        opponent:opponentId (
          id,
          name
        )
    `)
    How can I filter the query results by player name for example?
    g
    • 2
    • 21
  • g

    garyaustin

    07/26/2022, 3:50 PM
    Docs... https://supabase.com/docs/reference/javascript/select#filtering-with-inner-joins
  • l

    looni

    07/26/2022, 3:52 PM
    Should have specified that I read that already, but it isn't that clear how it works 😕
  • g

    garyaustin

    07/26/2022, 3:58 PM
    filter on foreign table
  • b

    battlesheep123

    07/27/2022, 7:03 AM
    I'm using the
    supabase-js
    client to read data from supabase. Queries such as the following return simple json objects.
    let { data: projects, error } = await supabase.from('projects')
    From other oop languages, I'm used to that every object is derived from a class. The great advantage is that this gives you auto completion for the attributes of your object. This is something I'm missing in javascript. Is there a way to pass the result of the supabase query to e.g. a javascript class?
  • j

    Jaeden

    07/27/2022, 7:39 AM
    No not really. Sounds like you need Typescript. Supabase has an endpoint which allows you to generate types. This will give you great autocompletion https://supabase.com/docs/reference/javascript/generating-types
  • r

    robertdenirosbiro

    07/27/2022, 10:09 AM
    Hiya. When I attempt an upsert I receive the error "Unhandled Runtime Error TypeError: _utils_initSupabase__WEBPACK_IMPORTED_MODULE_3__.supabase.from(...).upsert is not a function". const { data, error } = await supabase .from('events') .upsert({ id: 11, title: 'foo', description: 'supabot', created_by: user.id }) However if I perform an update, no issues: const { data, error } = await supabase .from('events') .update([{title: 'foo', description: 'supabot', created_by: user.id}]) .match({ id: event.11 }) What's happening here?
  • a

    anderjaska

    07/27/2022, 3:51 PM
    hey all
  • a

    anderjaska

    07/27/2022, 3:52 PM
    I'm trying to implement email+password signup. For some reason, every call I make with
    supabase.auth.signUp
    makes two separate requests, which results in a duplicate user error on the second call. I cant figure out why it would be doing that as I'm calling signup just once per signup.
  • a

    anderjaska

    07/27/2022, 3:52 PM
    any ideas?
  • g

    garyaustin

    07/27/2022, 3:54 PM
    You will have to provide some info on your environment and how you are calling signUp. If you console.log right before your signUp call do you get two messages?
  • a

    anderjaska

    07/27/2022, 4:04 PM
    Thanks for helping me out! This is a next.js app.
    signUp
    is called in
    handleSubmit
    of
    react-hook-forms
    . I already console logged right before signUp and I only get one.
    g
    j
    • 3
    • 6
  • b

    Blade

    07/27/2022, 4:45 PM
    I'm having troubles with
    @supabase/auth-helpers-sveltekit
    which always throws the
    Error: Not found: /api/auth/user
    error. That route is a auth-helper specific endpoint, so I'm unsure how to fix this. Auth still works, it just keeps throwing errors on every page load & visibility change
    s
    g
    • 3
    • 29
  • s

    silentworks

    07/27/2022, 5:01 PM
    Supabase Auth Helpers SvelteKit
  • a

    anderjaska

    07/27/2022, 5:34 PM
    If I have a postgres trigger on user signup, does
    signUp
    not resolve until the trigger runs? Or is the trigger completely asynchronous?
    s
    • 2
    • 5
  • a

    anderjaska

    07/27/2022, 5:48 PM
    Okay, so now im getting a weird one. I created a table called "Profile" which is visible on the web app, but if I connect to the database directly (say with table plus) I don't see the table at all...
    Copy code
    create table Profile (
      id uuid unique not null,
      updated_at timestamp with time zone,
        email text,
      primary key (id)
    );
    s
    g
    • 3
    • 33
  • j

    jvocodes

    07/27/2022, 7:01 PM
    Hi all - I'm getting an error message that I don't quite understand and I'm hoping someone can help me with it. I have a get request on my Express server with the following code:
    Copy code
    app.get("/api/v1/upvotes/:id", async (req, res) => {
      let { data: upvotes, error } = await supabase
        .from("votes")
        .select("upvote")
        .eq("album_id", req.params.id)
        .eq("upvote", true);
    
      if (upvotes) console.log("worked", upvotes);
      if (error) console.log(error);
    
      res.status(200).json({
        status: "success",
        results: upvotes?.length,
        data: { upvotes },
      });
    });
    g
    • 2
    • 5
1...757677...81Latest