PHPackages                             yoramdelangen/laravel-pdo-odbc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. yoramdelangen/laravel-pdo-odbc

ActiveLibrary[Database &amp; ORM](/categories/database)

yoramdelangen/laravel-pdo-odbc
==============================

PDO ODBC/Snowflake integration for Laravel framework. Support ODBC and native PDO Snowflake.

2.0.3(2mo ago)38229.3k—8.7%33[7 issues](https://github.com/yoramdelangen/laravel-pdo-odbc/issues)[2 PRs](https://github.com/yoramdelangen/laravel-pdo-odbc/pulls)MITPHPPHP ^8.2

Since Mar 11Pushed 2mo ago6 watchersCompare

[ Source](https://github.com/yoramdelangen/laravel-pdo-odbc)[ Packagist](https://packagist.org/packages/yoramdelangen/laravel-pdo-odbc)[ Docs](https://github.com/appsfortableau/laravel-pdo-odbc)[ RSS](/packages/yoramdelangen-laravel-pdo-odbc/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (22)Used By (0)

ODBC/Snowflake Integration for Laravel Framework
================================================

[](#odbcsnowflake-integration-for-laravel-framework)

Enjoying this project?

[![Buy us a coffee](https://camo.githubusercontent.com/e1d150199d4aee964938afd4f7a1e7092b2419eb2bdc186e18e74d20a7047356/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2545322539382539352d427579253230757325323061253230636f666665652d6f72616e6765)](https://buy.stripe.com/5kAdTS2Xm45p2IM9AA)

This repository provides seamless integration of ODBC/Snowflake with Laravel Eloquent. It aims to create a comprehensive ODBC package for Laravel, while also functioning as a standalone solution.

Unlike the `odbc_*` functions, this package utilizes the `PDO` class, resulting in smoother and more convenient integration with Eloquent.

The primary goal of this package is to offer a standardized approach to connect with an ODBC connection. It supports custom grammars and schemas to accommodate various ODBC connections, such as Snowflake.

How to Install
--------------

[](#how-to-install)

Before proceeding, ensure that you have PHP version 8.x installed on your system.

To add the package to your project, run the following command:

```
composer require yoramdelangen/laravel-pdo-odbc
```

By default, the package will be automatically registered through the `package:discover` command.

Alternatively, you can manually register the service provider in the `app.php` file:

```
'providers' => [
  // ...
  LaravelPdoOdbc\ODBCServiceProvider::class,
];
```

If you intend to use the `snowflake_pdo` PHP extension, please follow the installation guide provided [here](https://github.com/snowflakedb/pdo_snowflake/)to set it up.

Starting from version `1.2.0`, the package includes support for `snowflake_pdo`, but it will still function without the Snowflake extension (via ODBC).

Configuration
-------------

[](#configuration)

The available driver flavors are:

- ODBC (generic)
- Snowflake (via ODBC and native through PHP extension)
- ...

### Snowflake Specific environment variables

[](#snowflake-specific-environment-variables)

You have the option to customize the Snowflake driver using the following parameters:

```
# When set to `false`, column names are automatically uppercased.
SNOWFLAKE_COLUMNS_CASE_SENSITIVE=false

# When set to `true`, column names are wrapped in double quotes and their
# case is determined by the input.
SNOWFLAKE_COLUMNS_CASE_SENSITIVE=true
```

### Snowflake Query Grammar options

[](#snowflake-query-grammar-options)

When using the Snowflake flavour, the query grammar compiles `LIKE` clauses as `ILIKE` by default (case-insensitive). You can disable this behavior per connection:

```
'snowflake_pdo' => [
    // ...
    'options' => [
        'use_ilike' => false,
    ],
],
```

Usage
-----

[](#usage)

Configuring the package is straightforward:

**Add a Database Configuration to `database.php`**

Starting from version 1.2, we recommend using the native Snowflake extension instead of ODBC, but we'll keep supporting it.

```
'snowflake_pdo' => [
    'driver' => 'snowflake_native',
    'account' => '{account_name}.eu-west-1',
    'username' => '{username}',
    'password' => '{password}',
    'database' => '{database}',
    'warehouse' => '{warehouse}',
    'schema' => 'PUBLIC', // change it if necessary.
    'options' => [
        // Required for Snowflake usage
        \PDO::ODBC_ATTR_USE_CURSOR_LIBRARY => \PDO::ODBC_SQL_USE_DRIVER
    ]
],
```

You have multiple ways to configure the ODBC connection:

1. Simple configuration using DSN only:

    ```
    'odbc-connection-name' => [
        'driver' => 'odbc',
        'dsn' => 'OdbcConnectionName', // odbc: will be prefixed
        'username' => 'username',
        'password' => 'password'
    ]
    ```

    or, if you don't have a datasource configured within your ODBC Manager:

    ```
    'odbc-connection-name' => [
        'driver' => 'odbc',
        'dsn' => 'Driver={Your Snowflake Driver};Server=snowflake.example.com;Port=443;Database={DatabaseName}',
        'username' => 'username',
        'password' => 'password'
    ]
    ```

    > Note: The DSN `Driver` parameter can either be an absolute path to your driver file or the name registered within the `odbcinst.ini` file/ODBC manager.
2. Dynamic configuration:

    ```
    'odbc-connection-name' => [
        'driver' => 'snowflake',
        // please change this path accordingly your exact location
        'odbc_driver' => '/opt/snowflake/snowflakeodbc/lib/universal/libSnowflake.dylib',
        // 'odbc_driver' => 'Snowflake path Driver',
        'server' => 'host.example.com',
        'username' => 'username',
        'password' => 'password',
        'warehouse' => 'warehouse name',
        'schema' => 'PUBLIC', // most ODBC connections use the default value
    ]
    ```

    > All fields, except for `driver`, `odbc_driver`, `options`, `username`, and `password`, will be dynamically added to the DSN connection string.
    >
    > Note: The DSN `odbc_driver` parameter can either be an absolute path to your driver file or the name registered within the `odbcinst.ini`file/ODBC manager.

Eloquent ORM
------------

[](#eloquent-orm)

You can use Laravel, Eloquent ORM, and other Illuminate components as usual.

```
# Facade
$books = DB::connection('odbc-connection-name')
            ->table('books')
            ->where('Author', 'Abram Andrea')
            ->get();

# ORM
$books = Book::where('Author', 'Abram Andrea')->get();
```

Troubleshooting and more info
-----------------------------

[](#troubleshooting-and-more-info)

We have documented all weird behavious we encountered with the ODBC driver for Snowflake. In case of trouble of weird messages, checkout the following links:

- [Snowflake ODBC](docs/snowflake-odbc.md)
- [Snowflake ODBC Troubleshooting](docs/snowflake-odbc-troubleshooting.md)

Customization
-------------

[](#customization)

- [Custom `getLastInsertId()` Function](docs/custom-last-insert-id.md)
- [Custom Processor/QueryGrammar/SchemaGrammar](docs/custom-grammers.md)

###  Health Score

61

—

FairBetter than 99% of packages

Maintenance83

Actively maintained with recent releases

Popularity49

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 61.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~101 days

Recently: every ~145 days

Total

19

Last Release

71d ago

Major Versions

1.2.5 → 2.0.02025-06-20

PHP version history (4 changes)1.0.0PHP &gt;=7.3

1.2.0PHP &gt;=8.0

1.2.1PHP ^7.4|^8.0

2.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b5ac6b4a4c4e5cda06be87ab10f3767b803244212907064c40e650fc97ac8af?d=identicon)[yoramdelangen](/maintainers/yoramdelangen)

---

Top Contributors

[![yoramdelangen](https://avatars.githubusercontent.com/u/1531885?v=4)](https://github.com/yoramdelangen "yoramdelangen (58 commits)")[![nvzsolutions](https://avatars.githubusercontent.com/u/6881597?v=4)](https://github.com/nvzsolutions "nvzsolutions (19 commits)")[![andreossido](https://avatars.githubusercontent.com/u/33807066?v=4)](https://github.com/andreossido "andreossido (9 commits)")[![aiv-damian](https://avatars.githubusercontent.com/u/132932727?v=4)](https://github.com/aiv-damian "aiv-damian (4 commits)")[![merlijnbuit](https://avatars.githubusercontent.com/u/16118919?v=4)](https://github.com/merlijnbuit "merlijnbuit (2 commits)")[![actengage](https://avatars.githubusercontent.com/u/33735047?v=4)](https://github.com/actengage "actengage (1 commits)")[![nzscripps](https://avatars.githubusercontent.com/u/109313080?v=4)](https://github.com/nzscripps "nzscripps (1 commits)")[![sha1sum](https://avatars.githubusercontent.com/u/7863437?v=4)](https://github.com/sha1sum "sha1sum (1 commits)")

---

Tags

databaseodbcsnowflake

### Embed Badge

![Health badge](/badges/yoramdelangen-laravel-pdo-odbc/health.svg)

```
[![Health](https://phpackages.com/badges/yoramdelangen-laravel-pdo-odbc/health.svg)](https://phpackages.com/packages/yoramdelangen-laravel-pdo-odbc)
```

###  Alternatives

[watson/validating

Eloquent model validating trait.

9723.3M47](/packages/watson-validating)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[genealabs/laravel-pivot-events

This package introduces new eloquent events for sync(), attach(), detach() or updateExistingPivot() methods on BelongsToMany relation.

1404.9M8](/packages/genealabs-laravel-pivot-events)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
