https://supabase.com/ logo
Join DiscordCommunities
Powered by
# help
  • j

    jmnoz

    09/10/2021, 2:35 PM
    @User Thanks! Will try it
  • z

    zakaria.chahboun

    09/10/2021, 3:57 PM
    Hi everyone I know how to upload a file by JavaScript API. But i have a lot of files, And i want to upload them all one time. If there is an exception then just revoke the upload! https://github.com/supabase/supabase/discussions/3147
  • j

    jmnoz

    09/10/2021, 4:07 PM
    I am trying to find out how to redirect the user after signin with supabase in my NextJs project. Anyone have an idea? e.g the user is at /route and hits signin, then I want them to be redirected back to
    /route
    on sucessful signin
  • u

    user

    09/10/2021, 4:28 PM
    The way I did it using next/router: From /route in your redirect you'll need to add:
    Copy code
    router.push({
                    pathname: '/signin',
                    query: { from: router.pathname },
                })
    Then in your /signin onSubmit event handler, after you've sent the data to supabase.auth.signIn, you can push them back to /route like so:
    Copy code
    if (router.query && router.query.from) {
         router.push(router.query.from)
    }
  • u

    user

    09/10/2021, 4:29 PM
    Obviously change the pathname to whatever your sign in path is
  • j

    jmnoz

    09/10/2021, 4:31 PM
    @User Thanks!
  • a

    andregoldstein

    09/10/2021, 4:46 PM
    Hey guys, I'm building a sort of Trello-like clone mainly as a way of learning the process. I've got a list of tasks that I'm reordering successfully in the UI and now wondering what the best way of updating those Tasks would be using the API. Do you have to provide the whole object when updating? Am imagining that each task will have an order number and that I will probably have to update say 5 tasks and their order number. Thanks for any tips! If not I guess I'll loop through the tasks and individually perform a match and update?
  • j

    jcarenza

    09/10/2021, 5:51 PM
    i'm having an issue with
    signIn()
    , it always returns:
    Copy code
    400 POST /auth/v1/token?grant_type=password
    {"error":"invalid_grant","error_description":"Invalid email or password"}
    signUp is working just fine, the user in the DB and session is valid. then if i
    signOut
    and try to log in with those created credentials it errors everytime. Using the standard login code from the docsite:
    Copy code
    const { user, session, error } = await supabase.auth.signIn({
            email: emailRef.current.value,
            password: passwordRef.current.value
    })
    I have
    Enable email confirmations
    turned off in the settings, and the api request shows the correct credentials in the payload. Any ideas on what could be the problem?
  • p

    Peanut

    09/11/2021, 1:30 AM
    Why does my search query not complete? The request has a 200 but no body so my app looks like crap because it is loading forever
  • p

    Peanut

    09/11/2021, 1:31 AM
    Is the SQL statement too intense and the SQL server dies?
  • p

    Peanut

    09/11/2021, 1:37 AM
    Now all of my SQL queries are slow as heck
  • r

    Rod

    09/11/2021, 1:52 AM
    How do you get the id of a column you just inserted? For some reason, when I try to use that id to insert another column, it shows up as null. I thought it returned the inserted column with the new id when you did an insert
  • p

    Peanut

    09/11/2021, 1:55 AM
    When you do an INSERT it should then do a SELECT which returns the created record: > By default, every time you run insert(), the client library will make a select to return the full record.
  • p

    Peanut

    09/11/2021, 1:55 AM
    If you use the JS client it will be in `data`:
    Copy code
    const { data, error } = await supabase
      .from('cities')
      .insert([
        { name: 'The Shire', country_id: 554 }
      ])
  • r

    Rod

    09/11/2021, 1:57 AM
    Yes, i’m trying to use data, but it’s null… hmmm
  • p

    Peanut

    09/11/2021, 1:57 AM
    Does
    data
    contain an array which contains your record?
  • r

    Rod

    09/11/2021, 1:57 AM
    the id at least
  • r

    Rod

    09/11/2021, 1:58 AM
    Oh, what is the structure of data?
  • p

    Peanut

    09/11/2021, 1:58 AM
    data
    should be an array where each item is the record inserted (because you can insert multiple records at once)
  • p

    Peanut

    09/11/2021, 1:59 AM
    https://supabase.io/docs/reference/javascript/insert
  • l

    Lothar

    09/11/2021, 2:56 AM
    Hey! I'm not sure if this is the best place to ask... I understand Supabase is great for handling scaling of a database, and even storage. But any recomendations on how to scale the actual hosting of a site? What would be the best option there? thanks!
    b
    j
    • 3
    • 5
  • b

    burggraf

    09/11/2021, 3:07 AM
    Scaling Hosting
  • f

    Fabian B.

    09/11/2021, 3:26 AM
    Hey there, I have a quick question regarding to the use of like/ilike together with or. I want to query data and filter multiple columns with ilike. Like this:
    Copy code
    const { data, error } = await supabase
      .from('notes')
      .select()
      .ilike('title', `%${ val }%`)
      // .or ...
    but I can't get the .or to work. I tried
    Copy code
    .or(`ilike.description.%${ val }%`)
    but it won't work. Does anybody have an idea? Thanks in advance!
  • p

    Poypoypoy

    09/11/2021, 7:34 AM
    its working now?
  • f

    Fabian B.

    09/11/2021, 7:45 AM
    @User Couldn't get it to work, solved it by fetching all and filtering the the data on client-side
  • t

    tdwcks

    09/11/2021, 8:48 AM
    Hey, I was wondering if someone could help me. I'm trying to .textsearch through the
    name
    column of an
    ingredients
    table.
    Copy code
    const searchIngredients = async (searchText : string) => {
        const { data, error } = await supabase
          .from<Ingredient>('ingredients')
          .select('name')
          .textSearch('name', searchText, { 
            type: 'phrase',
            config: 'english'
          })
      }
    But I get the error: > Property 'textSearch' does not exist on type 'PostgrestFilterBuilder'.
  • f

    Fabian B.

    09/11/2021, 9:22 AM
    @User do you use the supabase-js client?
  • t

    tdwcks

    09/11/2021, 9:25 AM
    Hey @User yes I am
  • f

    Fabian B.

    09/11/2021, 9:35 AM
    @User So from the error message, it seems that it has something to do with TypeScript. Unfortunately, I don't use TypeScript, so I can't help out with this. Maybe someone else here 😄. What you could check: Are you on the latest supabase-js version?
  • t

    tdwcks

    09/11/2021, 9:38 AM
    Thanks for looking into it anyway! I'm on
    1.1.2
1...828384...316Latest