SchemaSmith Enterprise Documentation

Custom Property Support

Unlimited power to extend your application domain

Script Token

Overview

Custom table properties can be defined and used in the Table JSON files to extend the SchemaSmithy tool set in a number of ways. You can implement things like:

  • Data model documentation
  • A data dictionary
  • Product driving data structures for reporting, import, and export engines
  • Data driven UI element behavior
  • Data obfuscation patterns for moving data from production to test environments
  • Implementing SQL Server features that we don't directly support, such as Replication

All of these custom properties become available in the TableSchema and SpecificTable Script Tokens to be used in your custom scripts. The use cases are nearly as wide as your own imagination. If you want to implement something and need assistance determining how it might work with these tools, reach out to our master craftsman at ForgeBarrett@SchemaSmith.com for ideation assistance, or check out some of his videos on our YouTube channel.

Custom properties are supported on the table and each of the table components, such as columns, indexes, etc.

Custom properties can be grouped into sub-objects if desired. This allows encapsulating them logically for reviewers and also setting up the schema validation so that groups could be treated as optional, but when included specific properties must be present. The object name would become part of the label for the custom editors in SchemaHammer and referencing them in your scripts is treated like any nested JSON object.

We can help with examples for using the tokens and querying any of this data if needed. Our goal is to support a robust and configurable ecosystem to support your most complex needs. If we don't have what you need it will most likely become a priority backlog item, so don't hesitate to ask.

Custom Editor Support In SchemaHammer

Custom properties can be added to the UI by adding them to the tables.schema file located in the .json-schemas folder of your product repository. This file can be used to perform JSON schema validation by things like GitHub Actions and also define the custom properties you want to appear in the UI:

  • Simple properties such as string, int, datetime, and boolean
  • Generate dropdowns in the UI via enum or the use of pattern with a list of single values or specify a dropdown loaded from an external JSON containing the code and description pairs
  • Array of strings and specify an external JSON containing code and description pairs that drive a pick list in the UI
  • A dictionary that has a key value pair editor

Data types we support:

  • int, number - Supported modifiers: minimum, maximum, multipleOf, exclusiveMinimum, exclusiveMaximum
  • boolean - Will generate a check box
  • enum - The enum values will become a fixed dropdown of allowable values
  • meta:enum - Key/Value pairs will become the dropdown code/description values if provided
  • object - Description of DICTIONARY
  • string
    • Supported modifiers: pattern, minLength, maxLength, format
    • Picker control generated for format of date, time, or date-time
    • A fixed dropdown of allowable values generated for pattern values separated by | if each one is a single value to match
    • Description of DROPDOWN:<lookup table without extension which MUST be .json> will populate a fixed dropdown of allowable values
    • Description of SQL: A single line SQL Editor (with pop-out multi-line editor support)
    • Description of MEMO: A multi-line textbox
  • array - Description of CHECKLIST:<lookup table without extension which MUST be .json>
    • The items in the lookup table will provide a checklist that supports selecting multiple values

Examples of many of these patterns can be found in the tables.schema file of our ValidProduct in the Enterprise Demos Repository.

Tip

The custom edits will perform validations in the UI for the min, max, and pattern modifiers when saving to help users avoid issues in their PRs.

Tip

By default the custom control label will be set by splitting the property name into words using camel case. Setting the title property in the schema file will override the label used for the custom control which can be more user-friendly in some cases.

Additional Resources