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
Namestring✓–Component name. Used as the output filename. May contain ${…} placeholders when paired with <DynamicQuery>.
Categorystring✓–Logical grouping (e.g. views, procedures). Appears as a folder in the UI.
Schemastring––Default schema/owner for every <SchemaObject>.
Databasestring–connection databaseDatabase 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.
Versionint––Template format version.
MinDataStarVersionstring––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.
IncludeHashbool–falseEmit a content hash in the script header; useful for forcing VCS merge when content changes semantically but lines are reordered.
IconColorLightstring–autoIcon background colour for the light theme, in hex (e.g. #2563EB). If set without IconColorDark, also used for dark theme.
IconColorDarkstring–autoIcon background colour for the dark theme, in hex (e.g. #60A5FA). If omitted, falls back to IconColorLight, or auto-generated.
IconForegroundLightstring–autoIcon foreground (text) colour for the light theme, in hex. Auto-calculated from background luminance if omitted.
IconForegroundDarkstring–autoIcon foreground (text) colour for the dark theme, in hex. Auto-calculated from background luminance if omitted.
ExcludeDuplicatesbool–falseWhen 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
Namestring✓–Object name in the database. May contain ${…} placeholders.
TypeSchemaObjectTypeEnum✓–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)

AttributeTypeRequiredDefaultDescription
NameOptionNameTypeEnum✓–Option name. See OptionNameTypeEnum for allowed values.
Valuestring✓–Option 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
Weightint✓–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)

AttributeTypeRequiredDefaultDescription
Pathstring✓–Path relative to the workspace root.
Weightstring✓–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.

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.