dolthub / dolthub-issues

Issues for dolthub.com
https://dolthub.com
4 stars 1 forks source link

support multistatements in dolthub write API #510

Closed jon-mellon closed 6 months ago

jon-mellon commented 10 months ago

I would like to be able to send multiline SQL statements to the write API. Given the rate limits of the write API, it would be useful to be able to better bundle requests. When adding many rows to a single table, this can be done reasonably easily. However, some of my user request handling requires updates to multiple tables which would ideally be able to be done in a single API request rather than having to invoke a separate API call and polling workflow for the changes to each table.

As an example, it would be useful to be able to pass this combined set of SQL queries to the write API in one go:

CREATE TABLE test1 (
  id CHAR(36) default(UUID()),
  PRIMARY KEY (id)
);
CREATE TABLE test2 (
  id CHAR(36) default(UUID()),
  PRIMARY KEY (id)
);
liuliu-dev commented 7 months ago

Hi @jon-mellon , to execute multiple queries on the database, you can use the upload api, put all the queries in an SQL file and send it to this api endpoint.