Skip to main content

Object component schema

Complete reference for ObjectComponent.xsd, the schema that drives extraction and deployment of database schema objects: tables, views, stored procedures, functions, and triggers.

For the conceptual guide see Create an object component template. This page is the exhaustive lookup.

Element tree

ObjectComponent (root)
├── Option* : top-level configuration
├── SchemaObject+ : the object(s) to extract
│ └── Option* : per-object overrides
├── DynamicQuery* : bulk-generation driver query
└── Deployment?
└── Script* : pre/post static scripts

Legend: ? = optional, * = zero or more, + = one or more.


Root element

ObjectComponent

Root element. Defines a template that generates CREATE (or CREATE OR ALTER) scripts for one or more database objects.

Parents: (root) Children: Option, SchemaObject, DynamicQuery, Deployment

AttributeTypeRequiredDefaultDescription
NamestringComponent name. Used as the output filename. May contain ${…} placeholders when paired with <DynamicQuery>.
CategorystringLogical grouping (e.g. views, procedures). Appears as a folder in the UI.
SchemastringDefault schema/owner for every <SchemaObject>.
VersionintTemplate format version.
IncludeHashboolfalseEmit a content hash in the script header; useful for forcing VCS merge when content changes semantically but lines are reordered.
IconColorLightstringautoIcon background colour for the light theme, in hex (e.g. #2563EB). If set without IconColorDark, also used for dark theme.
IconColorDarkstringautoIcon background colour for the dark theme, in hex (e.g. #60A5FA). If omitted, falls back to IconColorLight, or auto-generated.
IconForegroundLightstringautoIcon foreground (text) colour for the light theme, in hex. Auto-calculated from background luminance if omitted.
IconForegroundDarkstringautoIcon foreground (text) colour for the dark theme, in hex. Auto-calculated from background luminance if omitted.
ExcludeDuplicatesboolfalseWhen true, duplicate components (same filename from a dynamic query) are silently excluded instead of flagged as errors. Duplicates already on the file system still appear with an Excluded status and cannot be pulled; duplicates not on disk are hidden entirely. A warning-level log entry is written for each excluded duplicate. See handling duplicates.

Schema objects

SchemaObject

The database object to extract. A single template can contain multiple objects when they belong together, but most templates declare one object and rely on <DynamicQuery> for bulk generation.

Parents: ObjectComponent Children: Option

AttributeTypeRequiredDefaultDescription
NamestringObject name in the database. May contain ${…} placeholders.
TypeSchemaObjectTypeEnumTable, View, Function, Procedure, Trigger, or DdlTrigger. Controls the CREATE-statement shape.

Configuration

Option

Name/value pair that controls script generation. Valid at root (applies to every <SchemaObject> in the template) and per-object (overrides the root setting for that object only).

Parents: ObjectComponent, SchemaObject Children: (none)

AttributeTypeRequiredDefaultDescription
NameOptionNameTypeEnumOption name. See OptionNameTypeEnum for allowed values.
ValuestringOption value. Valid values depend on the Name.

Option reference

NameValuesEffect
PermissionsTrue / FalseInclude GRANT / DENY statements after the CREATE.
NoCollationTrue / FalseStrip COLLATE clauses from column definitions so the script adopts the target database's default collation.
AnsiPaddingTrue / FalseEmit SET ANSI_PADDING ON/OFF around the CREATE.
IndexesTrue / FalseInclude non-clustered index definitions on tables and indexed views.
LineFormattingTrue / FalsePreserve blank-line formatting from the extracted source.
IncludeDatabaseContextTrue / FalseEmit USE [database] at the top of the script.
ServerVersione.g. 11.0, 13.0, 15.0Pin generated syntax to a specific server version. Values are major SQL Server versions: 11.0=2012, 12.0=2014, 13.0=2016, 14.0=2017, 15.0=2019, 16.0=2022.
ServerOutputOn / OffEmit SET SERVEROUTPUT (Oracle).
CreateOrAlterTrue / FalseUse CREATE OR ALTER (SQL Server 2016+) instead of CREATE. Results in idempotent deploy scripts.

Generation

DynamicQuery

Text-content element: the SQL query whose result rows drive bulk generation. Each row becomes one generated component; column aliases in the SELECT become ${placeholder} variables usable elsewhere in the template.

See Generate components in bulk for the full pattern.

Parents: ObjectComponent Children: (text content: the SQL)


Deployment

Deployment

Deployment ordering and pre/post static scripts.

Parents: ObjectComponent Children: Script

AttributeTypeRequiredDefaultDescription
WeightintControls deployment order. Lower weights deploy first. Conventional scheme: tables 100, functions 200, procedures 280, views 300, triggers 400.

Script

A static SQL script to run before or after this component during deployment.

Parents: Deployment Children: (none)

AttributeTypeRequiredDefaultDescription
PathstringPath relative to the workspace root.
WeightstringNegative numbers (-1, -2, …) run before the component; positive (+1, +2, …) after.

See Include static scripts for the full pattern.


Enumerations

SchemaObjectTypeEnum

What kind of database object a <SchemaObject> represents.

ValueExtracts
TableCREATE TABLE with columns, constraints, and (optionally) indexes.
ViewCREATE VIEW with the full definition.
ProcedureCREATE PROCEDURE with body.
FunctionCREATE FUNCTION: scalar, table-valued, or inline.
TriggerCREATE TRIGGER: DML trigger (row- or statement-level).
DdlTriggerCREATE TRIGGER ... ON DATABASE ...: DDL trigger.

OptionNameTypeEnum

Allowed values for <Option>/@Name.

Value
Permissions
NoCollation
AnsiPadding
Indexes
LineFormatting
IncludeDatabaseContext
ServerVersion
ServerOutput
CreateOrAlter

See the Option reference table above for what each option does.


Complete example

views.xml
<?xml version="1.0" encoding="utf-8"?>
<ObjectComponent Schema="${schema}" Category="views" Name="${filename}">
<Option Name="Permissions" Value="True"/>
<Option Name="Indexes" Value="True"/>
<Option Name="CreateOrAlter" Value="True"/>
<Option Name="LineFormatting" Value="True"/>

<SchemaObject Name="${name}" Type="View"/>

<DynamicQuery><![CDATA[
SELECT TABLE_SCHEMA AS '${schema}',
'[' + LOWER(TABLE_SCHEMA) + '].[' + LOWER(TABLE_NAME) + ']' AS '${filename}',
TABLE_NAME AS '${name}'
FROM INFORMATION_SCHEMA.VIEWS
WHERE TABLE_SCHEMA <> 'sys'
]]></DynamicQuery>

<Deployment Weight="300"/>
</ObjectComponent>

Generates one component per non-system view, each as a CREATE OR ALTER VIEW script with indexes and permissions, deployed at weight 300.