A SQL data source template builds the catalog with three queries against the platform's system catalog: a schema script, a table script and a column script. Validatar reads each result by column name, so every column has to be aliased to the names on this page: Name for schemas; Schema, Name and Type for tables; Schema, Table, Name, DataType and Sequence for columns.
This page covers Database category templates (SQL Server, Snowflake, PostgreSQL, Oracle, MySQL and other SQL platforms). Python templates use one script that returns DataFrames instead: see Metadata ingestion scripts: Python templates. Every column, type and rule in one place: Ingestion script contract reference.
Where the scripts live
Open the template and go to the Metadata Ingestion tab. It has three tabs: Schema Script, Table Script and Column Script. The panel beside each script lists the columns that script can return, split into required columns, optional columns and optional custom field columns. Drag a name into the script or click it to copy it.

The three scripts
Each script runs once per ingestion, for the whole data source, in this order: schemas, then tables and views, then columns. A table row is kept only if its Schema was returned by the schema script, and a column row only if its Schema and Table were returned by the table script. Rows that don't match are skipped and counted as skipped in the ingestion history.
Column names are matched without regard to letter case, so Name, name and NAME all work. That matters on Snowflake and Oracle, which return unquoted aliases in upper case, and on PostgreSQL, which returns them in lower case.
Schema script
Returns one row per schema.
| Column | Required | Value |
|---|---|---|
Name |
Yes | The schema name. Blank names and names that differ only in letter case fail the script. |
Table script
Returns one row per table or view.
| Column | Required | Value |
|---|---|---|
Schema |
Yes | The schema the table belongs to. Must match a Name from the schema script. |
Name |
Yes | The table or view name. |
Type |
No | Table or View. Validatar reads only the first letter: a value starting with V is a view, one starting with T is a table, and a blank or missing value is a table. Anything else, such as BASE TABLE, fails the script with Invalid TableType mapping (should be 'Table' or 'View'). |
ViewDefinition |
No | The view's SQL. Stored with the table so changes show in its history. |
Column script
Returns one row per column.
| Column | Required | Value |
|---|---|---|
Schema |
Yes | The schema of the table. |
Table |
Yes | The table or view the column belongs to. |
Name |
Yes | The column name. |
DataType |
Yes | The type name as the platform reports it, such as nvarchar or NUMBER. Matched against the template's Data Types tab. |
Sequence |
Yes | The column's position in the table, as an integer. |
IsNullable |
No | Whether the column allows nulls. |
IsIdentity |
No | Whether the column is an identity or autoincrement column. |
IsPrimaryKey |
No | Whether the column is part of the primary key. |
StringMaxLength |
No | Maximum character length for string columns. |
NumericPrecision |
No | Precision for numeric columns. |
NumericScale |
No | Scale for numeric columns. |
DateTimePrecision |
No | Fractional seconds precision for date and time columns. |
Comment |
No | The column's comment, which becomes its description in the catalog. |
The yes/no columns accept 1/0, true/false and YES/NO, so you can pass IS_NULLABLE from information_schema.columns straight through.
If a required column is missing, that level fails with Missing field: Sequence (or Missing fields: and a list), and the levels below it don't run.
Extra columns become custom fields
Any column that isn't in the tables above is checked against the catalog custom fields for that level. When its name matches a custom field's reference key (letter case ignored), each non-blank value is written to that field on the schema, table or column. Columns that match no custom field are ignored. This is how the Salesforce (ODBC) Data Source Template fills catalog fields such as the object label and the custom object flag: its table script returns them as extra columns (sf_object_label, sf_is_custom_object) next to Schema, Name and Type.
Worked example: SQL Server
These are the schema and table scripts from the built-in SQL Server template, the template behind the Wholesale Distribution System data source in the documentation screenshots.
select name
from sys.schemas
where name not in ('guest', 'INFORMATION_SCHEMA', 'sys')
and name not like 'db[_]%'
select SCHEMA_NAME(t.schema_id) as [Schema],
t.[name] as [Name],
case when rtrim(t.type) = 'V' then 'View' else 'Table' end as [Type],
m.definition as [ViewDefinition]
from sys.objects t
left join sys.sql_modules m on t.object_id = m.object_id
where rtrim(t.type) in ('U', 'V')
The schema script returns name in lower case and still matches Name. The table script turns SQL Server's object type codes into Table and View.
The built-in column script is longer because it also reads primary keys and MS_Description extended properties. This shorter version returns every required column and the common optional ones:
select OBJECT_SCHEMA_NAME(c.object_id) as [Schema],
OBJECT_NAME(c.object_id) as [Table],
c.[name] as [Name],
TYPE_NAME(c.user_type_id) as [DataType],
c.column_id as [Sequence],
c.is_nullable as [IsNullable],
c.is_identity as [IsIdentity],
columnproperty(c.object_id, c.name, 'charmaxlen') as [StringMaxLength],
c.[precision] as [NumericPrecision],
c.scale as [NumericScale]
from sys.columns c
inner join sys.objects o on o.object_id = c.object_id
where o.type in ('U', 'V')
and OBJECT_SCHEMA_NAME(c.object_id) != 'sys'
Because the built-in script maps MS_Description to Comment, every Wholesale Distribution System column arrives in the catalog with the description its developers wrote in SQL Server.
Other platforms
| Platform | Schemas from | Tables from | Columns from | Note |
|---|---|---|---|---|
| Snowflake | information_schema.schemata |
information_schema.tables joined to information_schema.views |
information_schema.columns |
The built-in script returns V or T for Type. |
| PostgreSQL | information_schema.schemata |
information_schema.tables joined to pg_catalog.pg_views |
information_schema.columns |
table_type is BASE TABLE or VIEW, so the script maps it with a case expression. |
| MySQL | information_schema.schemata |
information_schema.tables joined to information_schema.views |
information_schema.columns |
Same case mapping for table_type. |
Defaults and overrides
The scripts on the template are defaults. Each data source can replace any of them:
- Open the data source and go to Schema Metadata.
- Click Configure Ingestion SQL.
- On the Schema Script, Table Script or Column Script tab, select Override Default Script and edit the script.
- Set Limit Records and click Preview Script to see the rows and any validation message before you save.
The override is stored on the data source. A data source that doesn't override a level runs the template's current script, so a template change reaches it on its next ingestion.
What an ingestion run does
When someone clicks Refresh Now or a refresh schedule fires:
- The schema script runs against the data source's metadata connection.
- If it succeeded, the table script runs, then the column script.
- Validatar compares the results with the catalog. New objects are added, changed attributes (type, nullability, view definition) create a new version, and objects the scripts no longer return are marked deleted. Deleted objects are deactivated, not removed, so their history stays.
- The ingestion history records added, modified, deleted and skipped counts for each level.
Tips for custom scripts
Filter system objects
Leave out schemas nobody tests so the catalog stays clean: sys, INFORMATION_SCHEMA, guest and the db_ roles on SQL Server; INFORMATION_SCHEMA on Snowflake; information_schema and pg_catalog on PostgreSQL.
Return the bare type name
DataType must equal a name on the Data Types tab, ignoring letter case. Return NUMBER, not NUMBER(38,0), and put precision and scale in NumericPrecision and NumericScale. A column whose type has no mapping is still cataloged, but it gets no internal type and profiles restricted to data types skip it. See Data type mappings.
Keep names unique
Validatar doesn't distinguish object names by letter case. Two tables named Orders and ORDERS in the same schema fail the table script with The table names are not unique, and a join that repeats a row does the same.
Watch the column script on large databases
The column script returns every column in the data source in one result. On databases with thousands of tables, read from the platform's own catalog views (sys.columns on SQL Server) rather than wide information_schema joins, and filter out schemas you don't need.
Try changes on one data source first
Override the script on a single data source, preview it, run an ingestion and check the catalog. Copy the script to the template only when the results are right.