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 schema › Info tab › ACTIONS › Import Database Objects From Connection
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:
Infotab ›ACTIONS›Import Database Objects From Connection, orTablestab ›Create Table›From Database. - A new schema: the Create Schema wizard’s
Import from a database connectioncard. See Create a schema.
Read the source¶
- Open
Import Database Objects From Connection. - Pick the
Connection. Each option shows its name, dialect and server. - Optionally enter
Include schemas (optional): comma-separated source schema names, for exampledbo, sales. Leave it blank to read every schema the connection can see. - 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 updateandnot in source. - Tabs:
All,Add,UpdateandNot 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¶
- Click
Apply selected (N). - Confirm. The message reminds you that objects missing from the source are never deleted, and that applying can’t be undone.
- The page shows
Applying the selected changes…, then returns you to the schema withN 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
CHECKconstraints 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.