diff --git a/doc/sql.extensions/README.MED.md b/doc/sql.extensions/README.MED.md new file mode 100644 index 00000000000..a88b30909f9 --- /dev/null +++ b/doc/sql.extensions/README.MED.md @@ -0,0 +1,334 @@ +# Management of External Data \(FB 6.0\) + +## Concept + +Firebird 6.0 allows to managing external data \(distributed or heterogeneous queries\). Distributed queries allow managing data stored in other databases. Those databases can be located on the same or different servers and use the same or different DBMS. Distributed queries allow to integrate and process data from different sources, providing developers with the ability to work with them as a single logical unit. + +External data management is defined by ISO/IEC 9075\-9:2023\(E\) \(SQL/MED\) standard. External data management implies both read and write access to external data. Access to foreign data is implemented using 4 objects: foreign-data wrapper, foreign server, user mapping, and foreign table. + +## Syntax + +### Foreign-data wrapper + +In Firebird, the foreign-data wrapper can be implemented as a provider \(plugin\). To use a foreign-data wrapper, it should be defined in `plugins.conf`, for example: +``` +Plugin = JDBC { + Module = $(dir_plugins)/jdbc_provider + Config = JDBC_config +} + +Config = JDBC_config { + Dir = $(this)/jdbc +} +``` +To connect to Firebird databases, the Engine and Remote providers are available by default and require no additional definition in `plugins.conf`. + +### Foreign server + +A foreign server is a logical representation of a remote data source inside the DBMS. The DBMS connects to the foreign server to execute queries. The foreign server provides metadata and connection information about the remote data source. Usually, the external server stores the connection parameters such as connection string, port, database type, etc. + +#### CREATE SERVER definition + +```sql +CREATE SERVER [IF NOT EXISTS] + [{FOREIGN DATA WRAPPER | USING PLUGIN} ] [OPTIONS (