How can i creating or updating multi record in db

I don’t want use loop to create single record to db, so how can i creating or updating multi record in db?
Thank you if you have any idea for help me !

The data tables in Anvil are built to be used with python loops for inserting, deleting or updating multiple records of data, there is no other type of access to the anvil data tables unless you have the Dedicated plan or higher and the requisite PostgreSQL knowledge to correctly insert your data without breaking your app.

See :

If the anvil data tables are not what you are looking for to store your data, you can also use anvil-uplink to connect using python to any other machine that you control that has internet access and can run a database of your choosing.

You can always wrap the loop in a transaction.

2 Likes

@ianb Can you update the DB remotely with the hobby plan?

Also is there a quick-start app for the anvil-uplink to quickly test this functionality.

Thanks

You can interact with the data tables service directly using anvil-uplink and you can do anything that a server module can do unless you create a client-only access uplink key.

I think the only limitations are a 4mb python object size when writing directly to the data tables (other than media objects) but that might be from a long time ago and might no longer be the limit, and 4mb is very large just for one cell/row tbh.

If you are asking can you access the db using direct SQL queries, you cannot do that with the hobby plan, uplink or otherwise.