S2V Commands
As you've read so far, you know that your data vault model is made up of various data vault objects and settings, all neatly configured in individual YAML files and stored in a special "model folder." You also learned that S2V is a tool you interact with by typing commands, and you might have already used the Login command to get authorized.
What you haven't learned yet is what other commands S2V offers, how we make sure your model follows all the data vault rules, or how to turn your model into deployable code. This section will guide you through the most commonly used S2V commands. For more detailed information about how to use them, the code they generate, or specific error messages, you can find more details in the S2V References.
Validate
As the name suggests, the validate
command acts as a checker for your data vault model. It looks for any issues that might stop you from generating code, from simple problems like incorrect YAML formatting to more complex checks on how your data vault objects relate to each other.
Usage
To run the validate command, you just need to tell it where your model files are located (using the -i
flag).
s2v validate -i path/to/my-input-folder/
Output
If no errors are found, the S2V tool will give you a success message, meaning you're ready to move on to generating your code. However, even with a success message, the tool will also show you any warnings it found, just in case there are minor things to consider.
Generate
Once you're happy with your data vault model (and ideally, you've checked it with the validate
command), the next step is to generate
the actual code. This is the code that will be deployed to your target database. Think of the generate
command as the builder. You give it your model, and it constructs all the necessary pieces of code based on that.
Usage
Using the generate
command is straightforward. You need to tell it where your model files are and where you want the generated code to be saved.
s2v generate -i path/to/your-model-folder/ -o path/to/your-output-folder/
Output
Each code generation run includes a validate step before proceeding with the generation. Depending on the validation result, it returns either a list of error messages or the generated code. More details about the generated code can be found in Generated Files.
Visualize
The visualize
command allows you to see and explore your data vault model as a network graph.
Usage
s2v visualize -i path/to/my-input-folder/