Skip to main content

Data vs object components

DataStar has two kinds of template. Before you create one, you need to know which you're after.

The difference in one line

  • A data component template describes how to extract and deploy rows in a table: configuration, reference data, lookup values.
  • An object component template describes how to extract and deploy database objects: tables, views, stored procedures, functions, triggers.

What each one generates

A re-runnable script that reconciles the source rows with the target table using a MERGE (or equivalent) statement, wrapped in a transaction with a metadata header and a change-summary output. Environment-agnostic and re-runnable; identity keys are resolved at deploy time via alternative keys and lookups, so you never ship transient IDs between environments.

How to choose

You're working with…Pick
Rows in a configuration, reference, or lookup tableData component
A table structure (columns, constraints, indexes)Object component (type Table)
A view, stored procedure, function, or triggerObject component
A hand-written script that runs once (DDL migration, data fix)Neither; use a static script

Most workspaces use both: object components for the schema, data components for the rows, and a handful of static scripts for one-off fixes.

Template files

Both kinds are XML files. They differ by the root element:

data-component.xml
<DataComponent Name="..." Category="..." DeleteEnabled="true">
<Table Id="1" Name="...">
...
</Table>
</DataComponent>
object-component.xml
<ObjectComponent Name="..." Category="..." Schema="...">
<SchemaObject Name="..." Type="View"/>
</ObjectComponent>

Each has its own XSD, so a text editor with schema support will autocomplete the right elements for you. DataStar's built-in template editor uses these XSDs directly: open a template from Workspace ▸ Data Templates / Object Templates, then press Ctrl+Space in any attribute value (or just type " after an attribute name) for a list of allowed values.

Starting a new template

You can either author the XML directly in your favourite editor, or seed one from DataStar:

  • Workspace ▸ New Data Template opens a fresh editor tab pre-filled with a usable <DataComponent> scaffold.
  • Workspace ▸ New Object Template does the same for <ObjectComponent>.

Either menu item names the new file tentatively (DataComponent1.xml, ObjectComponent1.xml); use Save As to commit it to your workspace's templates/ folder under whatever name you want.

Where to next