reedtechus/azure-data-explorer

PHP SDK for Azure Data Explorer

v0.3.2 2023-04-01 18:15 UTC

README

logo-print-hd-transparent

PHP SDK for Azure Data Explorer

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This project is a PHP library that allows you to connect to Azure Data Explorer and execute queries.

⚠️ Experimental: This package is still in development and is not ready for production use.

Breaking changes can still occur without a major version change until 1.0.0.

Goals

The goal of this project is to implement the Azure Data Explorer REST API in PHP.

Feature Roadmap

  • Authentication
  • Query
  • Streaming Ingestion
  • Management Commands
  • Query v2

Installation

You can install the package via composer:

composer require reedtechus/azure-data-explorer

Usage

use ReedTech\AzureDataExplorer\AzureDataExplorerApi;

$dataExplorer = new AzureDataExplorerApi(
	'AZURE_TENANT_ID',
	'AZURE_CLIENT_ID',
	'AZURE_CLIENT_SECRET',
	'AZURE_DATA_EXPLORER_REGION',
	'AZURE_DATA_EXPLORER_CLUSTER',
);
$results = $dataExplorer->query($query);

This returns a QueryResultsDTO object (or throws an exception).

Using the results

dump('Columns: '.implode(', ', $results->columns));
dump('Number of Results: '.count($results->data));
dump('Execution Time: '.$results->executionTime);

dump('First Row: '.print_r($results->data[0], true));

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

This package is not endorsed nor supported by Microsoft in any way.

License

The MIT License (MIT). Please see License File for more information.