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

    donpuerto

    08/12/2021, 3:02 PM
    @User Yes it is undefined. It wont accept the Object thou this things below works
    Copy code
    ts
    
    const deletePhoneById = async (id: number) => {
      const { data, error } = await supabase
            .from('phones')
            .delete()
            .eq('id', id)
    }
  • j

    jjj.westra

    08/12/2021, 3:10 PM
    replace phone.id with this;
    Copy code
    (phone.id ? phone.id : undefined)
  • j

    jjj.westra

    08/12/2021, 3:10 PM
    id can be undefined, but if the whole property id is non existant it might complain about that
  • j

    jjj.westra

    08/12/2021, 3:10 PM
    anyway success 🙂 gotto go
  • u

    user

    08/12/2021, 3:39 PM
    Is there a supabase client for node.js? I tried going for python but it seems that API is a bit too alpha at the moment but it seems like the supabase client for javascript is currently designed for the frontend. Am I correct?
  • u

    user

    08/12/2021, 3:39 PM
    I should admit: I'm definitely more of a python person than a JS person.
  • l

    Lucho Suárez

    08/12/2021, 3:41 PM
    You can run supabase-js in node.
    const { createClient } = require('@supabase/supabase-js')
    and you're good to go
  • u

    user

    08/12/2021, 3:42 PM
    I tried that. But I got this error:
    Copy code
    $ node-demo npm i supabase        
    $ node-demo node
    > const { createClient } = require('@supabase/supabase-js')
    
    Uncaught Error: Cannot find module '@supabase/supabase-js'
    Require stack:
    - <repl>
        at Function.Module._resolveFilename (node:internal/modules/cjs/loader:941:15)
        at Function.Module._load (node:internal/modules/cjs/loader:774:27)
        at Module.require (node:internal/modules/cjs/loader:1013:19)
        at require (node:internal/modules/cjs/helpers:93:18) {
      code: 'MODULE_NOT_FOUND',
      requireStack: [ '<repl>' ]
    }
  • s

    Scott P

    08/12/2021, 3:44 PM
    The package is
    @supabase/supabase-js
    , not just
    supabase
  • u

    user

    08/12/2021, 3:44 PM
    Ah!
  • u

    user

    08/12/2021, 3:45 PM
    Grand. That was my bad. Thanks @User @User !
  • l

    Lucho Suárez

    08/12/2021, 4:01 PM
    is there something happening with the site? I can't load it on my computer (Chome, Brave, Safari or FF) or my phone (Chrome or Brave), either with WiFi or the mobile network. But if I connect to a VPN in a different State (California for example), it loads just fine on my phone.
  • p

    perogies

    08/12/2021, 4:56 PM
    @User is it possible to add non-public tables to the Table Editor within the supabase UI? Additionally, can non-public schemas be exposed in the API? I have added the desired schema to
    Settings-->Project-->API-->Settings-->Extra Search Path
    , but it doesn't affect anything in the UI...no endpoints are created.
    s
    • 2
    • 1
  • p

    perogies

    08/12/2021, 5:00 PM
    Is this a bug or the desired behavor? Is the effect to only change the schemas I should see from
    select current_schemas(True);
    ?
  • s

    Steve

    08/12/2021, 5:47 PM
    Table Editor non-public tables
  • e

    eyk

    08/12/2021, 6:30 PM
    Hey, is there a way to get a userId by their email? Sth like
    supabaseAdmin.auth.getUserByEmail(email)
    or
    supabaseAdmin.from("auth.users").select("id").eq("email", email)
    ?
    b
    • 2
    • 1
  • b

    burggraf

    08/12/2021, 7:02 PM
    Get User By Email
  • m

    Maus

    08/12/2021, 7:06 PM
    Somebody got an idea of what I'm doing wrong trying to use the
    supabase/pgadmin-schema-diff
    , I get the following error:
    Copy code
    Starting schema diff...
    Comparision started......0%
    Traceback (most recent call last):
      File "cli.py", line 272, in <module>
        diff_result = message + 'BEGIN;\n\n' + '\n'.join(x.get('diff_ddl') for x in response_data['data'] if x.get('status') != 'Identical' and in_db_objects(x.get('type'), args)) + '\n\nEND;'
    TypeError: 'NoneType' object is not iterable
  • s

    Steve

    08/12/2021, 7:37 PM
    Oh, that looks like a bug. Could you share a sample DDL that reproduces the issue and report it on https://github.com/supabase/pgadmin4/issues?
    m
    • 2
    • 2
  • m

    Maus

    08/12/2021, 8:02 PM
    possible-bug pgadmin-schema-diff
  • w

    wenbo

    08/13/2021, 12:08 AM
    Realtime Type Conversions
  • d

    donpuerto

    08/13/2021, 1:19 AM
    HI how to order foreign table? **Tables: - Users - Profile - Phones --> I want to ORDER some column here?
    Copy code
    js
    const { data, error, status } = await supabase
              .from('users')
              .select(`
                *,
                profile(*),
                phones(*)
              `)
              .eq('id', id)
              .single()
  • k

    Khan W

    08/13/2021, 1:28 AM
    Is there a way to filter Realtime queries? I can subscribe to a table like so:
    Copy code
    javascript
    const mySubscription = supabase
      .from('todos')
      .on('*', payload => {
        console.log('Change received!', payload)
      })
      .subscribe()
    But if I needed to query using an
    ILIKE
    do I need to make a custom view in postgres? Or is there a way to filter the above subscription
  • s

    Steve

    08/13/2021, 1:50 AM
    Check https://supabase.io/docs/reference/javascript/order#with-embedded-resources
  • s

    stibbs

    08/13/2021, 1:52 AM
    I have a settings table with a row per user, at the moment it creates a row when they first do anything with their settings - is there a way I can get it to auto create the row w/ default values when they sign up (i.e. a new uid is created)?
  • s

    stibbs

    08/13/2021, 1:53 AM
    I'm wondering if there's a better way than just adding it to the sign up flow?
  • d

    donpuerto

    08/13/2021, 2:33 AM
    @User But how to put ascending order? This is really very cryptic doc
  • s

    stibbs

    08/13/2021, 3:03 AM
    Or alternatively, should I add the settings fields to my user itself? I DO need access to the settings throughout the app so that probably makes a lot of sense.....
  • f

    fergus

    08/13/2021, 3:48 AM
    This morning I was getting 42P01 table undefined errors on my local supabase instance. the entire public schema was corrupted. Stopped and restarted. Still corrupted. So I deleted the instance in Docker. Init Supabase and restored the public schema. All fine. Is this a bug I should report? And could this be a production bug?) And why is it that the CLI Init always creates the same random anon and private Keys? Oh and I wonder how soon we'll be able to use postgres 13 in the local instance?
  • k

    Khan W

    08/13/2021, 5:08 AM
    For anyone wondering, it looks like the Realtime API supports filtering by a column value but the
    supabase-js
    library doesn’t come with a way to do that
1...484950...316Latest