Where in the dashboard?
# off-topic
m
Where in the dashboard?
a
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
Okay
a
Maybe the mods can help you with this.
@User
m
And do you know how I can manually add data into a table that has a serial id?
s
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
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
That might be caused by the data type of "id" on the table that you have created.
m
it's of type serial
a
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
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
UUID might be more preferrable in the long run.
s
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
Sorry, helping about what?
o
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
Can I autogenerate uuid within supabase or needs to come from my app?
s
They can be autogenerated if you set the field to do that
3 Views