Download the PHP package renoki-co/laravel-thermite without Composer
On this page you can find all versions of the php package renoki-co/laravel-thermite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download renoki-co/laravel-thermite
More information about renoki-co/laravel-thermite
Files in renoki-co/laravel-thermite
Package laravel-thermite
Short Description Laravel Thermite is an extended PostgreSQL Laravel database driver to connect to a CockroachDB cluster.
License Apache-2.0
Homepage https://github.com/renoki-co/laravel-thermite
Informations about the package laravel-thermite
Laravel Thermite
Laravel Thermite is an extended PostgreSQL Laravel database driver to connect to a CockroachDB cluster.
🤝 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. 📦
🚀 Installation
You can install the package via composer:
🙌 Usage
The driver is based on Postgres, most of the features from Laravel's first-party Postgres driver are available in CockroachDB.
✨ Caveats
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.
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.
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()
:
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.
Foreign keys associated with Primary Keys
To represent the primary key constraints in other tables, like passing relational fields, consider using ->uuid()
:
Other caveats
Being based on Postgres, CockroachDB borrowed functionalities from its code. Consider reading about CockroachDB-Postgres compatibilities when it comes to schema capabilities and counter-patterns that may affect your implementation and see further caveats that are CockroachDB-only.
🐛 Testing
🤝 Contributing
Please see CONTRIBUTING for details.
🔒 Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
🎉 Credits
- Alex Renoki
- All Contributors