Skip to content

Alter Ddl

POST
/api/v1/codegen/alter-ddl
curl --request POST \
--url https://example.com/api/v1/codegen/alter-ddl \
--header 'Content-Type: application/json' \
--data '{ "catalog_name": "example", "schema_name": "example", "table_name": "example", "changes": [ { "action": "add_column", "column": "example", "new_name": "example", "data_type": "example", "comment": "example", "position": "example" } ] }'

Generate SQL for Structural Schema DDL (Add/Drop/Rename Column).

X-Environment-Id
Any of:
string
Media typeapplication/json
DDLAlterInput

Input for action-based schema DDL changes.

object
catalog_name
required
Catalog Name
string
schema_name
required
Schema Name
string
table_name
required
Table Name
string
changes
Changes
Array<object>
SchemaChange

Represents a structural schema change.

object
action
required
Action
string
Allowed values: add_column drop_column alter_type rename_column
column
required
Column
string
new_name
Any of:
string
data_type
Any of:
string
comment
Any of:
string
position
Any of:
string

Successful Response

Media typeapplication/json
CodegenResponse

Standard response for all codegen endpoints.

object
status
Status
string
default: success
Allowed values: success error
artifacts
required
Artifacts
Array<object>
ArtifactOutput

Standard artifact output format.

object
path
required
Path
string
content
required
Content
string
file_type
Any of:
string
encode_artifacts
Encode Artifacts
boolean
metadata
Any of:
object
key
additional properties
any
errors
Errors
Array<string>
Example
{
"status": "success",
"artifacts": [
{
"encode_artifacts": false
}
]
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}