Download the PHP package datadistillr/drill-sdk-php without Composer
On this page you can find all versions of the php package datadistillr/drill-sdk-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download datadistillr/drill-sdk-php
More information about datadistillr/drill-sdk-php
Files in datadistillr/drill-sdk-php
Package drill-sdk-php
Short Description PHP SDK for programmatically connecting to Apache Drill.
License Apache-2.0
Homepage https://datadistillr.com
Informations about the package drill-sdk-php
PHP SDK Library for Connecting to Apache Drill.
This library allows you to connect to and query Apache Drill programmatically. It is loosely modeled after PHP's mysql interface, so if you are familiar with that, you already pretty much know how to use the Drill connector.
Installing the Library
This library can be installed using Composer by using the following command:
The current pre-release version is: 0.7.17
Using the Connector
The first step is to make a Drill connection handle. The module uses Drill's RESTful interface, so it will not maintain an open connection like a typical JDBC/ODBC connection would.
You can use the is_active()
menthod to verify that your connection is active.
Querying Drill
Now that you've created your Drill connection handle, you can query Drill in a similar fashion as MySQL by calling
the query()
method. Once you've called the query()
method, you can use one of the fetch()
methods to retrieve
the results, in a similar manner as MySQL. Currently, the Drill connector currently has:
fetchAll()
: Returns all query results in an associative array.fetchAssoc()
: Returns a single query row as an associative array.fetchObject()
: Returns a single row as a PHP Object.
You might also find these functions useful:
dataSeek($n)
: Returns the row at index$n
and sets the current row to$n
.numEows()
: Returns the number of rows returned by the query.fieldCount()
: Returns the number of columns returned by the query.
Thus, if you want to execute a query in Drill, you can do so as follows:
Interacting with Drill
You can also use the connector to activate/deactivate Drill's storage as well as get information about Drill's plugins.
disablePlugin( $plugin )
Disables the given plugin. Returns true if successful, false if not.enablePlugin( $plugin )
Enables the given plugin. Returns true if successful, false if not.getAllStoragePlugins()
Returns an array of all storage plugins.getDisabledStoragePlugins()
Returns an array of all disabled plugins.getEnabledStoragePlugins()
Returns an array of all enabled plugins.getStoragePlugins()
Returns an associative array of plugins and associated configuration options for all plugins.getStoragePluginInfo( $plugin )
Returns an associative array of configuration options for a given plugin.saveStoragePlugin( $plugin_name, $config )
Creates or edits a storage plugin. Returns true if successful, throws exception if not.deleteStoragePlugin( $plugin_name )
Deletes a storage plugin. Returns true if successful, throws exception if not.
All versions of drill-sdk-php with dependencies
ext-curl Version *
ext-json Version *