configure_db_connection
Retrieve and configure OceanBase database connection details. Uses environment variables or user-defined parameters for host, port, user, password, and database. Ensures required fields are provided.
Instructions
Retrieve OceanBase database connection information.
If no parameters are provided, the configuration is loaded from environment variables.
Otherwise, user-defined connection parameters will be used.
:param host: Database host address. Defaults to environment variable OB_HOST or "localhost".
:param port: Database port number. Defaults to environment variable OB_PORT or "2881".
:param user: Database username. Required. Defaults to user input or environment variable OB_USER.
:param password: Database password. Required. Defaults to user input or environment variable OB_PASSWORD.
:param database: Database name. Required. Defaults to user input or environment variable OB_DATABASE.
:return: A dictionary containing the database connection configuration.
:raises ValueError: Raised if any of the required parameters (user, password, database) are missing.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
database | No | ||
host | No | ||
password | No | ||
port | No | ||
user | No |
Input Schema (JSON Schema)
{
"properties": {
"database": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Database"
},
"host": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Host"
},
"password": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Password"
},
"port": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Port"
},
"user": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "User"
}
},
"title": "configure_db_connectionArguments",
"type": "object"
}