LogoLogo
Release notesDocs homeFabricateTonic.ai
  • Tonic Fabricate User Guide
  • Fabricate workflow
  • Tutorial videos
  • Fabricate account
    • Getting started with Fabricate
    • Fabricate license plans
    • Managing your Fabricate account and profile
    • Managing users in your account
  • Databases
    • Supported database types
    • Creating and managing databases
  • Backing up and restoring the database definition
  • Configuring database variables
  • Exporting data from a database
  • Tables and columns
    • Managing database tables
      • Configuring table settings
      • Adding a table to a database
      • Removing a table from a database
      • Attaching static data to a table
      • Regenerating table data
  • Managing table columns
    • Adding and removing columns
    • Configuring a column
    • Generator reference
      • Calculated or related values
      • Unstructured Data
      • Data type and specific values
      • Names and other identifying information
      • Telephone numbers and email addresses
      • Geographic locations
      • Air travel
      • Natural science
      • Networks and files
      • Banking and finance
      • Dates and times
      • Vehicles
      • Companies and products
      • Healthcare and health insurance
      • Languages
      • Movies
      • Education
    • Fabricate custom SQLite functions
  • Views
    • Creating and managing views
    • Views reference
  • Workspaces
    • About workspaces
  • Creating and managing workspaces
  • Database mock API
    • About mock APIs
    • Defining a mock API
    • Creating and querying database snapshots
  • Mock API reference
  • Fabricate API and CLI
    • Managing Fabricate API keys
    • Daily limits on generated data
    • Using the Fabricate API
      • Authentication for the API
      • Data model
        • Database attributes
        • Entity (table) attributes
        • Constraint attributes
        • Column attributes
          • General column configuration
          • Calculated or related values
          • Unstructured Data
          • Data type and specific values
          • Names and other identifying information
          • Telephone numbers and email addresses
          • Geographic locations
          • Air travel
          • Natural science
          • Networks and files
          • Banking and finance
          • Dates and times
          • Vehicles
          • Companies and products
          • Healthcare and health insurance
          • Languages
          • Movies
          • Education
      • Managing databases from the API
      • Generating data from the API
    • Using the Fabricate CLI
      • Setting up CLI access
      • Using the CLI to load data
  • Self-hosted Fabricate
    • Fabricate architecture
    • Setting up the Fabricate components
    • Limiting login attempts
    • Starting a Fabricate instance
    • Upgrading a Fabricate instance
Powered by GitBook
On this page
  • AI
  • Character Sequence
  • Column From Another Table
  • Foreign Key
  • List
  • Rank
  • Regular Expression
  • SQL
  • Sum From Another Table
  • Sum Of Previous Rows
  • Value From Previous Row
Export as PDF
  1. Fabricate API and CLI
  2. Using the Fabricate API
  3. Data model
  4. Column attributes

Calculated or related values

These generators calculate values based on a script, formula, or on other values in the database.

For details about each generator and how to configure them in the application, go to Calculated or related values in the generator reference.

AI

Generates data values based on a prompt that you provide.

{
  "name": string,
  "data_type": string,
  "generator": "AI",
  //  Generator-specific fields
  "ai_prompt": string, //AI prompt to use to populate the column
  // End generator-specific fields
  "group_key": string,
  "percent_null": integer,
  "virtual": boolean,
  // Advanced options
  "primary_key": boolean,
  "index": boolean,
  "seed": string,
  "postprocessing_sql": string
}

Character Sequence

Populates a column with a value that uses a specific pattern. The pattern can include both random characters of a specific type and specific characters.

{
  "name": string,
  "data_type": string,
  "generator": "Character Sequence",
  // Generator-specific fields
  "character_sequence": string, // The pattern to use for the values.
  // End generator-specific fields
  "percent_null": integer,
  "virtual": boolean,
  // Advanced options
  "primary_key": boolean,
  "index": boolean,
  "seed": string,
  "postprocessing_sql": string
}

Column From Another Table

Populates the column with values from a column in a different table.

{
  "name": string,
  "data_type": string,
  "generator": "Column From Another Table",
  // Generator-specific fields
  "primary_key_entity": string, // Source table
  "primary_key_field": string,  // Source column
  "enable_where": boolean, // Select values based on criteria
  "foreign_key_field": string, // Other table column for criteria
  "value_field": string, // Current table column value for criteria
  // End generator-specific fields
  "group_key": string,
  "percent_null": integer,
  "virtual": boolean,
  // Advanced options
  "primary_key": boolean,
  "index": boolean,
  "seed": string,
  "postprocessing_sql": string
}

Foreign Key

Makes the column a foreign key to another table.

{
  "name": string,
  "data_type": string,
  "generator": "Foreign Key",
  // Generator-specific fields
  "primary_key_entity": string, // References table
  "primary_key_field": string,  // References column
  "distribution": "none"|"fixed"|"from_column"|"burn-down"|"uniform"|"normal",
                  // The type of distribution to use
                  // None uses relative prevalence instead of cardinality
                  // burn-down is for Until column <= 0
  // -----------------------------------------------------------------------
  // None (relative prevalence)
  "primary_key_cardinality_field": string, // Relative prevalence column
  // -----------------------------------------------------------------------
  // Fixed distribution
  "exact_value": integer, // The number of times to use each row
  // -----------------------------------------------------------------------
  // From column distribution
  "primary_key_cardinality_field": string, // Column that contains the number
                                           // of times to use the row
  // -----------------------------------------------------------------------
  // Until column <= 0 distribution
  "value_field": string, // Column to check the value of
  // -----------------------------------------------------------------------
  // Uniform distribution
  "min": integer, // Minimum number of times to use each row
  "max": integer, // Maximum number of times to use each row
  // -----------------------------------------------------------------------
  // Normal distribution
  "min": integer, // Minimum number of times to use each row
  "max": integer, // Maximum number of times to use each row
  "mean": string, // Mean number of times to use each row
  "std_dev": string, // Standard deviation
  // End generator-specific fields
  "percent_null": integer,
  "virtual": boolean,
  // Advanced options
  "primary_key": boolean,
  "index": boolean,
  "seed": string,
  "postprocessing_sql": string
}

List

Populates the column from a provided list of values. You can optionally provide a weight for each value.

{
  "name": string,
  "data_type": string,
  "generator": "List",
  // Generator-specific fields
  "values": text, // List of values to use for the column.
  // End generator-specific fields
  "group_key": string,
  "percent_null": integer,
  "virtual": boolean,
  // Advanced options
  "primary_key": boolean,
  "index": boolean,
  "seed": string,
  "postprocessing_sql": string
}

Rank

Assigns a rank value based on the values in 2 other columns.

{
  "name": string,
  "data_type": string,
  "generator": "Rank",
  // Generator-specific fields
  "partition_by_field": string, // Partition by field
  "order_by_field": string,  // Order by field
  // End generator-specific fields
  "percent_null": integer,
  "virtual": boolean,
  // Advanced options
  "primary_key": boolean,
  "index": boolean,
  "seed": string,
  "postprocessing_sql": string
}

Regular Expression

Produces a value that matches a regular expression that you provide. It uses the Peri-compatible regular expression syntax.

{
  "name": string,
  "data_type": string,
  "generator": "Regular Expression",
  // Generator-specific fields
  "regex": string,  // Pattern
  // End generator-specific fields
  "percent_null": integer,
  "virtual": boolean,
  // Advanced options
  "primary_key": boolean,
  "index": boolean,
  "seed": string,
  "postprocessing_sql": string
}

SQL

Uses a SQL expression to generate the value. The expression can refer to other columns and other tables.

{ 
  "name": string,
  "data_type": string,
  "generator": "SQL",
  // Generator-specific fields
  "sql": string,  // SQL expression
  // End generator-specific fields
  "percent_null": integer,
  "virtual": boolean,
  // Advanced options
  "primary_key": boolean,
  "index": boolean,
  "seed": string,
  "postprocessing_sql": string
}

Sum From Another Table

Populates a column with the sum of column values from rows in another table. To identify the rows to include, you provide join criteria.

{ 
  "name": string,
  "data_type": string,
  "generator": "Sum From Another Table",
  // Generator-specific fields
  "primary_key_entity": string, // The table that contains the column to sum
  "value_field": string, // The column that contains the values to sum
  "foreign_key_field": string, // Sum table column for the join criteria
  "primary_key_field": string // Current table column for the join criteria
  // End generator-specific fields
  "percent_null": integer,
  "virtual": boolean,
  // Advanced options
  "primary_key": boolean,
  "index": boolean,
  "seed": string,
  "postprocessing_sql": string
}

Sum Of Previous Rows

Adds together the values of a specified numeric column in rows that are before the current row.

{ 
  "name": string,
  "data_type": string,
  "generator": "Sum Of Previous Rows",
  // Generator-specific fields
  "value_field": string, // Column to sum
  "partition_by_field": string, // Group by
  "order_by_field": string,  // Order by
  // End generator-specific fields
  "percent_null": integer,
  "virtual": boolean,
  // Advanced options
  "primary_key": boolean,
  "index": boolean,
  "seed": string,
  "postprocessing_sql": string
}

Value From Previous Row

Populates a column with a value or values from another column in the previous row or rows.

{
  "name": string,
  "data_type": string,
  "generator": "Value From Previous Row",
  // Generator-specific fields
  "value_field": string, // The column to get the value from
  "concat_type": "single"|"list"|"json", // How many previous values to retrieve
  "partition_by_field": string, // Partition by field
  "order_by_field": string,  // Order by field
  // End generator-specific fields
  "percent_null": integer,
  "virtual": boolean,
  // Advanced options
  "primary_key": boolean,
  "index": boolean,
  "seed": string,
  "postprocessing_sql": string
}

Last updated 5 days ago