https://supabase.com/ logo
Join Discord
Powered by
# off-topic
  • t

    Tiger Abrodi 🐆

    11/23/2021, 3:09 PM
    i saw it
  • l

    letourpowerscombine

    11/23/2021, 4:19 PM
    I'm getting
    "FetchError: XMLHttpRequest is not defined"
    when making Supabase calls on a Cloudflare Pages deployment. I also noticed this issue (https://github.com/supabase/supabase-js/issues/154) which seemed relevant. I followed that advice, doing the
    createClient
    with a defined fetch method — but I'm still encountering the error. Here's the request to Supabase:
    Copy code
    javascript
    // import supabase from "$lib/db"
    import { variables } from '$lib/variables';
    
    import { createClient } from '@supabase/supabase-js'
    
    const supabase = createClient( import.meta.env.VITE_SUPABASE_URL,
        import.meta.env.VITE_SUPABASE_ANON_KEY, { fetch: customFetch })
    
    export async function post(request) {
    
    const {data, error} = await supabase
    .from('support_responses')
    .insert({support_info: request.body.get('support_info'), introduction: request.body.get('introduction'), contact: request.body.get('contact'), loaded_location: request.body.get('loaded_address'), searched_location: request.body.get('address')})
    
    if (error) {
    return {
        status: 500,
        body: error
      }
    }
    else {
    
    return {
        status: 200,
        body: {
          data
        }
      }
    }
    
    }
    Can someone help me write the
    customFetch
    function that could make this work? EDIT: Solved, solution in the same GitHub thread. Had to update supabase to 1.28 and use this syntax
    Copy code
    const supabase = createClient( import.meta.env.VITE_SUPABASE_URL,
        import.meta.env.VITE_SUPABASE_ANON_KEY, { fetch: (...args) => fetch(...args)  })
  • h

    Hal

    11/23/2021, 4:29 PM
    hey guys, is it fine to expose the user id (from auth) or is there any security risk even with rls enabled?
  • b

    btelles

    11/23/2021, 5:00 PM
    The limitations of "functions" as a service seem widespread. What was your calculus when comparing creating Supabase functions compared to a container-based cloud function system? Here are some limitations I've read/experienced with cloud functions (1) managing medium to large projects is difficult with tiny functions spread throughout codebase (2) AWS Lambda seems to lock you in, (3) Google Cloud Functions don't allow you to specify hardware spec (e.g. if you need a more memory), incur a long cold start, and seem to be more expensive. If you have predefined containers with sensible defaults you'd have quite similar functionality to cloud functions , and if you allow users to create their own images, you'd be opening up the system to larger-scale projects and remove some of the vendor lock (which I think you mention is one of the core values you're shooting for). Any thoughts?
  • u

    user

    11/23/2021, 5:28 PM
    hello 😄
  • u

    user

    11/23/2021, 5:30 PM
    its okay, because the authentication company only share enough information through the api. if the company exposes it already, why cant we expose them
  • a

    Adi

    11/23/2021, 6:01 PM
    I recently started with supabase. Just wanted to know how can we do schema migration in supabase? Any tool which you would recommend?
  • h

    Hal

    11/23/2021, 6:04 PM
    this one is quite nice: https://www.slip.so/tutorials/database-migrations-in-supabase-with-migra
  • a

    Adi

    11/23/2021, 7:03 PM
    I was reading this https://github.com/supabase/supabase/discussions/134#discussioncomment-1228861 This guy mentioned diff migration does not actually migrate data content in that case what would you suggest?
    s
    • 2
    • 2
  • s

    silentworks

    11/23/2021, 7:26 PM
    Migration tool
  • w

    willm

    11/24/2021, 6:29 AM
    if I'm using an API outside of supabase with supabase auth, is there a way for me to get a jwt for logged-in users that I can send to the API?
  • w

    willm

    11/24/2021, 6:30 AM
    I don't see anything in the user object
  • a

    anothercoder

    11/24/2021, 8:53 AM
    When the user calls signIn, the user's jwt is returned as access_token in the response.
  • u

    user

    11/24/2021, 1:18 PM
    I wan to integrate this provider in sms providers where do I start https://www.gupshup.io/developer/docs/bot-platform/guide/international-sms-api-documentation-en
  • v

    VuNguyen

    11/24/2021, 2:24 PM
    anyone facing query problem with supabase? i cant query from supbase
  • j

    jumpship

    11/24/2021, 2:52 PM
    I'm confused by how
    in()
    is working
  • j

    jumpship

    11/24/2021, 2:52 PM
    .in("field", [1, 2]) // works
  • j

    jumpship

    11/24/2021, 2:52 PM
    but
  • j

    jumpship

    11/24/2021, 2:52 PM
    .in("field", []) // doesn't work
  • j

    jumpship

    11/24/2021, 2:53 PM
    the values are a function of state in my React app, so sometimes the values I'll have there will be empty. How do I pass empty/nothing there as value?
  • j

    jumpship

    11/24/2021, 2:53 PM
    Is there some sort of
    .in("field", [*])
    or equivalent?
  • j

    jumpship

    11/24/2021, 2:55 PM
    To backup, I'm storing values between 1 and 5 for
    field
    . I'm filtering my table by this field, and so I want to get any values I specify, or if I don't specify any, I want all the results
  • j

    jumpship

    11/24/2021, 2:55 PM
    I'd expect
    .in("field", [])
    to return all results, but instead it returns none
  • j

    jumpship

    11/24/2021, 2:57 PM
    I could of course just do
    .in("field", [1, 2, 3, 4, 5]);
    but that feels a bit weird(?)
  • g

    garyaustin

    11/24/2021, 3:25 PM
    Well .in only finds records that match values in the array, so nothing matches []. I just would have logic to not add the .in into my query if the array.length = 0.
  • b

    btelles

    11/24/2021, 4:09 PM
    Gentle ping to anyone at Supabase?
  • j

    jumpship

    11/24/2021, 4:16 PM
    Yeah that's true. That's what I should be doing. kk appreciated!
  • j

    jumpship

    11/24/2021, 4:46 PM
    Any idea by chance what that would look like?
    g
    m
    • 3
    • 11
  • j

    jumpship

    11/24/2021, 4:46 PM
    Copy code
    async function fetchCandidates() {
            let { data, error, status, count } = await supabase
                .from("users")
                .select("*")
                .eq("role", "developer")
                cssIsEmptyArray? '' : .in('css', filters.find(item =>item.skill === 'css').active) 
                
                return data
        }
  • j

    jumpship

    11/24/2021, 4:47 PM
    I need to do some kind of ternary like this I'm I'm thinking, but I can't think of the proper approach
1...142143144...392Latest