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
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
Name | string | ✓ | – | Component name. Used as the output filename. May contain ${…} placeholders when paired with <DynamicQuery>. |
Category | string | ✓ | – | Logical grouping (e.g. views, procedures). Appears as a folder in the UI. |
Schema | string | – | – | Default schema/owner for every <SchemaObject>. |
Database | string | – | connection database | Database override resolved against the connection's database at runtime (SQL Server only). Accepts a literal name or an expression such as $(ConnectionDatabase|replace(_CORE,_REPORTING)). Applies to extraction, dynamic queries, and deployment; the resolved name is never written into the generated script. See Target a different database. |
Version | int | – | – | Template format version. |
MinDataStarVersion | string | – | – | The oldest version of DataStar this template works with, as Major.Minor or Major.Minor.Patch (e.g. 3.1.7). An older version, from 3.1.7 on, lists the template as needing an upgrade and will not use it; DataStar.Tools stops with an error when it reads it. A value in any other form marks the template invalid. When omitted, the template works with any version. See Requiring a version of DataStar. |
IncludeHash | bool | – | false | Emit a content hash in the script header; useful for forcing VCS merge when content changes semantically but lines are reordered. |
IconColorLight | string | – | auto | Icon background colour for the light theme, in hex (e.g. #2563EB). If set without IconColorDark, also used for dark theme. |
IconColorDark | string | – | auto | Icon background colour for the dark theme, in hex (e.g. #60A5FA). If omitted, falls back to IconColorLight, or auto-generated. |
IconForegroundLight | string | – | auto | Icon foreground (text) colour for the light theme, in hex. Auto-calculated from background luminance if omitted. |
IconForegroundDark | string | – | auto | Icon foreground (text) colour for the dark theme, in hex. Auto-calculated from background luminance if omitted. |
ExcludeDuplicates | bool | – | false | When 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
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
Name | string | ✓ | – | Object name in the database. May contain ${…} placeholders. |
Type | SchemaObjectTypeEnum | ✓ | – | Table, 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)
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
Name | OptionNameTypeEnum | ✓ | – | Option name. See OptionNameTypeEnum for allowed values. |
Value | string | ✓ | – | Option value. Valid values depend on the Name. |
Option reference
Name | Values | Effect |
|---|---|---|
Permissions | True / False | Include GRANT / DENY statements after the CREATE. |
NoCollation | True / False | Strip COLLATE clauses from column definitions so the script adopts the target database's default collation. |
AnsiPadding | True / False | Emit SET ANSI_PADDING ON/OFF around the CREATE. |
Indexes | True / False | Include non-clustered index definitions on tables and indexed views. |
LineFormatting | True / False | Preserve blank-line formatting from the extracted source. |
IncludeDatabaseContext | True / False | Emit USE [database] at the top of the script. |
ServerVersion | e.g. 11.0, 13.0, 15.0 | Pin 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. |
ServerOutput | On / Off | Emit SET SERVEROUTPUT (Oracle). |
CreateOrAlter | True / False | Use 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
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
Weight | int | ✓ | – | Controls 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)
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
Path | string | ✓ | – | Path relative to the workspace root. |
Weight | string | ✓ | – | Negative 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.
| Value | Extracts |
|---|---|
Table | CREATE TABLE with columns, constraints, and (optionally) indexes. |
View | CREATE VIEW with the full definition. |
Procedure | CREATE PROCEDURE with body. |
Function | CREATE FUNCTION: scalar, table-valued, or inline. |
Trigger | CREATE TRIGGER: DML trigger (row- or statement-level). |
DdlTrigger | CREATE 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
<?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.