/
Writing Rules from Templates
Liquibase Enterprise was formerly known as Datical DB.
Writing Rules from Templates
Getting Started
- Create a simple Datical project
- Create 2 empty databases on your desired DB platform
- Create project with 2 steps pointing to these databases
- Identify a new rule that needs to be created
- Look for the Rule in the Rules Library below
- Types of rules (so far)
- Standards - Naming
- Standards - Datatype
- Security
- Performance
- Structure
- Types of rules (so far)
- Creating a Rule - either copy a rule from the library or create a new rule from the following templates (create your rule file using a meaningful name - see examples in library below)
SqlRule Rule Template
PreForecast Rule Template
Forecast Rule Template
PostForecast Rule Template
- Testing a Rule
- Copy your rule into the appropriate Rules subfolder
- In the GUI, right-click on the Rules folder and select "Check Rules" (this will detect any syntax errors)
- Note, this does not check SqlRules
- Create one or more SQL scripts named the same as your rule with a .sql ending that
- exercises a positive case
- exercises a negative case
- exercises one or more edge cases
If this is a SQLFile rule, run the Datical command line as shown below or run the SQL script through the Packager (preview mode should be okay)
cd <datical project workspace> hammer runRules [SQL file | SQL files folder]
- If this is a Pre-Forecast, Forecast or PostForecast rule, then
- Run the SQL script through convert SQL to get it converted into change sets (save the relevant change sets in a file named the same as your rule with a .xml ending). The QA team will thank you.
- Run Forecast on the second step in your project to test the rules on the undeployed changes now in your changelog
, multiple selections available,
Related content
Rule Stages and Objects
Rule Stages and Objects
More like this
Configuring Rules for a Project
Configuring Rules for a Project
Read with this
Rules Overview
Rules Overview
More like this
Data Models for Rules
Data Models for Rules
More like this
Functions for Rules
Functions for Rules
More like this
Copyright © Liquibase 2012-2022 - Proprietary and Confidential