Grooper Help - Version 25.0
25.0.0017 2,127
  • Overview
  • Help Status

Data Connection - Create Table

Data Connection Data Connection - Connection Command Grooper.Core

Generates database tables from Grooper data elements..

Remarks

Overview

The CreateTable command generates one or more database tables based on the structure of a selected Data Field Container, such as a Data Table, Data Section, or Data Model.
This enables you to quickly create a relational schema in your connected database that matches the data extraction model defined in Grooper.

The command supports multiple generation modes, allowing you to create a single flat table or a set of related tables that mirror the hierarchy of your data elements.


Usage

  1. Set the 'Scope' property to the Data Field Container you wish to generate tables for.
    This is typically a Data Table or Data Model, but can be any container element.
  2. Choose the desired 'Create Mode' to control how tables are generated:
    • Simple: Creates a single table with one column for each child field.
    • Flatten: Creates a single table with columns for all single-instance fields in the scope and its ancestors.
    • Recursive: Creates a set of related tables for the scope and all descendant containers, with foreign key relationships.
  3. Review and, if needed, edit the generated SQL in the 'Create Statement' property before execution.
  4. Execute the command to create the tables in the connected database.

Table Generation Details

  • Table and column names are derived from the 'Code Name' of each Data Field Container and Data Field.
  • Data types for columns are inferred from the 'Value Type' of each Data Field.
  • In Recursive mode, each table includes an 'Id' column (as a primary key) and, where applicable, a foreign key column referencing the parent container.
  • The generated SQL is compatible with the connected database provider, and may be edited in the 'Create Statement' property before execution.

Example Scenarios

  • Exporting Extracted Data:
    Use CreateTable to generate a schema that matches your Grooper data model, then export extracted data directly into the new tables.

  • Integration with External Systems:
    Quickly provision a database schema for integration, reporting, or downstream processing, ensuring alignment with your document extraction logic.


Best Practices

  • Review the generated SQL for naming conventions, data types, and relationships before executing, especially when using Recursive mode.
  • Use the 'Create Mode' that best matches your reporting or integration needs.
  • After creating tables, use Grooper's export features to populate them with extracted data.

For more information, see the documentation for Data Field Container, Data Table, Data Field, and related data extraction objects.

Properties

NameTypeDescription

See Also

Notification