External Database
Introduction
Use an existing external database as a data source. Currently supported external databases include MySQL, MariaDB, PostgreSQL, MSSQL, and Oracle.
Usage Instructions
Adding an External Database
After activating the plugin, you can select and add it from the "Add new" dropdown menu in data source management.

Fill in the information for the database you need to connect to.

Collection Synchronization
After establishing a connection with an external database, all collections within the data source will be read directly. External databases do not support adding collections or modifying the table structure directly. If modifications are needed, you can perform them through a database client and then click the "Refresh" button in the interface to synchronize.

Configuring Fields
The external database will automatically read and display the fields of existing collections. You can quickly view and configure the field's title, data type (Field type), and UI type (Field interface). You can also click the "Edit" button to modify more configurations.

Because external databases do not support modifying the table structure, the only available type when adding a new field is the association field. Association fields are not actual fields but are used to establish connections between collections.

For more details, see the Collection Fields/Overview chapter.
Field Type Mapping
NocoBase automatically maps the field types from the external database to the corresponding data type (Field type) and UI type (Field Interface).
- Data type (Field type): Defines the kind, format, and structure of data that a field can store.
- UI type (Field interface): Refers to the type of control used in the user interface to display and input field values.
Unsupported Field Types
Unsupported field types are displayed separately. These fields require development adaptation before they can be used.

Filter Target Key
Collections displayed as blocks must have a Filter target key configured. The filter target key is used to filter data based on a specific field, and the field value must be unique. By default, the filter target key is the collection's primary key field. For views, collections without a primary key, or collections with a composite primary key, you need to define a custom filter target key.

Only collections that have a filter target key configured can be added to the page.


