https://supabase.com/ logo
#off-topic
Title
# off-topic
m

milestones95

07/31/2021, 2:59 PM
Where in the dashboard?
a

Azura

07/31/2021, 3:03 PM
I'm not sure if you can import a .csv file to an existing table but you always have the option to import .csv file when creating a new table in the Dashboard.
m

milestones95

07/31/2021, 3:03 PM
Okay
a

Azura

07/31/2021, 3:04 PM
Maybe the mods can help you with this.
@User
m

milestones95

07/31/2021, 3:04 PM
And do you know how I can manually add data into a table that has a serial id?
s

Scott P

07/31/2021, 3:04 PM
If you're not keen to recreate the table, one option is PgAdmin which will let you import CSV If you need something more automated/scriptable, there are node libs like
pg-copy-streams
which can help with it
m

milestones95

07/31/2021, 3:05 PM
If I manually insert a new row I get a duplication error for some reason instead of the table creating an Id 1 number higher
a

Azura

07/31/2021, 3:06 PM
That might be caused by the data type of "id" on the table that you have created.
m

milestones95

07/31/2021, 3:07 PM
it's of type serial
a

Azura

07/31/2021, 3:07 PM
If you don't want the id to be +1 higher than the previous one (auto-generated ids) then you can visit: https://app.supabase.io/project/{your-project-id}/editor/table and then click on
id
attribute
Set default value to null
See if it helps.
s

Scott P

07/31/2021, 3:09 PM
If you set a default of
nextval('table_name_id_seq')
(you'd replace
table_name
with the name of your table I believe), it should work. You're going to be limited to 2147483647 rows with serial though
UUID has 128 bits, so there's 2^122 possible combinations, and it can be auto generated with
uuid_generate_v4()
a

Azura

07/31/2021, 3:12 PM
UUID might be more preferrable in the long run.
s

Scott P

07/31/2021, 3:13 PM
I agree. Any place where I'm using in need of an ID, I'd rather have something that I have to copy-paste than hoping I've got the right number (e.g. if I'm deleting a row). It's also a lot more difficult to guess a UUID, so while it won't fix any glaring security issues, it can help reduce people randomly guessing an ID
o

Olyno

07/31/2021, 3:17 PM
Sorry, helping about what?
o

Olyno

07/31/2021, 3:21 PM
I mean, how a mod could help with that? xD
Like it's not related to the server, it's just a question about dev
And to answer to the question as a developer and not a mod: I think we can't load a csv for now, but it could be a good feature. Don't hesitate to ask this feature here: https://github.com/supabase/supabase-js/discussions
m

milestones95

07/31/2021, 4:49 PM
Can I autogenerate uuid within supabase or needs to come from my app?
s

silentworks

07/31/2021, 4:51 PM
They can be autogenerated if you set the field to do that
3 Views