Alter Ddl
POST
/api/v1/codegen/alter-ddl
const url = 'https://example.com/api/v1/codegen/alter-ddl';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"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"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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).
Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”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
Responses
Section titled “Responses”Successful Response
Media typeapplication/json
CodegenResponse
Standard response for all codegen endpoints.
object
status
Status
string
artifacts
required
errors
Errors
Array<string>
Example
{ "status": "success", "artifacts": [ { "encode_artifacts": false } ]}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}