定制 reedtechus/azure-data-explorer-laravel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

reedtechus/azure-data-explorer-laravel

Composer 安装命令:

composer require reedtechus/azure-data-explorer-laravel

包简介

Azure Data Explorer SDK for Laravel

README 文档

README

logo-print-hd-transparent

Azure Data Explorer SDK for Laravel

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

This project is a Laravel package that allows you to connect to Azure Data Explorer and execute queries from your Laravel Application.

⚠️ 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.

This package is a direct extension of the Azure Data Explorer SDK for PHP by Reed Tech which provides a PHP SDK to interact with the Azure Data Explorer REST API.

Goals

The goal of this project is to provide a Laravel friendly interface to the Azure Data Explorer SDK package.

Feature Roadmap

  • Caching via Redis

Installation

You can install the package via composer:

composer require reedtechus/azure-data-explorer-laravel

The following environment variables are required for this package to work:

# Azure Data Explorer
AZURE_DATA_EXPLORER_TENANT_ID="TENANT_ID"
AZURE_DATA_EXPLORER_CLIENT_ID="CLIENT_ID"
AZURE_DATA_EXPLORER_CLIENT_SECRET="SECRET"
AZURE_DATA_EXPLORER_CLUSTER="CLUSTER"
AZURE_DATA_EXPLORER_REGION="REGION"
AZURE_DATA_EXPLORER_DATABASE="DATABASE_NAME"

You can publish the config file with:

php artisan vendor:publish --tag="azure-data-explorer-laravel-config"

This is the contents of the published config file:

return [
	/*
    |--------------------------------------------------------------------------
    | Azure Data Explorer
    |--------------------------------------------------------------------------
    |
    | This is the configuration for the Azure Data Explorer package.
    |
    */

    // The base URL of the Azure Data Explorer API.
    'base_url' => env('AZURE_DATA_EXPLORER_BASE_URL', 'https://login.microsoftonline.com'),

    // The tenant ID of the Azure Data Explorer API.
    'tenant_id' => env('AZURE_DATA_EXPLORER_TENANT_ID'),

    // The client ID of the Azure Data Explorer API.
    'client_id' => env('AZURE_DATA_EXPLORER_CLIENT_ID'),

    // The client secret of the Azure Data Explorer API.
    'client_secret' => env('AZURE_DATA_EXPLORER_CLIENT_SECRET'),

    // The cache driver to use for caching responses.
    'cache_driver' => env('AZURE_DATA_EXPLORER_CACHE_DRIVER', 'redis'),

    // The cache TTL to use for caching responses.
    'cache_ttl' => env('AZURE_DATA_EXPLORER_CACHE_TTL', 3500),

    // The cluster of the Azure Data Explorer API.
    'cluster' => env('AZURE_DATA_EXPLORER_CLUSTER'),

    // The region of the Azure Data Explorer API.
    'region' => env('AZURE_DATA_EXPLORER_REGION'),

	// The database of the Azure Data Explorer API.
	'database' => env('AZURE_DATA_EXPLORER_DATABASE'),
];

Usage

// Option A: More efficient to save and re-use the AzureDataExplorer class instance for followup queries
$de = new AzureDataExplorer();
$results = $de->query($query);

// Option B: you can use the AzureDataExplorer::queryOnce() method to perform the query
$results = AzureDataExplorer::queryOnce($query);

These calls return a QueryResultsDTO object (or throw 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

Dependencies

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.

reedtechus/azure-data-explorer-laravel 适用场景与选型建议

reedtechus/azure-data-explorer-laravel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 24 次下载、GitHub Stars 达 2, 最近一次更新时间为 2022 年 11 月 08 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「reedtechus」 「azure-data-explorer-laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 reedtechus/azure-data-explorer-laravel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 reedtechus/azure-data-explorer-laravel 我们能提供哪些服务?
定制开发 / 二次开发

基于 reedtechus/azure-data-explorer-laravel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 24
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 9
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-11-08