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

    JayStavis

    12/23/2021, 8:47 PM
    Hiya folks, I'm trying to implement a simple counter / incrementer for my
    event_count
    table. I create a function in the SQL Editor:
    Copy code
    sql
    create function increment (event_type text, incrementvalue int)
    returns void as
    $$
      update event_count
      set count = count + incrementvalue
      where event_type = event_type
    $$
    language sql volatile
    and I call this function from client js:
    Copy code
    js
    export const incrementEvent = async ({event_type}) => {
      const { data, error } = await supabase
        .rpc('increment', {event_type : event_type, incrementvalue : 1}); // value is amount to increment by
      if (error) console.log(error.message)
      return data
    }
    However, I get this console.log() error message:
    Could not find the public.increment(incrementvalue) function or the public.increment function with a single unnamed json or jsonb parameter in the schema cache
    Any ideas? I couldn't figure out how to update the schema cache, but in the Supabase WebUI --> Database --> Functions I definitely have the increment function in the
    public
    schema.
  • a

    aresnick

    12/23/2021, 10:13 PM
    It seems that this might not be possible without access to superuser privileges, which I gather is no longer possible— Is that accurate? While I can add
    postgres
    to
    supabase_admin
    and
    supabase_auth_admin
    , it seems that things like adding event triggers won't be possible without being a superuser. Is this right? There's no way to clone an existing Supabase DB for purposes of staging?
  • f

    Frank P

    12/24/2021, 3:46 AM
    hello I am using the csharp library for signup and I cant seem to match user metadata to the signup email confirmation template. var response = await _client.Auth.SignUp(email, password, new Dictionary { { "data", new { full_name = "Joe" } }}); email template: {{ .full_name }} using this as reference: https://supabase.com/docs/reference/javascript/auth-signup#sign-up-with-additional-user-meta-data When I disable the "email confirmation required" I do see the metadata is associated with the created user.
  • v

    Village

    12/24/2021, 6:33 AM
    What auth level does Supabase Studio use?
  • t

    thyme

    12/24/2021, 8:09 AM
    What happens if we reach the max cpu usage on our dB? Does supabase automatically scale that for us on the pro plan? Looking for information on how this is handled
  • j

    jaf

    12/24/2021, 9:41 AM
    Hi everyone, I have column
    user_id
    that references
    auth.users.id
    (foreign key). What do I need to do to autofill that column based on the authenticated user? I'm using JS:
    const { data, error } = await supabase.from('table').insert([{ item: item }])
  • h

    HugoRaynal

    12/24/2021, 9:58 AM
    help with pg_bouncer
  • a

    Anoushk

    12/24/2021, 10:22 AM
    im using third party auth with discord and supabase
  • a

    Anoushk

    12/24/2021, 10:22 AM
    how do i get the servers the user is in
  • k

    ktosiek

    12/24/2021, 10:42 AM
    Hi! Is there some list of all values I can expect for
    #type=...
    redirects?
  • s

    sanketc

    12/24/2021, 4:34 PM
    Hey folks, trying to set up a self host instance for dev and seeing this
    Error: getaddrinfo ENOTFOUND postgres
    when I try to access supabase studio after docker-compose. I do have the env file that has the right postgres pw and port info, what else could I be doing wrong?
  • t

    TremalJack

    12/24/2021, 6:06 PM
    hello, is possible parse a custom parameter an value to header on every api call? I need handle guest / user case, I want avoid to register the guest like an user, so the more easy approach is parse into request an custom parameter on header with the fingerprint of the guest and then handle with a function on postgress the RLS
  • t

    TremalJack

    12/24/2021, 6:07 PM
    but Im not finding anything about add a custom header paramenter on api
  • m

    Maz

    12/24/2021, 6:44 PM
    I've been struggling with Supabase user's being null on the server but not on the client. On the server I'm using
    supabase.auth.api.getUserByCookie(req)
    (using next.js), and on the client I'm using
    supabase.auth.user()
    . What often happens is in a pretty short time period after authentication (30 mins or so), the
    getUserByCookie
    starts returning null, but
    supabase.auth.user()
    correctly resolves the user on the client. I still have the sb:token cookie and it's not expired yet, so I'm confused why that's not working Any idea what I might be doing wrong?
    s
    r
    • 3
    • 23
  • m

    Maz

    12/24/2021, 6:46 PM
    Looks similar to this issue but I'm not using middleware https://github.com/supabase/supabase/issues/3783
  • f

    Frank P

    12/24/2021, 8:23 PM
    how do you map parameters to the email templates for email confirmation?
  • f

    Frank P

    12/24/2021, 9:17 PM
    been trying to figure it out for 3 days now
  • f

    Frank P

    12/24/2021, 9:19 PM
    Copy code
    Example
    var response = await _client.Auth.SignUp(email, password,
                        new Dictionary<string, object> {
                            { "full_name", "John Doe" },
                            { "first_name", "John" },
                            { "last_name", "Doe" },
                            { "number", 10 },
                            { "FullName", "John Doe" },
                            {
                                "redirectTo", "https://google.com"
                            }
                        });
  • t

    tourdownunder

    12/24/2021, 11:01 PM
    I found the github issue on this https://github.com/supabase/supabase/issues/3944 From the example on the screen grab: should you try something like?
    Copy code
    js
    var response = await _client.Auth.SignUp(
      {
        email:"john.dow@example.com",
        password:"mypassword",
      },
      {
         data :{
          full_name: "John Doe", 
          first_name: "John",
          last_name: "Doe",
        }
      }
    );
  • b

    birdiewd

    12/24/2021, 11:36 PM
    Does anyone know if there is currently an issue with supabase getting email addresses from twitter auths?
  • f

    Frank P

    12/24/2021, 11:38 PM
    @tourdownunder the Metadata for the user is recorded the way I have it. I confirmed it after signing up a user and then retrieving it by the uuid. But I am unable to match the parameters of the email template.
  • t

    tourdownunder

    12/24/2021, 11:40 PM
    my sample app uses twitter auth. You can try https://www.tourdownunder.net/ and I will be able to take a look.
  • m

    Muphet

    12/24/2021, 11:40 PM
    what is the correct way of using realtime subscription? i have an app and i use realtime feed only in one place to fetch logs. however i constantly keep getting an error
    Uncaught tried to push 'access_token' to 'realtime:public:profile' before joining. Use channel.subscribe() before pushing events
  • b

    birdiewd

    12/24/2021, 11:42 PM
    That worked. Not sure what my issue is then. Do you have a 3-legged auth option in your twitter dev settings? I do not.
  • t

    tourdownunder

    12/24/2021, 11:46 PM
    Not sure what you mean by 3 legged though settings are.
  • b

    birdiewd

    12/24/2021, 11:49 PM
    Damn, that is exactly what I have!
  • b

    birdiewd

    12/25/2021, 1:36 AM
    Hello all. I'm having some issues with getting my twitter authentication working. The user can see my app listed in their profile as having access, but supabase provides the following error on redirect:
    ?error=server_error&error_description=Error+getting+user+email+from+external+provider
    Here are my settings in twitters dev portal:
    t
    g
    m
    • 4
    • 11
  • b

    birdiewd

    12/25/2021, 1:50 AM
    Twitter auth not able to get email from user
  • a

    Anoushk

    12/25/2021, 5:40 AM
    i have 2 rows with the a column that has the exact same value
  • a

    Anoushk

    12/25/2021, 5:40 AM
    yet when i query the data i get only one row
1...171172173...316Latest