rdr/snowflakejodo
Composer 安装命令:
composer require rdr/snowflakejodo
包简介
SnowflakeJodo: A Snowflake wrapper for Laravel, designed to optimize connection times within Laravel applications.
README 文档
README
SnowflakeJodo provides a convenient way to integrate your Laravel application with a Snowflake data warehouse via a dedicated Node.js API. It simplifies data retrieval and reduces connection overhead common in direct Snowflake interactions.
Installation
-
Require the Package: Use Composer to install the package in your Laravel project:
composer require rdr/snowflakejodo
This will install the package and its dependencies.
-
Publish Configuration: Publish the package configuration file:
php artisan vendor:publish --tag=snowflakejodo-config
This will create a
config/snowflakejodo.phpfile in your project. -
Configure API URL: Update the
api_urlvalue in your.envfile to point to your running Node.js API endpoint:SNOWFLAKE_JODO_API_URL=http://localhost:3001
Replace
http://localhost:3001with the actual URL of your API. -
Create and Run Node.js API: Set up and run a separate Node.js API that handles the direct communication with Snowflake. Make sure the API is running and accessible at the URL you configured in
.env.
Usage
Establish a Connection
Create an instance of SnowflakeJodo using the connect() method:
use Rdr\SnowflakeJodo\SnowflakeJodo; // In a controller: class MyController extends Controller { protected $snowflake; public function __construct() { $this->snowflake = SnowflakeJodo::connect(); } // ... your controller methods ... }
Execute Queries
Use the query() method on the connection object to run Snowflake SQL queries:
$results = $this->snowflake->query("SELECT * FROM users WHERE id = ?", [1]);
Error Handling
SnowflakeJodo throws a Rdr\SnowflakeJodo\Exceptions\SnowflakeConnectionException if there are errors connecting to your API or if the API returns an error from Snowflake. Handle this exception gracefully in your application.
Security
- Securely Configure Node.js API: Follow security best practices when configuring and deploying the API, such as using environment variables to store credentials.
- API Authentication (Optional): Enhance security by implementing an authentication mechanism between your Laravel application and the Node.js API (e.g., API keys, JWTs).
Contributing
Thank you for considering contributing to SnowflakeJodo! Please read the Contribution Guide before submitting a pull request.
License
The MIT License (MIT). Please see License File for more information.
Dhiraj Lochib
- GitHub: @dhirajlochib
rdr/snowflakejodo 适用场景与选型建议
rdr/snowflakejodo 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 646 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 06 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 rdr/snowflakejodo 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 rdr/snowflakejodo 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 646
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-06-12