Skip to content

Generate Ddl

POST
/api/v1/codegen/ddl
curl --request POST \
--url https://example.com/api/v1/codegen/ddl \
--header 'Content-Type: application/json' \
--data '{ "target_name": "example", "target_schema": { "description": "example", "columns": [ { "name": "example", "type": "example", "description": "", "pk": false, "not_null": false, "pii": false, "glossary_terms": [ "example" ] } ], "foreign_keys": [ { "column": "example", "parent_table": "example", "parent_column": "example" } ] }, "table_comment": "example", "requested_by": "example" }'

Generate DDL for a target table.

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

Input model for DDL generation.

object
target_name
required
Target Name
string
target_schema
required
TableSchema

Table schema definition.

object
description
required
Description
string
columns
required
Columns
Array<object>
ColumnSchema

Column definition for table schemas.

object
name
required
Name
string
type
required
Type
string
description
Any of:
string
pk
Pk
boolean
not_null
Not Null
boolean
pii
Pii
boolean
glossary_terms
Glossary Terms
Array<string>
foreign_keys
Foreign Keys
Array<object>
ForeignKey

Foreign key definition.

object
column
required
Column
string
parent_table
required
Parent Table
string
parent_column
required
Parent Column
string
table_comment
Any of:
string
requested_by
required
Requested By
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
is_base64
Is Base64
boolean
metadata
Any of:
object
key
additional properties
any
errors
Errors
Array<string>
Example
{
"status": "success",
"artifacts": [
{
"is_base64": 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"
}
]
}