Import: DBML

Creates a data contract from a DBML file. You can filter by schema and table name.

{/* AUTOGENERATED EXAMPLE: do not edit by hand; regenerate with the update script. */}

Given this orders.dbml:

Table orders {
  order_id varchar [pk, note: 'Unique identifier of the order.']
  order_timestamp timestamp [not null]
  customer_id varchar [not null]
  order_total bigint [not null]
  status varchar [not null]
}

Run:

datacontract import dbml --source orders.dbml

to produce the data contract:

version: 1.0.0
kind: DataContract
apiVersion: v3.1.0
id: my-data-contract
name: My Data Contract
status: draft
schema:
- name: orders
  physicalType: table
  customProperties:
  - property: namespace
    value: public
  logicalType: object
  physicalName: orders
  properties:
  - name: order_id
    physicalType: varchar
    description: Unique identifier of the order.
    primaryKey: true
    primaryKeyPosition: 1
    logicalType: string
  - name: order_timestamp
    physicalType: timestamp
    logicalType: timestamp
    required: true
  - name: customer_id
    physicalType: varchar
    logicalType: string
    required: true
  - name: order_total
    physicalType: bigint
    logicalType: integer
    required: true
  - name: status
# …

{/* END AUTOGENERATED EXAMPLE */}