logologo
Get Started
Guide
Development
Plugins
API
English
简体中文
Get Started
Guide
Development
Plugins
API
English
简体中文
logologo
Overview

Data sources

Data source manager
Main data source

External data sources (Databases)

Overview
External MySQL
External MariaDB
External PostgreSQL
External MSSQL
External Oracle
Main vs External Databases
REST API data source
KingbaseES data source

Collections

Overview
General collection
Inheritance collection
File collection
Tree collection
Calendar collection
Comment collection
Expression collection
SQL collection
View collection

Collection fields

Overview
Field Validation

Basic

Single text
Long text
Phone
Email
URL
Integer
Number
Percent
Password
Color
Icon

Choices

Checkbox
Select
Multiple select
Radio group
Checkbox group

Media

Markdown
Markdown (Vditor)
Rich text
Attachment (Relationship)
Attachment (URL)

Date & Time

Overview
Date & time (with timezone)
Date & time (without timezone)
Unix timestamp
Date (without time)
Time

Geometry

Point
Line
Circle
Polygon

Advanced

UUID
Nano ID
Sort
Formula
Sequence
JSON
Collection select
Encryption

System info

Created at
Updated at
Created by
Last updated by
Space
Table OID

Associations

Overview
One to one
One to many
Many to one
Many to many
Many to many (array)

Development

Overview
Next PageOverview

#Connect Foreign Data Tables (FDW)

#Introduction

This is a plugin that connects to remote data tables based on the foreign data wrapper of the database. Currently, it supports MySQL and PostgreSQL databases.

:::info{title="Connecting Data Sources vs Connecting External Data Tables"}

  • Connecting data sources refers to establishing a connection with a specific database or API service, and you can fully use the features of the database or the services provided by the API;
  • Connecting external data tables refers to obtaining data from the outside and mapping it for local use. In the database, it is called FDW (Foreign Data Wrapper), which is a database technology that focuses on using remote tables as local tables and can only connect one by one. Because it is remote access, there will be various constraints and limitations when using it.
  • The two can also be used in combination. The former is used to establish a connection with the data source, and the latter is used for cross data-source access. For example, a certain PostgreSQL data source is connected, and a certain table in this data source is an external data table created based on FDW. :::

#MySQL

MySQL uses the federated engine, which needs to be activated, and supports connecting to remote MySQL and protocol-compatible databases, such as MariaDB. For more details, refer to the Federated Storage Engine documentation.

#PostgreSQL

In PostgreSQL, different types of fdw extensions can be used to support different types of remote data. The currently supported extensions include:

  • postgres_fdw: Connect to a remote PostgreSQL database in PostgreSQL.
  • mysql_fdw(under development): Connect to a remote MySQL database in PostgreSQL.
  • For other types of fdw extensions, refer to PostgreSQL Foreign Data Wrappers. To integrate them with NocoBase, you need to implement the corresponding adaptation interface in the code.

#Installation

Prerequisites

  • If the Main database of NocoBase is MySQL, it needs to activate federated. Refer to How to enable the federated engine in MySQL

Then install and activate the plugin through the plugin manager

Install and activate the plugin

#User Manual

Under "Collection manager > Create collection", select "Connect to foreign data"

Connect External Data

In the "Database server" dropdown, select an existing database service, or "Create database server"

Database Service

Create a database server

Create Database Service

After selecting the database server, in the "Remote table" dropdown, select the data table you need to connect.

Select the data table you need to connect

Configure field information

Configure field information

If the remote table has structural changes, you can also "Sync from remote table"

Sync from Remote Table

Remote table sync

Remote table sync

Finally, display it on the interface

Display on the interface