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
- Data component
- Object component
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.
A single-object DDL script (SQL Server: CREATE OR ALTER; Oracle: CREATE OR REPLACE) extracted straight from the live database and versioned in your workspace. DataStar wraps the raw DDL with a small header comment and, on SQL Server, GO separators and an optional IF EXISTS guarded DROP for table types.
How to choose
| You're working with… | Pick |
|---|---|
| Rows in a configuration, reference, or lookup table | Data component |
| A table structure (columns, constraints, indexes) | Object component (type Table) |
| A view, stored procedure, function, or trigger | Object 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:
<DataComponent Name="..." Category="..." DeleteEnabled="true">
<Table Id="1" Name="...">
...
</Table>
</DataComponent>
<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.
Where to next
- Creating your first data component: Create a data component template.
- Creating your first object component: Create an object component template.
- Generating many components from one template: Generate components in bulk.