Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support batch POST (for columns for starters) #182

Open
soedirgo opened this issue Feb 16, 2022 · 4 comments · May be fixed by #608
Open

Support batch POST (for columns for starters) #182

soedirgo opened this issue Feb 16, 2022 · 4 comments · May be fixed by #608
Labels
enhancement New feature or request

Comments

@soedirgo
Copy link
Member

Feature request

Is your feature request related to a problem? Please describe.

Creating a table with multiple columns is pretty slow. Supporting batch POST would save us a couple round trips and remedy that.

Describe the solution you'd like

Make POST accept a list of objects in addition to a single object. e.g.:

POST /columns
[
  { "table_id": 123456, "name": "c1", "type": "text" },
  { "table_id": 123456, "name": "c2", "type": "text" }
]
@soedirgo soedirgo added the enhancement New feature or request label Feb 16, 2022
@mahendraHegde
Copy link

@soedirgo I'd like to take a crack at it.
I understand that we need to support both object and array of objects in POST body of /columns, let me know if there anything else i need to be aware before starting.

@soedirgo
Copy link
Member Author

soedirgo commented Sep 5, 2023

Go for it @mahendraHegde!

we need to support both object and array of objects in POST body of /columns

Yup, ideally we also do the batch create in one db query, so we might also need to modify PostgresMetaColumns in lib (instead of just the server)

@mahendraHegde
Copy link

mahendraHegde commented Sep 5, 2023

@soedirgo yes makes sense i will modify the PostgresMetaColumns.create to accept the array and return array. How ever i have a doubt,
since each object of the array will have table_id, so should we assume every row for the same table or are we supposed to support multiple table alter as well?

@mahendraHegde mahendraHegde linked a pull request Sep 5, 2023 that will close this issue
@mahendraHegde
Copy link

@soedirgo i have made the changes for single table batch update, since its my 1st contribution to this repo plz give your feedback, i will add & fix tests meanwhile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants