Skip to main content

Generate

Once you've checked your data vault model using the validate command, you'll use the generate command to create the code that can be deployed. You don't necessarily have to run validate first, as the generate command automatically performs a validation check to make sure your model is correct before it starts generating code. To see all the available options for this command, type s2v generate --help.

Options

-i, --input DIRECTORY - (Required) This is the folder where your data vault model files are located.
-o, --output DIRECTORY - (Required) This is the folder where the generated code will be saved.
-u, --url URL - URL of the Stream2Vault server to connect to. Default: https://s2v.reeeliance.com

s2v generate -i path/to/my-input-folder/ \
-o path/to/my-output-folder/

You can also specify the exact locations of individual files if your folder structure is not standard:

--information-schema-path FILE - The location of the information schema file used during the validation process.
--data-vault-settings-path FILE - The location of the file containing specific settings for your data vault.
--source-system-settings-path FILE - The location of the file with settings specific to your source systems.

s2v generate -i path/to/my-input-folder \
-o path/to/my-output-folder/ \
--data-vault-settings-path path/to/my-input-folder/settings/dv_settings.yaml \
--source-system-settings-path path/to/my-input-folder/settings/source_settings.yaml \
--information-schema-path path/to/my-input-folder/settings/inf_schema_files/dev_schema.csv
tip

Consider defining default generate command in your Makefile to simplify your work!

By default the generate command generates the code for the entire provided model. However, if you only want to generate code for certain parts of your model, you can use --include-objects and --exclude-objects options. These options expect a list of object names, separated by commas, that you want to include or exclude.

--include-objects TEXT - Comma-separated list of specific object names to validate.
--exclude-objects TEXT - Comma-separated list of object names to exclude from validation.

s2v generate -i path/to/my-input-folder \
-o path/to/my-output-folder/ \
--include-objects '<OBJECT_NAME_1>,<OBJECT_NAME_2>'
tip

The include/exclude option is especially handy for partial deployments, as it generates the same code structure but only includes the selected objects. You don't need a specific deployment procedure; just run make deploy_all. See Deployment with Makefile

info

For more details about the output of generate command, please refer to the Understanding the Generated Code.