Altibase DataAPI HTTP service for SQL execution over JSON APIs
83
Altibase DataAPI is a Spring Boot based HTTP service that exposes Altibase SQL execution through JSON-based HTTP APIs. It allows client applications to authenticate with database credentials or a DataAPI-issued JWT, then run SQL queries, DML/DDL statements, streaming reads, and operational monitoring requests against Altibase.
SELECT, DML, and DDL statements through JSON-based HTTP endpoints.columns + rows payloads, or NDJSON streaming for large result sets.DATA_API_ACCESS and DATA_API_MONITORING to separate SQL access from monitoring access.application/x-ndjson without buffering the full result set in memory.The default product line targets Altibase 8.
altibase/data-api:<version>
For Altibase 7 compatible deployments, use the -altibase7 tag.
altibase/data-api:<version>-altibase7
Use an explicit version tag for production deployments. The latest tag should only be used when your deployment policy accepts moving tags.
JWT_SECRET configured with a strong HS256 signing secretdocker pull altibase/data-api:<version>
For Altibase 7 compatible deployments:
docker pull altibase/data-api:<version>-altibase7
Bash (Linux / macOS):
docker run -d \
--name data-api \
-p 8080:8080 \
-e DATAAPI_ALTIBASE_HOST=host.docker.internal \
-e DATAAPI_ALTIBASE_PORT=20300 \
-e DATAAPI_DBNAME=mydb \
-e JWT_SECRET=01234567890123456789012345678901 \
-e SWAGGER_ENABLED=true \
-e API_DOCS_ENABLED=true \
--add-host host.docker.internal:host-gateway \
altibase/data-api:<version>
PowerShell (Windows):
docker run -d `
--name data-api `
-p 8080:8080 `
-e DATAAPI_ALTIBASE_HOST=host.docker.internal `
-e DATAAPI_ALTIBASE_PORT=20300 `
-e DATAAPI_DBNAME=mydb `
-e JWT_SECRET=01234567890123456789012345678901 `
-e SWAGGER_ENABLED=true `
-e API_DOCS_ENABLED=true `
--add-host host.docker.internal:host-gateway `
"altibase/data-api:<version>"
After startup, the default base URL is:
http://localhost:8080/dataapi
If Altibase is running on another host, replace DATAAPI_ALTIBASE_HOST with the actual database server IP address or DNS name.
Swagger UI and OpenAPI JSON are disabled by default. Enable them with:
SWAGGER_ENABLED=true
API_DOCS_ENABLED=true
When enabled, the default documentation endpoints are:
http://localhost:8080/dataapi/swagger-ui.html
http://localhost:8080/dataapi/v3/api-docs
Get a DataAPI-issued JWT token:
curl -X POST http://localhost:8080/dataapi/auth/token \
-H "Content-Type: application/json" \
-d '{
"username": "app_user",
"password": "app_password"
}'
Run a SQL query with the access token:
curl -X POST http://localhost:8080/dataapi/query/records \
-H "Authorization: Bearer <access-token>" \
-H "Content-Type: application/json" \
-d '{
"sql": "SELECT ID, NAME FROM EMPLOYEES WHERE DEPARTMENT_ID = ?",
"args": [10]
}'
DataAPI issues its own JWT access and refresh tokens. Client applications must handle access token expiration by calling /auth/refresh and replacing both the access token and refresh token with the newly returned values.
SQL endpoints accept a JSON request body with a sql string and an optional args array. If args is omitted or null, DataAPI treats it as an empty array. Client applications should pass external values through ? placeholders and args so DataAPI can bind them through JDBC PreparedStatement parameters.
{
"sql": "SELECT ID, NAME FROM EMPLOYEES WHERE DEPARTMENT_ID = ?",
"args": [10]
}
Main response shapes:
| Endpoint | Purpose | Success response |
|---|---|---|
POST /dataapi/query/records | Buffered query with row objects | { "records": [...] } |
POST /dataapi/query/values | Buffered query with column metadata and row arrays | { "columns": [...], "rows": [...] } |
POST /dataapi/execute | DML/DDL execution | { "affectedRows": 5 } |
POST /dataapi/stream/records | NDJSON streaming with row objects | {"record": {...}} lines, then {"complete": true, "rowCount": ...} |
POST /dataapi/stream/values | NDJSON streaming with column metadata and row arrays | {"columns": [...]}, {"row": [...]} lines, then {"complete": true, "rowCount": ...} |
For /execute, a one-dimensional args array is a single execution. A two-dimensional args array is treated as a JDBC batch for DML statements and is executed with an all-or-nothing transaction contract. Streaming endpoints return application/x-ndjson; clients should process the response line by line and treat the final complete line as the success signal.
Error responses use a stable JSON shape with code, message, path, timestamp, and optional details. Streaming endpoints can return this JSON error shape only before the first NDJSON line is written; after streaming starts, clients should treat a missing complete line as an incomplete stream.
| Variable | Default | Description |
|---|---|---|
DATAAPI_ALTIBASE_HOST | 127.0.0.1 | Altibase database host |
DATAAPI_ALTIBASE_PORT | 20300 | Altibase database port |
DATAAPI_DBNAME | mydb | Altibase database name |
JWT_SECRET | Required | HS256 JWT signing secret |
SERVER_PORT | 8080 | HTTP server port |
SERVER_SERVLET_CONTEXT_PATH | /dataapi | Base context path |
SWAGGER_ENABLED | false | Enable Swagger UI |
API_DOCS_ENABLED | false | Enable OpenAPI JSON |
DATA_API_ACCESS_ROLE | DATA_API_ACCESS | Role required for SQL endpoints |
DATA_API_MONITORING_ROLE | DATA_API_MONITORING | Role required for monitoring endpoints |
For complete usage instructions, see the Altibase DataAPI Manual.
Content type
Image
Digest
sha256:0b0c5881c…
Size
97.2 MB
Last updated
about 1 month ago
docker pull altibase/data-api