New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

colopl/laravel-tidb

Laravel database driver for PingCAP TiDB
9,159 26

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 care

Use 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
Maintainer: COLOPL, Inc.

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) to ColumnDefinition
  • When user defines $table->id() in the migration file, it will add PRIMARY KEY AUTO_RANDOM to the schema instead of PRIMARY KEY AUTO_INCREMENT so 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

  1. Nesting transactions and then rolling them back will always rollback to the first transaction since SAVEPOINT is not supported by TiDB. In other words, rolling back with $connection->rollBack() will always rollback level to 0.
  2. 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

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

670,032,257 9,703
laravel/framework

The Laravel Framework.

640,572,096 35,338
laravel/tinker

Powerful REPL for the Laravel framework.

546,909,908 7,440
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

465,816,364 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

431,187,642 4,660

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|~11 Apache-2.0
v3.0.1 >=8 ~8|~9|~10 Apache-2.0
v3.0.0 >=8 ~8|~9|~10 Apache-2.0