Schemas

Work with tables and columns

Tables and their columns are the foundation of a schema. You can create a table six ways, then manage its columns on the table’s own page.

In the app: Data Model › Schemas › your schemaTables tab

[screenshot]
The Tables tab with the Create Table menu open, showing its six options.

Before you start

Creating and editing tables needs Read/Write access to the schema. Read Only users don’t see these buttons.

The Tables tab

The tab has a search box (it matches table names and descriptions), a Per page selector, and three buttons: Generate Descriptions, Delete Tables and Create Table. The grid shows Table Name, Description, DB Schema, Columns, Last Modified By, Created and Modified.

Create a table

Click Create Table and pick an option.

Option Use it when
New Table You’re designing a table by hand.
Paste Code You have one CREATE TABLE statement.
Derivative Table You want a new table based on the columns of an existing one.
From Template You want to start from a predefined reference model.
From File You have a CSV, TSV or Parquet file and want its shape.
From Database You want to pull objects from a saved database connection.

New table

  1. Choose New Table.
  2. Enter a Table Name (required, up to 255 characters, a valid identifier, unique in the schema) and an optional description.
  3. Click Create Table. The table’s page opens so you can add columns.

Paste code

  1. Choose Paste Code. The Create Table from SQL dialog opens.
  2. Paste the statement into Paste SQL CREATE TABLE Statement.
  3. Optionally fill in Table Name (Optional Override) to use a different name, and a description.
  4. Click Parse and Create Table. Kenseme parses the DDL with AI (“Generating your table schema…”) and opens the new table.

Tip: For more than one table, use Import Database Objects From Script on the Info tab instead. See Start an import.

Derivative table

  1. Choose Derivative Table.
  2. Enter a New Table Name and an optional Description.
  3. Pick the Source Schema and Source Table.
  4. Under Column Mapping, untick columns you don’t want and edit the new names. Suggest Names asks AI for better names.
  5. Click Create Derivative Table.

From template

  1. Choose From Template. The Select Template Tables window opens with a catalog of reference tables.
  2. Filter by schema or type, or search, and tick the tables you want.
  3. Click Done. Kenseme creates the tables, their columns and the relationships between them.

From file

  1. Choose From File.
  2. Enter a Table Name.
  3. Upload a .csv, .tsv or .parquet file up to 50 MB.
  4. Click Import and Create Table.

Column names come from the first row of a CSV or TSV file, or from a Parquet file’s schema. Types are inferred; correct them on the table page if needed.

From database

Choose From Database to open Import Database Objects From Connection. See Import objects from a database connection.

The table page

Click a table name to open it. The table page has these tabs:

  • Info: name (Rename Table), description, key columns, database schema, column and relationship counts, and an ACTIONS card with Create Derivative Table, Suggest Names and Bulk Add Columns. The Delete Table button is here too.
  • Columns: the column editor (below).
  • Relationships and Indexes: see Define relationships and indexes.
  • Attributes: custom attribute values for the table.
  • SQL: the table’s DDL for any dialect, with a Use IF (NOT) EXISTS option. See Generate SQL for one object.
  • Versions: the table’s history across schema versions.
  • Governance: placeholder (“Coming soon”).

Work with columns

The Columns tab lists each column with its data type, constraint badges and description. A key icon marks the primary key; a link icon marks foreign keys. The toolbar has Generate Descriptions, Delete Columns, Create Index, Suggest Names, Bulk Add Columns and Add Column.

Add or edit a column

  1. Click Add Column, or the pencil icon on a row to edit it.
  2. Fill in the dialog:
Field What it does
Name Required, up to 255 characters, a valid identifier.
Description (Optional) Free text.
Type The data type. Length (or Max), Precision and Scale appear when the type needs them.
Default Value (Optional) The column default.
Computed Column, Persisted, Expression (Optional) Make the column computed from an expression.
Nullable Whether the column allows NULL.
Primary Key Part of the primary key. Tick it on each column of a composite key.
Identity Column Auto-numbered, with Seed and Increment.
Unique Not available yet (marked “coming soon”).
Constrain to allowed values For string types, limit the column to an enum. See Work with enums.
  1. Click Add Column or Save Changes.

Add many columns at once

  1. Click Bulk Add Columns.
  2. Enter one column per line. SQL-style definitions (price DECIMAL(10,2)), comma-separated lists and plain-language descriptions all work.
  3. Click Add Columns. Kenseme parses the lines with AI and adds the columns.

Index columns from the grid

Tick one or more columns and click Create Index. The index dialog opens with those columns chosen.

Get AI naming suggestions

Suggest Names checks the table and column names against the schema’s naming conventions and proposes better ones.

  1. Click Suggest Names on the Columns or Info tab.
  2. If the table name should change, a Rename table row shows the current and suggested name. It is disabled if a table with the suggested name already exists.
  3. Each column row shows the Original Name and a Suggested Name drop-down with alternatives, plus a short reason when there is one.
  4. Tick the rows you want (or Select All) and click Apply (N).

If everything already follows the conventions, the dialog says No naming improvements suggested. Set the conventions on the schema’s Settings tab. See Schema settings.

Delete tables and columns

  • Select rows and click Delete Tables or Delete Columns, or use the trash icon on a single column.
  • If views, procedures or other objects depend on what you’re deleting, Kenseme stops and lists the dependencies.
  • Views and procedures that referenced a deleted table or column are flagged as broken on their lists. See AI in SQL object analysis.