https://supabase.com/ logo
Join Discord
Powered by
# sql
  • v

    victorbjorklund

    07/30/2021, 12:42 PM
    One way to do it just storing json. So title field would contain {"en": "this is a title", "sv": "det här är en titel"}
  • v

    victorbjorklund

    07/30/2021, 12:45 PM
    So i'm trying to build a time tracker for reporting. How would I restrict so that a user can't have overlapping time entries? It's for tracking work so the same user can't work at double at the same time. Any constaints I can set in the DB to avoid possibility for overlapping entries from the same user?
    k
    b
    • 3
    • 11
  • k

    Kosh

    07/30/2021, 1:07 PM
    Column constraint
  • s

    sylar815

    07/30/2021, 1:52 PM
    Will this slow down the queries?
  • s

    sylar815

    07/30/2021, 1:53 PM
    Yes this is one idea, figuring out best possible options.
  • v

    victorbjorklund

    07/30/2021, 1:55 PM
    not sure. We didnt have any complicated queries (just getting all articles etc). if you need to implement some kind of search function it might matter not sure
  • s

    sylar815

    07/30/2021, 1:56 PM
    Okay, locales will keep on adding.. What you suggested will go with the current architecture I have. Lets see. If anyone has a better suggestion.
  • d

    DharmaraJ

    07/31/2021, 6:48 PM
    Is there any way I could check if a name exists in
    name
    column of my table? I'd like to throw an error if it does.
    s
    k
    • 3
    • 38
  • d

    DharmaraJ

    07/31/2021, 6:49 PM
    or will I have to do a 2 step process? check if exists then manually throw error?
  • k

    Kosh

    07/31/2021, 6:50 PM
    Constraints are ur best friends
  • k

    Kosh

    07/31/2021, 6:50 PM
    Or make the name also a primary id :)
  • d

    DharmaraJ

    07/31/2021, 6:50 PM
    Sorry I'm using SQL first time. Can you please explain? Let go in that thread above ^
  • o

    Olyno

    07/31/2021, 10:34 PM
    Hi Does anyone already worked with triggers? I tried that but as you can see, I get an error and I don't really know why :/
    s
    k
    f
    • 4
    • 35
  • b

    BigBear

    07/31/2021, 11:33 PM
    Hi, new Supabase user here. I'm wondering whether it's possible to connect to Supabase database using the 'regular' postgres Python libraries /ORMs (i.e. where you normally need a host/port and username, password).
    s
    m
    • 3
    • 5
  • s

    s u s h i

    08/01/2021, 6:07 AM
    hello guys I saw in the supabase website that triggers are not yet "production ready". did some of you tried using it? and if so, is it okay to create triggers? because I really enjoy having them
  • o

    oskar

    08/01/2021, 7:24 AM
    Hello, I'm trying to use the local supabase but apparently
    gen_random_uuid()
    doesn't exist. How do I enable it? It works on the online, hosted supabase database. (UPDATE: fixed by dropping and creating the pgcryto extension)
  • o

    oskar

    08/01/2021, 7:26 AM
    Second question, are the default SQL schemas (initial, auth and storage) supposed to be ran automatically when self-hosting? Seems they are not, just checking.. (https://github.com/supabase/supabase/tree/master/docker/dockerfiles/postgres)
  • d

    DbD

    08/01/2021, 10:54 AM
    What is your postgresql version ? you need 13 for gen_random_uuid
  • d

    DharmaraJ

    08/01/2021, 11:02 AM
    Do I need to add userId column in SQL if I need to get a specific user's posts?
    u
    • 2
    • 9
  • d

    DharmaraJ

    08/01/2021, 11:02 AM
    I'm not sure what that Foreign key relation is
  • d

    DyingAlbatross

    08/01/2021, 6:21 PM
    Anyone know if it's possible to create a procedure that's only callable with the service role?
    s
    k
    • 3
    • 11
  • s

    silentworks

    08/01/2021, 7:50 PM
    Creating a process only callable by the service role
  • o

    oskar

    08/02/2021, 10:08 AM
    Hi, what's your preferred GUI for inspecting Postgres or saving some queries etc? I've been using Beekeeper which is alright, but thinking there must be something nicer out there.
  • a

    Azura

    08/02/2021, 10:18 AM
    PopSQL works too.
  • a

    Azura

    08/02/2021, 10:18 AM
    But it has a pricing model, if you need additional features
  • s

    silentworks

    08/02/2021, 11:16 AM
    Beekeeper is limited in features when compared to others on the market, TablePlus, DataGrip, ArchType and others. I'm more of a TablePlus person.
  • o

    oskar

    08/02/2021, 11:18 AM
    Guess we should have made a thread again, but thanks guys. TablePlus and PopSQL both look like improvements
  • u

    0xhjohnson

    08/02/2021, 12:40 PM
    user specific posts
  • s

    Señor Bruno

    08/02/2021, 4:19 PM
    Is it possible to get the connectionstring for the database?
  • k

    Khan W

    08/02/2021, 4:46 PM
    Yes! Let me find it quick
12345...52Latest