Schemas
Schemas overview
A schema is the catalog for one logical database. It holds the design of that database: tables and columns, keys and relationships, views, stored procedures, functions, scripts and enums. Almost everything else in the Data Model section of Kenseme starts from a schema: you generate SQL from it, version it, move data between schemas with Pipelines, and design star schemas on top of it.
In the app: Data Model › Schemas
Note: Kenseme stores structure, not data. A schema describes tables and code; it never holds the rows in those tables.
What lives inside a schema¶
Each kind of object has its own tab in the schema workspace:
- Tables with their columns, primary keys, indexes and relationships.
- Views, Procedures (stored procedures), Functions and Scripts, each with SQL you can keep in more than one dialect.
- Enums: named lists of allowed values that columns can be constrained to.
- Settings: the default dialect, naming conventions, environments and attribute groups.
The workspace also has a Diagram tab, a Schema Agent chat that can propose new objects, a Query Agent, an MCP Server tab and, when your organization has the feature, a Star Schema tab. See Browse a schema for the full tour.
How schemas relate to everything else¶
- Organizations. A schema belongs to one organization. Schemas never cross organizations.
- Dialects. Every schema targets one SQL dialect (SQL Server, PostgreSQL, Snowflake and so on). The dialect drives the DDL and code Kenseme generates. See Supported database targets.
- Environments. A schema can map to a different database and schema name per environment (Dev, Test, Prod). Generated SQL uses the environment you pick. See Schema settings.
- Versions. You can snapshot a schema as a numbered version and compare or roll back later. See How schema versioning works.
- SQL generation. Whole-schema create and migration scripts are generated from a schema version; a single object’s DDL is on its
SQLtab. See SQL generation overview. - Pipelines. A Pipeline moves data from one schema into another. A schema can be the source of one Pipeline and the target of another. See Pipelines overview.
- Star schemas. A star-schema plan designs facts and dimensions on top of an existing schema. See Star schema overview.
Tip: A common pattern is one schema per layer per domain, for example
Retail Bronze,Retail SilverandRetail Gold, with Pipelines between them.
The Schemas page¶
The page has a Create Schema button and two sections.
- Recent Schemas shows cards for the six most recently modified schemas. Each card shows the name, labels, dialect, table and view counts, when it was last modified, and its last version.
- All Schemas is a sortable, paged grid of every schema in the organization with the columns
Schema Name,Label,Dialect,Tables,Version,Last Version Date,Modified ByandModified On. You can drag column edges to resize them.
The three-dot menu on each card and row offers Go To Schema and Delete Schema. Rename a schema from its Info tab.
If your organization has no schemas yet, the page shows Import a schema and Start from scratch. Both open the Create Schema wizard.
Ways to start a schema¶
The Create Schema wizard offers five starting points:
- Start from blank and build it by hand.
- Create from a script: upload or paste DDL.
- Import from a database connection: read a live database and review the changes.
- Duplicate an existing schema into another dialect.
- Start from a sample: a ready-made retail schema.
You can also generate a schema from an ontology.
Who can change a schema¶
What you can do depends on your role for that schema:
- Read/Write users see the create, edit and delete controls.
- Read Only users can browse everything but the editing controls are hidden.
- Organization admins also see a
Userstab where they can override a person’s role for one schema.
If your organization is in read-only mode, editing controls stay visible but are disabled, with the tooltip “The site is in read-only mode. Contact an administrator for more information.” See Account states and read-only mode.
Delete a schema¶
- Open the three-dot menu on the schema’s card or row, or scroll to
Danger Zoneon the schema’sSettingstab. - Click
Delete Schema. - Confirm. If Pipelines depend on the schema, Kenseme lists them and asks you to confirm again.
Deleting a schema deletes its tables, columns, SQL objects and related data. The confirmation says they can be restored within 30 days.
🚩 TODO: There is no restore control in the app. Confirm who restores a deleted schema (support or a site admin) and how users should ask.