Import a schema

Import objects from a database connection

A connection import reads the catalog of a real database (its tables, columns, indexes, foreign keys, views, procedures, functions and value-list CHECK constraints) and compares it with your Kenseme schema. You get a list of proposed changes to review. Nothing is written to the schema until you apply them.

In the app: Data Model › Schemas › your schemaInfo tab › ACTIONSImport Database Objects From Connection

[screenshot]
The Review database objects page: counts, the All / Add / Update / Not in source tabs, and an update row expanded to show field changes.

Before you start

  • You need Read/Write access, and the organization must not be in read-only mode.
  • Your organization needs a saved database connection to the source database. An admin adds one under Organization Settings › External Credentials › Database Connections. See Add a database connection.
  • Only one import can run for a schema at a time.

Where to start it

  • An existing schema: Info tab › ACTIONSImport Database Objects From Connection, or Tables tab › Create TableFrom Database.
  • A new schema: the Create Schema wizard’s Import from a database connection card. See Create a schema.

Read the source

  1. Open Import Database Objects From Connection.
  2. Pick the Connection. Each option shows its name, dialect and server.
  3. Optionally enter Include schemas (optional): comma-separated source schema names, for example dbo, sales. Leave it blank to read every schema the connection can see.
  4. Click Start import.

The dialog shows Reading the database catalog… with progress. Click Cancel import to stop. If the source can’t be read, the error appears in the dialog with Retry.

When the read finishes, you’re taken to the Review database objects page.

Review the changes

The page header shows when the catalog was read. Below it:

  • Warnings. If some parts of the catalog couldn’t be read, a warning lists them. The change list may be incomplete.
  • Counts: to add, to update and not in source.
  • Tabs: All, Add, Update and Not in source.
  • Object kind filter: narrow to tables, columns, indexes, relationships, SQL objects or enums.

Each row shows the Object kind, the Object, the Action and a Summary:

Action Meaning Selected by default
Add The object is in the source but not in Kenseme. It will be created. Yes
Update The object exists in both but differs. Expand the row to see each Field with its Current (Kenseme) and Incoming (source) values. Yes
Not in source The object is in Kenseme but not in the source. Shown for information only; it can’t be selected. Can’t be selected

New enums show their values. Expand an enum row to see them all.

Tick or untick rows to choose what to apply. The header checkbox selects or clears every selectable row on the page.

Apply

  1. Click Apply selected (N).
  2. Confirm. The message reminds you that objects missing from the source are never deleted, and that applying can’t be undone.
  3. The page shows Applying the selected changes…, then returns you to the schema with N object(s) imported successfully.

Note: A connection import only adds and updates. It never deletes anything from your schema, even objects the source no longer has. Remove those yourself if you want them gone.

Cancel instead

Click Cancel import on the review page and confirm (Cancel import / Keep reviewing). The import is abandoned and nothing is written.

Good to know

  • Value-list CHECK constraints in the source become enums. Other check constraints don’t.
  • The review page keeps working in the background if you leave it. Keep the page address if you want to come back before applying.
  • Kenseme reads only the database’s catalog, never its data.