PHPackages                             sukhilss/laravel-odbc-hive - 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. sukhilss/laravel-odbc-hive

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

sukhilss/laravel-odbc-hive
==========================

laravel-odbc-hive is a simple hive service provider for Laravel. It provides hive Connection by extending the Illuminate Database component of the laravel framework.

v6.0.4(6y ago)2152MITPHPPHP ^7.2CI passing

Since Oct 18Pushed 1w ago1 watchersCompare

[ Source](https://github.com/sukhilss/laravel-odbc-hive)[ Packagist](https://packagist.org/packages/sukhilss/laravel-odbc-hive)[ RSS](/packages/sukhilss-laravel-odbc-hive/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

laravel-odbc-hive
=================

[](#laravel-odbc-hive)

Apache Hive database driver for Laravel, over ODBC/PDO. Registers a `hive`connection you can use alongside your application's default database — query it with the standard query builder or Eloquent, and create tables with a Hive-specific `Schema` builder.

[![CI](https://github.com/sukhilss/laravel-odbc-hive/actions/workflows/ci.yml/badge.svg)](https://github.com/sukhilss/laravel-odbc-hive/actions/workflows/ci.yml)[![Latest Version on Packagist](https://camo.githubusercontent.com/fb30ca3c86525d2600552bda8ebc9856cf722603e0dd82784f5b2b8f936cb18c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73756b68696c73732f6c61726176656c2d6f6462632d686976652e737667)](https://packagist.org/packages/sukhilss/laravel-odbc-hive)[![Total Downloads](https://camo.githubusercontent.com/a10161255a351bd7aaa9f606b2198819685aa67991e94420ee8add06fddec331/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73756b68696c73732f6c61726176656c2d6f6462632d686976652e737667)](https://packagist.org/packages/sukhilss/laravel-odbc-hive)[![License](https://camo.githubusercontent.com/0c1a00edaf72d36ed9422f62f83f1ef05469b64ce83ecaa732d7cf090d080a3c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f73756b68696c73732f6c61726176656c2d6f6462632d686976652e737667)](LICENSE.md)

Requirements
------------

[](#requirements)

PackageLaravelPHPv7.x (this branch)11.x, 12.x8.2+v6.x6.x7.2+If you're on Laravel 6, stay on `^6.0` of this package — see the [`v6.0.4` tag](https://github.com/sukhilss/laravel-odbc-hive/tree/v6.0.4). Note that v6.x is **end of life**: [`SECURITY.md`](SECURITY.md) states that security reports against v6.x will not receive a patched release, so treat `^6.0` as a place to sit while you upgrade, not a supported version. Everything below documents v7.

What you need that this package does not provide
------------------------------------------------

[](#what-you-need-that-this-package-does-not-provide)

**A Hive ODBC driver.** This package talks to Hive over `PDO_ODBC`, which needs an ODBC driver installed on the machine running your application — Cloudera's, the one most commonly used in practice, is **proprietary** and cannot be bundled with this package or installed via Composer. Installing this package alone will not get you a working connection. See [`docs/local-development.md`](docs/local-development.md) for how the driver fits in (and how to develop against this repository without one).

Installation
------------

[](#installation)

```
composer require sukhilss/laravel-odbc-hive:^7.0
```

Laravel's package auto-discovery picks up `HiveServiceProvider`automatically (`composer.json`'s `extra.laravel.providers`) — no manual registration needed. As soon as you set `HIVE_DSN` (below), `DB::connection('hive')`and `Schema::connection('hive')` resolve to a working connection.

To customize the config instead of relying on environment variables alone, publish it:

```
php artisan vendor:publish --tag=hive-config
```

This copies the package's `config/hive.php` to your application's `config/hive.php`. See [`docs/configuration.md`](docs/configuration.md) for every key, the DSN formats accepted, and how to run Hive as a secondary connection alongside MySQL/PostgreSQL — the common case.

Quick start
-----------

[](#quick-start)

Set the connection in `.env`:

```
HIVE_DSN=Driver=Hive;Host=your-host;Port=10000
HIVE_USERNAME=
HIVE_PASSWORD=
HIVE_DATABASE=default

```

Query it like any other Laravel connection:

```
use Illuminate\Support\Facades\DB;

DB::connection('hive')->table('events')->where('event_date', '2026-07-01')->get();
```

Executing `->get()` needs a live Hive server and ODBC driver, neither of which this repository has. The query still compiles correctly without one — verified by building a real `HiveQueryGrammar`-backed query builder and calling `->toSql()`:

```
select * from events where event_date = ?

```

Create a table with the Hive-specific schema builder:

```
use Illuminate\Support\Facades\Schema;
use Sukhil\Database\Hive\Schema\HiveBlueprint;

Schema::connection('hive')->create('events', function (HiveBlueprint $table) {
    $table->string('name');
    $table->storedAs('ORC')->location('/warehouse/events');
});
```

Compiled directly through `HiveSchemaGrammar` (again, no live connection needed — schema compilation is pure string generation):

```
create table events (name string) STORED AS ORC LOCATION '/warehouse/events'
```

**Before you write the matching `down()`:** schema support here is CREATE-only. `Schema::dropIfExists()` (and `drop()`, `rename()`, and adding a column via `Schema::table()`) compiles to **zero** SQL statements and returns successfully having done nothing — no exception, no warning. A rollback written the usual way will silently leave the table in place. See [`docs/limitations.md`](docs/limitations.md) for the full list and what to do instead.

See [`docs/schema-builder.md`](docs/schema-builder.md) for the full column type mapping and every Hive-specific option.

Documentation
-------------

[](#documentation)

- [`docs/configuration.md`](docs/configuration.md) — connection setup, config keys, DSN formats, running Hive as a secondary connection.
- [`docs/schema-builder.md`](docs/schema-builder.md) — the Hive-specific schema builder API and column type mapping.
- [`docs/limitations.md`](docs/limitations.md) — everything this driver does not do, or does differently than you'd expect: dropped column modifiers, CREATE-only schema support, unbound raw statement parameters, and more. Read this before relying on the driver for anything beyond basic `CREATE TABLE` and `SELECT`.
- [`docs/local-development.md`](docs/local-development.md) — building, testing, and linting this package, and how the Docker toolchain (and the ODBC driver gap) fits together.

Troubleshooting
---------------

[](#troubleshooting)

**"Hive DSN is not configured"** — thrown by `HiveConnector::connect()`when the `dsn` config key (or `HIVE_DSN` env var) is missing or empty:

```
InvalidArgumentException: Hive DSN is not configured. Set the "dsn" key on
the connection (or the HIVE_DSN environment variable) to an ODBC DSN.

```

Set `HIVE_DSN` in `.env`, or the `dsn` key if you've published the config.

**"Unsafe Hive identifier"** — thrown by `HiveIdentifier` when a table or column name contains anything other than letters, digits, and underscores (Hive identifiers are never quoted by this driver — see [`docs/limitations.md`](docs/limitations.md)):

```
InvalidArgumentException: Unsafe Hive identifier 'my-table': only letters,
digits and underscores are permitted.

```

Rename the table/column, or sanitize any user-supplied name before it reaches the query builder.

**"could not find driver"** — a plain `PDOException` thrown by PDO itself, not by this package, when the `pdo_odbc` extension isn't installed on the machine trying to connect:

```
PDOException: could not find driver

```

Install `pdo_odbc` (and an ODBC driver for Hive — see "What you need that this package does not provide" above). `composer.json` only *suggests*`ext-odbc`, since this package cannot install a Hive ODBC driver for you.

Contributing
------------

[](#contributing)

Bug reports and pull requests are welcome. See [`docs/local-development.md`](docs/local-development.md) for how to build, test, and lint this package before submitting a PR — the full local gate is `composer test && composer lint && composer analyse`, all run through `docker compose run --rm php`. See [`CONTRIBUTING.md`](CONTRIBUTING.md) for the full guidelines, and the [Code of Conduct](CODE_OF_CONDUCT.md) that applies to all project spaces.

Security
--------

[](#security)

If you find a security issue, please report it privately (via GitHub's security advisory feature on this repository) rather than opening a public issue. See [`SECURITY.md`](SECURITY.md) for the full policy, including how to report by email.

License
-------

[](#license)

MIT. See [`LICENSE.md`](LICENSE.md).

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance64

Regular maintenance activity

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~4 days

Total

4

Last Release

2480d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17767975?v=4)[Sukhil S S](/maintainers/sukhilss)[@sukhilss](https://github.com/sukhilss)

---

Top Contributors

[![sukhilss](https://avatars.githubusercontent.com/u/17767975?v=4)](https://github.com/sukhilss "sukhilss (55 commits)")

---

Tags

laraveldatabasepdoodbchive

### Embed Badge

![Health badge](/badges/sukhilss-laravel-odbc-hive/health.svg)

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

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.9M109](/packages/mongodb-laravel-mongodb)[cooperl/laravel-db2

laravel-db2 is a simple DB2 service provider for Laravel. It provides DB2 Connection by extending the Illuminate Database component of the laravel framework.

58126.5k1](/packages/cooperl-laravel-db2)[ntanduy/cloudflare-d1-database

Cloudflare D1 database driver for Laravel — full Eloquent &amp; Query Builder support.

278.2k](/packages/ntanduy-cloudflare-d1-database)

PHPackages © 2026

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