colopl/laravel-tidb
Larablocks Analysis
colopl/laravel-tidb works with Laravel 12 (latest release v5.0.0, May 2, 2025).
Laravel 6 to 11 in earlier releases.
Recommendation checks
Use with careUse with care: meets 0 of 4 checks.
- Latest release doesn't support Laravel 13, the current version
- No release in the last 12 months (last: May 2, 2025)
- 181 downloads a month (needs 10,000)
- 26 GitHub stars (needs 100)
State
Quiet- Last stable release: May 2, 2025.
- No releases in the last 12 months.
- First released: Mar 12, 2021.
- Monthly downloads: 181.
- 0 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Nov 28, 2026.
| Install | |
|---|---|
composer require colopl/laravel-tidb |
|
| Latest Version: | v5.0.0 |
| PHP: | >=8.2 |
| Laravel: | 12 |
| Older releases: | 6 – 11 |
| License: | Apache-2.0 |
| Last Updated: | May 2, 2025 |
| Links: | GitHub · Packagist |
laravel-tidb
Laravel database driver for TiDB
Requirements
- PHP >= 8.0
- Laravel 11
- TiDB >= 7.0
Installation
Install via composer
composer require colopl/laravel-tidb
That's all. You can use database connection as usual.
Features
- Added
autoRandom($shard_bits = null)toColumnDefinition - When user defines
$table->id()in the migration file, it will addPRIMARY KEY AUTO_RANDOMto the schema instead ofPRIMARY KEY AUTO_INCREMENTso that data gets distributed evenly. - Added Support for nested transactions (MySQL driver will throw an exception)
- Added Support for adding/dropping multiple columns (MySQL driver will throw an exception)
Unsupported features
- Nesting transactions and then rolling them back will always rollback to the first transaction since
SAVEPOINTis not supported by TiDB. In other words, rolling back with$connection->rollBack()will always rollback level to0. - Adding and dropping multiple columns atomically is not fully supported. Defining multiple columns in migrations is supported but will be executed one by one and will not be atomic. Ex:
$table->dropColumn('title', 'content')
For unsupported features for TiDB itself, please see MySQL Compatibility.
Testing
You can run tests on docker by the following command.
make test
License
Apache 2.0 - See LICENSE for more information.
Related Packages
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Laravel Serializable Closure provides an easy and secure way to serialize closur...
Cli error handling for console/command-line PHP applications.
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v5.0.0 | >=8.2 | ~12 | Apache-2.0 | |
| v4.0.0 | >=8 | ~11 | Apache-2.0 | |
| v3.1.0 | >=8 | ~10| | Apache-2.0 | |
| v3.0.1 | >=8 | ~8| | Apache-2.0 | |
| v3.0.0 | >=8 | ~8| | Apache-2.0 | |
| v2.1.0 | >=8 | ~8| | Apache-2.0 | |
| v2.0.0 | >=8 | ~8.0 | Apache-2.0 | |
| v1.2.0 | >=7.4 | ~6.0| | Apache-2.0 | |
| v1.1.0 | >=7.4 | ~6.0| | Apache-2.0 | |
| v1.0.0 | >=7.4 | ~6.0| | Apache-2.0 |