MariaDB(MySQL兼容)空间读者/作家

Licensing optionsfor this format begin with FME Professional Edition.

This format replaces the MySQL Reader/Writer. It still uses terminology specific to MySQL, since玛利亚二is known to work well with MySQL Servers.

Compatibility: MariaDB and MySQL

MariaDB是一个二进制替换相同的MySQL版本。例如,

  • MySQL 5.1 is compatible with MariaDB 5.1, MariaDB 5.2, MariaDB 5.3
  • MySQL 5.5 will be compatible with MariaDB 5.5

For detailed information, please visit the MariaDB website:玛利亚二Versus MySQL: Compatibility.

玛利亚二Spatial Overview

The MariaDB®1玛利亚二is a registered trademark of MariaDB Corporation Ab in the United States, the European Union, and other countries. MySQL, the MySQL logo, and MySQL graphics are the servicemarks, trademarks, or registered trademarks owned by Oracle Corporation Inc.Spatial Reader/Writer enables FME to read and write both attribute and geometric data stored in a MariaDB database.

有两个版本的读者和作家:

  • 玛利亚二Spatial, which includes the spatial extension and supports geometry features, and
  • 玛利亚二Non-Spatial,which is an attribute-only version that ignores geometry.

Currently the table types that can be read are MyISAM, InnoDB and MEMORY. Note that only MyISAM tables currently support geometry columns.

MariaDB空间读取器和写入器专门设计用于在存在时处理数据的几何部分,并且在没有存在空间列时针对非几何或属性处理进行优化。Mariadb Reader和Writer直接与MariaDB C API接口通信,以获得最大吞吐量。

This chapter assumes familiarity with MariaDB, the table types, column types, OGC geometry types, available server daemons, indexing mechanisms and connection parameters.

Please note that MariaDB functionality that only exists in the MariaDB road map and not in practice (such as integration of the Spatial Reference Systems (SRS), spatial metadata tables, spatial operators, server side cursors and views) were considered but are not currently integrated into the MariaDB reader for FME.

读者概述

FME considers a MariaDB dataset to be a database containing a collection of relational tables, and a table to be an FME feature type with each row corresponding to at least one FME feature. In the case of geometry collections, a single row may become more than one FME feature.

Tables schemas must be defined in the FME workspace before they can be read and can consist of both geometric and primary column types, however, only one geometry column is read per table while others are discarded.

Arbitrary WHERE clauses and joins are fully supported, as well as an entire arbitrary SQL SELECT statement. The basic reading process involves opening a connection to the database, querying metadata, and querying data. The data is read by submitting SQL queries and parsing the returned result sets.

如果读取空几何,则将它们视为非几何特征,并且属性保留。

Writer Overview

The MariaDB writer module stores both geometry and attributes into an MariaDB database. The MariaDB writer provides the following capabilities:

  • Transaction Support:MariaDB Writer提供了交易支持,可以缓解数据加载过程。偶尔,数据负载操作由于数据困难而过早地终止。事务支持提供了一种用于重新加载校正数据而无需数据丢失或重复的机制。通过减少诸如插入的多个小型查询的事务开销也可以提高性能。
  • Index Creation:The MariaDB writer can set up and populate indexes as part of the loading process. By default, a spatial R-Tree index is created on the primary geometry column of a table and not on any other columns. Additional columns can be individually indexed. Composite column indexes are not supported at this time.
  • Insert Binding:By default, the MariaDB writer uses prepared statements and query parameter binding ensure speedy data loading.

Each MariaDB table must be defined before it can be written.

The table definition allows control of the table that will be created. If the table already exists, the majority of themysql_parameters will be ignored (and are therefore not required). If thefields and typesare listed, they must match those in the database.

If the table does not exist, then the field names and types are used to first create the table. If a field type is given, it may be any field type supported by the target database.