All URIs are relative to /
Method | HTTP request | Description |
---|---|---|
create_database | PUT /dbs/{db_name} | Create Database |
delete_database | DELETE /dbs/{db_name} | Delete Database |
get_database_list | GET /dbs | List databases |
InlineResponse2011 create_database(db_name, body=body)
Create Database
Create Database with identifier name
from __future__ import print_function
import time
import XataClient
from XataClient.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = XataClient.DatabaseApi(XataClient.ApiClient(configuration))
db_name = XataClient.DBName() # DBName | The Database Name
body = XataClient.DbsDbNameBody() # DbsDbNameBody | (optional)
try:
# Create Database
api_response = api_instance.create_database(db_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling DatabaseApi->create_database: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
db_name | DBName | The Database Name | |
body | DbsDbNameBody | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_database(db_name)
Delete Database
Delete a database and all of its branches and tables permanently.
from __future__ import print_function
import time
import XataClient
from XataClient.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = XataClient.DatabaseApi(XataClient.ApiClient(configuration))
db_name = XataClient.DBName() # DBName | The Database Name
try:
# Delete Database
api_instance.delete_database(db_name)
except ApiException as e:
print("Exception when calling DatabaseApi->delete_database: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
db_name | DBName | The Database Name |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListDatabasesResponse get_database_list()
List databases
List all databases available in your Workspace.
from __future__ import print_function
import time
import XataClient
from XataClient.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = XataClient.DatabaseApi(XataClient.ApiClient(configuration))
try:
# List databases
api_response = api_instance.get_database_list()
pprint(api_response)
except ApiException as e:
print("Exception when calling DatabaseApi->get_database_list: %s\n" % e)
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]