Links

Database

DoltHub provides a database API for fetching and creating data on your database. You can create a database, create a pull request, create a pull request comment, and merge a pull request through these APIs.
Please make sure to send your requests to https://www.dolthub.com instead of https://dolthub.com.

Create database

Here's an example of how to create a new database called museum-collections under the organization dolthub using an authorization token.
Creating a database requires authentication, so you must include this authorization header in your request. See the Authentication section for more details.
headers = {
'authorization': '[api token you created]'
}
Oops, something is missing.
We could not find the original source to display this content.

Creates pull request

Here is an example of opening a pull request on the museum-collections database with data from the Los Angeles County Museum of Art. This data was added to the lacma branch on a fork database, whose owner is liuliu, we would like to eventually merge lacma branch into the main branch using an authorization token.
Include this header in your request.
headers = {
'authorization': '[api token you created]'
}
Oops, something is missing.
We could not find the original source to display this content.

Create a pull request comment

Here is an example of adding a pull request comment using an authorization token.
Include this header in your request.
headers = {
'authorization': '[api token you created]'
}
Oops, something is missing.
We could not find the original source to display this content.

Merge pull request

Here is an example of merging a pull request #66 on a database museum-collections using an authorization token. Note that the merge operation is asynchronous and creates an operation that can be polled to get the result.
To poll the operation and check its status, you can use the operationName in the returned response of the merge request to query the API. Once the operation is complete, the response will contain a job_id field indicating the job that's running the merge, as well as other information such as the repository_owner, repository_name, and pull_id.
Keep in mind that the time it takes for the merge operation to complete can vary depending on the size of the pull request and the complexity of the changes being merged.
Include this header in your request with the API token you created.
headers = {
'authorization': '[api token you created]'
}
Oops, something is missing.
We could not find the original source to display this content.
Then use GET to poll the operation to check if the merge operation is done.
Oops, something is missing.
We could not find the original source to display this content.
Last modified 27d ago