Skip to content
⚡ Remote Connections

Remote Connections

Homogeneous Database Connections

WordPress uses a MariaDB or MySQL database to store its data. A connection to another local or remote MariaDB or MySQL database is known as a homogeneous database connection — a connection to a similar database management system.

💡 WP Data Access supports local and remote homogeneous database connections out of the box. Remote databases need to be configured in the Data Explorer, while local databases will be available automatically if the database user has the necessary privileges.

📌 These connections do NOT require a premium license.

Heterogeneous Database Connections

  • SQL Server
  • Oracle
  • PostgreSQL
  • MS Access

A heterogeneous database connection is a remote connection to a different database management system (e.g., SQL Server, Oracle, PostgreSQL, or MS Access). These connections require additional resources, technologies, and configuration.

Connecting to a Heterogeneous Database

💡 WP Data Access users can connect to heterogeneous databases in three ways:

  1. Using the CONNECT engine (requires MariaDB and full OS access). (read more...)
  2. Setting up your own proxy server (requires a proxy server and full OS access). (read more...)
  3. Using our Premium Data Service (zero configuration). (read more...)

Plugin Tools

Heterogeneous connections are available in all WP Data Access tools. You can use tables and views from heterogeneous remote database connections in the same way as those from homogeneous connections.

📌 Check your data types before updating data (see limitations).
📌 A table must have a primary key or unique index to support transactions.

Custom PHP Code

You can also access heterogeneous database connections in custom PHP code.

✨ Example: PHP Code Accessing Any Remote Database
php
<?php

	function heterogeneous_connection_example() {
		$wpdadb = WPDataAccess\Connection\WPDADB::get_db_connection( 'rdb:wpdafree.youniquedata.com' );
		$rows   = $wpdadb->get_results( 'select * from my_table' );
		foreach ( $rows as $row ) {
			// Process table rows here...
		}
	}

	add_action('plugins_loaded', 'heterogeneous_connection_example');

?>
  • CSV Files
  • JSON Files
  • XML Files
  • The table my_table can be from SQL Server, MS Access, Oracle, or PostgreSQL. It can also be a public CSV, JSON, or XML file that is automatically converted to a table.
  • The example connects to our premium proxy database server rdb:wpdafree.youniquedata.com.
  • The WPDADB class is a subclass of the WordPress wpdb class and supports all wpdb methods (such as query, get_results, insert, update, and delete) for accessing your remote heterogeneous database.

Limitations

  • Connections through a proxy introduce a delay. The duration depends on the locations of the servers involved (web server, proxy server, and database server).
  • Remote table structure modifications must be synchronized locally.
  • Remote data types not available in MariaDB or MySQL are converted. Check your column types before updating data.
  • Text columns are truncated after 1024 characters.