henriknordstrom/laravel-pdo-odbc-patched
Composer 安装命令:
composer require henriknordstrom/laravel-pdo-odbc-patched
包简介
Laravel PDO ODBC with Laravel 12 fix
README 文档
README
A Laravel package that provides PDO ODBC connection drivers for Laravel 12, with special support for Snowflake database connections.
This project is forked from appsfortableau/laravel-pdo-odbc.
Description
This package extends Laravel's database functionality to support ODBC connections, with specific optimizations for Snowflake databases. It supports both ODBC connections and native Snowflake PDO driver connections.
Requirements
- PHP 8.0 or higher
- Laravel 12.0 or higher
- ODBC drivers for your database
- For Snowflake native connections: pdo_snowflake PHP extension
Installation
You can install the package via composer:
composer require henriknordstrom/laravel-pdo-odbc-patched
The package will automatically register its service provider.
Configuration
Add a new connection to your config/database.php file:
For general ODBC connections:
'connections' => [ // ... 'odbc' => [ 'driver' => 'odbc', 'odbc_driver' => '/path/to/your/odbc/driver.so', // Required: absolute path to the ODBC driver 'dsn' => 'your-dsn-string', // Optional: full DSN string 'host' => 'your-host', 'database' => 'your-database', 'username' => 'your-username', 'password' => 'your-password', 'options' => [ // PDO options ], ], // ... ],
For Snowflake via ODBC:
'connections' => [ // ... 'snowflake' => [ 'driver' => 'snowflake', 'odbc_driver' => '/path/to/your/snowflake/odbc/driver.so', 'host' => 'your-account.snowflakecomputing.com', 'database' => 'your-database', 'username' => 'your-username', 'password' => 'your-password', 'warehouse' => 'your-warehouse', 'role' => 'your-role', 'options' => [ // PDO options 'grammar' => [ 'query' => null, // Custom query grammar class 'schema' => null, // Custom schema grammar class ], 'processor' => null, // Custom processor class ], ], // ... ],
For Snowflake via native PDO driver:
'connections' => [ // ... 'snowflake_native' => [ 'driver' => 'snowflake_native', 'host' => 'your-account.snowflakecomputing.com', 'database' => 'your-database', 'username' => 'your-username', 'password' => 'your-password', 'warehouse' => 'your-warehouse', 'role' => 'your-role', 'options' => [ // PDO options ], ], // ... ],
Environment Variables
You can set the following environment variables in your .env file:
SNOWFLAKE_COLUMNS_CASE_SENSITIVE=false
SNOWFLAKE_DISABLE_FORCE_QUOTED_IDENTIFIER=false
Usage
Once configured, you can use the connection like any other Laravel database connection:
use Illuminate\Support\Facades\DB; // Query using the ODBC connection $results = DB::connection('odbc')->select('SELECT * FROM your_table'); // Query using the Snowflake connection $results = DB::connection('snowflake')->select('SELECT * FROM your_table'); // Query using the Snowflake native connection $results = DB::connection('snowflake_native')->select('SELECT * FROM your_table');
Features
- Support for general ODBC connections
- Specialized support for Snowflake databases
- Support for both ODBC and native Snowflake PDO driver connections
- Custom query grammar for Snowflake
- Custom schema grammar for Snowflake
- Custom processor for Snowflake
- Support for PHP 8.0+ with specialized statement classes
License
This package is open-sourced software licensed under the MIT license.
Author
- Henrik Nordstrom (henrik@webtractive.com)
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
henriknordstrom/laravel-pdo-odbc-patched 适用场景与选型建议
henriknordstrom/laravel-pdo-odbc-patched 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 674 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 06 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「pdo」 「odbc」 「driver」 「Connection」 「laravel」 「snowflake」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 henriknordstrom/laravel-pdo-odbc-patched 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 henriknordstrom/laravel-pdo-odbc-patched 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 henriknordstrom/laravel-pdo-odbc-patched 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Dibi is Database Abstraction Library for PHP
laravel-ibmi is a simple DB2 & Toolkit for IBMi service provider for Laravel. It provides DB2 Connection by extending the Illuminate Database component of the laravel framework. Plus it also provides Toolkit for IBMi so that you can access IBMi resources with same credentials.
Dibi is Database Abstraction Library for PHP
Galera cluster driver for Doctrine
A PHP client driver for the RethinkDB query language (ReQL)
Laravel database driver to connect to a sqlanywhere database instance
统计信息
- 总下载量: 674
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 28
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-06-05