PHPackages                             renoki-co/laravel-thermite - 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. renoki-co/laravel-thermite

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

renoki-co/laravel-thermite
==========================

Laravel Thermite is an extended PostgreSQL Laravel database driver to connect to a CockroachDB cluster.

1.0.0(4y ago)71221[3 PRs](https://github.com/renoki-co/laravel-thermite/pulls)Apache-2.0PHPCI passing

Since Aug 5Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/renoki-co/laravel-thermite)[ Packagist](https://packagist.org/packages/renoki-co/laravel-thermite)[ Docs](https://github.com/renoki-co/laravel-thermite)[ GitHub Sponsors](https://github.com/rennokki)[ RSS](/packages/renoki-co-laravel-thermite/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (6)Versions (6)Used By (0)

Laravel Thermite
================

[](#laravel-thermite)

[![CI](https://github.com/renoki-co/laravel-thermite/workflows/CI/badge.svg?branch=master)](https://github.com/renoki-co/laravel-thermite/workflows/CI/badge.svg?branch=master)[![codecov](https://camo.githubusercontent.com/56d6d3cb2114b6ae07622c1ee63a6c53b60a9b7adaa2955ba6b24056c2b5bccf/68747470733a2f2f636f6465636f762e696f2f67682f72656e6f6b692d636f2f6c61726176656c2d746865726d6974652f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/renoki-co/laravel-thermite/branch/master)[![StyleCI](https://camo.githubusercontent.com/7ffa8434cc27c3427751274fd9c14b1efd68a9a83719493678c70b74494acead/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3338363637323833302f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/386672830)[![Latest Stable Version](https://camo.githubusercontent.com/6ad5c21dfcc1722ce962e37753ca3930c43fa9e22ac17c0d9442e313e55b2a97/68747470733a2f2f706f7365722e707567782e6f72672f72656e6f6b692d636f2f6c61726176656c2d746865726d6974652f762f737461626c65)](https://packagist.org/packages/renoki-co/laravel-thermite)[![Total Downloads](https://camo.githubusercontent.com/f86fb3fd8b733c7896148bb944eb06d326515a2f4d027af2d78974e235f8b538/68747470733a2f2f706f7365722e707567782e6f72672f72656e6f6b692d636f2f6c61726176656c2d746865726d6974652f646f776e6c6f616473)](https://packagist.org/packages/renoki-co/laravel-thermite)[![Monthly Downloads](https://camo.githubusercontent.com/a51abf9f5ad17cb99db8091ffa0948cf457c0204d24ef30788f92f7baa0cb786/68747470733a2f2f706f7365722e707567782e6f72672f72656e6f6b692d636f2f6c61726176656c2d746865726d6974652f642f6d6f6e74686c79)](https://packagist.org/packages/renoki-co/laravel-thermite)[![License](https://camo.githubusercontent.com/7685828e04279ef7a93aef8475e802ca2d863670ac44752f533bca4449fed989/68747470733a2f2f706f7365722e707567782e6f72672f72656e6f6b692d636f2f6c61726176656c2d746865726d6974652f6c6963656e7365)](https://packagist.org/packages/renoki-co/laravel-thermite)

Laravel Thermite is an extended PostgreSQL Laravel database driver to connect to a CockroachDB cluster.

🤝 Supporting
------------

[](#-supporting)

**If you are using one or more Renoki Co. open-source packages in your production apps, in presentation demos, hobby projects, school projects or so, sponsor our work with [Github Sponsors](https://github.com/sponsors/rennokki). 📦**

[![](https://camo.githubusercontent.com/4d0f1de42b07dd590b8fba021cb503a673bf1be66fe8169c41f3a00d3b72b37f/68747470733a2f2f6769746875622d636f6e74656e742e73332e66722d7061722e7363772e636c6f75642f7374617469632f32372e6a7067)](https://github-content.renoki.org/github-repo/27)

🚀 Installation
--------------

[](#-installation)

You can install the package via composer:

```
composer require renoki-co/laravel-thermite
```

🙌 Usage
-------

[](#-usage)

The driver is based on Postgres, most of the features from Laravel's first-party Postgres driver are available in CockroachDB.

```
// config/database.php

return [
    // ...

    'connections' => [
        // ...

        'cockroachdb' => [
            'driver' => 'cockroachdb',
            'url' => env('DATABASE_URL'),
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '26257'),
            'database' => env('DB_DATABASE', 'defaultdb'),
            'username' => env('DB_USERNAME', 'root'),
            'password' => env('DB_PASSWORD', ''),
            'charset' => 'utf8',
            'prefix' => '',
            'prefix_indexes' => true,
            'schema' => 'public',
            'sslmode' => 'prefer',
        ],

    ],
];
```

✨ Caveats
---------

[](#-caveats)

### Primary Keys are not incremental

[](#primary-keys-are-not-incremental)

Postgres supports incrementing keys, but since CockroachDB is based on a global multi-master architecture, having increments may lead to [transaction contention](https://www.cockroachlabs.com/docs/v21.1/sql-faqs#how-do-i-auto-generate-unique-row-ids-in-cockroachdb).

This way, this extended driver leverages you with two functions that you may call in your migrations to generate performant, unique IDs. The differences between the methods [can be found here](https://www.cockroachlabs.com/docs/v21.1/sql-faqs#what-are-the-differences-between-uuid-sequences-and-unique_rowid).

The `->id()` method got replaced to generate a random UUID as primary key with `gen_random_uuid()` instead of an incremental primary key. The downside is that is not orderable, opposed to `uniqueRowId()`:

```
use RenokiCo\LaravelThermite\Database\Blueprint;

Schema::create('users', function (Blueprint $table) {
    $table->id();
    $table->string('name');
});

class User extends Model
{
    // Make sure to set key type as string.
    protected $keyType = 'string';
}
```

With `uniqueRowId()`, it uses `unique_rowid()`-generated primary key. This is highly-orderable, being sequentially generated. The only minor downsides are the throttling upon insert, which are limited by one node.

```
use RenokiCo\LaravelThermite\Database\Blueprint;

Schema::create('users', function (Blueprint $table) {
    $table->uniqueRowId();
    $table->string('name');
});

class User extends Model
{
    // Do not set the $keyType to string, as it is an integer.
}
```

### Foreign keys associated with Primary Keys

[](#foreign-keys-associated-with-primary-keys)

To represent the primary key constraints in other tables, like passing relational fields, consider using `->uuid()`:

```
Schema::create('users', function (Blueprint $table) {
    $table->id();
    $table->string('name');
});

Schema::create('books', function (Blueprint $table) {
    $table->id();
    $table->uuid('user_id')->index();
    $table->string('name');
});

$book = $user->books()->create(['name' => 'The Great Gatsby']);
```

Other caveats
-------------

[](#other-caveats)

Being based on Postgres, CockroachDB borrowed functionalities from its code. Consider [reading about CockroachDB-Postgres compatibilities](https://www.cockroachlabs.com/docs/v21.1/sql-feature-support.html) when it comes to schema capabilities and counter-patterns that may affect your implementation and [see further caveats that are CockroachDB-only](https://www.cockroachlabs.com/docs/v21.1/postgresql-compatibility.html).

🐛 Testing
---------

[](#-testing)

```
vendor/bin/phpunit
```

🤝 Contributing
--------------

[](#-contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

🔒 Security
----------

[](#--security)

If you discover any security related issues, please email  instead of using the issue tracker.

🎉 Credits
---------

[](#-credits)

- [Alex Renoki](https://github.com/rennokki)
- [All Contributors](../../contributors)

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance54

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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 ~188 days

Total

2

Last Release

1553d ago

Major Versions

0.1.0 → 1.0.02022-02-09

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/21983456?v=4)[rennokki](/maintainers/rennokki)[@rennokki](https://github.com/rennokki)

---

Top Contributors

[![rennokki](https://avatars.githubusercontent.com/u/21983456?v=4)](https://github.com/rennokki "rennokki (46 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (18 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (5 commits)")

---

Tags

activecockroachcockroachdbdatabaselaravelpgsqlpostgrespostgresqlpsqlreplicaphplaravelclouddatabaseormpostgrespgsqldbspannerpsqlcockroachdbcockroach

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/renoki-co-laravel-thermite/health.svg)

```
[![Health](https://phpackages.com/badges/renoki-co-laravel-thermite/health.svg)](https://phpackages.com/packages/renoki-co-laravel-thermite)
```

###  Alternatives

[aura/sqlquery

Object-oriented query builders for MySQL, Postgres, SQLite, and SQLServer; can be used with any database connection library.

4572.9M34](/packages/aura-sqlquery)[spiritix/lada-cache

A Redis based, automated and scalable database caching layer for Laravel

591444.8k2](/packages/spiritix-lada-cache)[aura/sqlschema

Provides facilities to read table names and table columns from a database using PDO.

41234.1k4](/packages/aura-sqlschema)[orptech/laravel-migration-partition

Laravel extensions that extends Illuminate to enable partitioned table creation within Laravel migrations.

3426.7k](/packages/orptech-laravel-migration-partition)[webparking/laravel-db-rebuild

A laravel package that allows for quick database rebuilds with presets.

448.8k](/packages/webparking-laravel-db-rebuild)[tomatophp/filament-translations

Manage your translation with DB and cache, you can scan your languages tags like trans(), \_\_(), and get the string inside and translate them use UI.

6230.1k3](/packages/tomatophp-filament-translations)

PHPackages © 2026

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