mpyw/unique-violation-detector
最新稳定版本:v1.2.0
Composer 安装命令:
composer require mpyw/unique-violation-detector
包简介
Detect primary/unique key or constraint violation errors from PDOException.
README 文档
README
Detect primary/unique key or constraint violation errors from PDOException.
Installing
composer require mpyw/unique-violation-detector
Requirements
| Package | Version |
|---|---|
| PHP | ^8.2 |
Note
Older versions have outdated dependency requirements. If you cannot prepare the latest environment, please refer to past releases.
Supported PDO Drivers
| Database | Driver | Auto-Discoverable |
|---|---|---|
| MySQL | pdo_mysql |
✅ |
| PostgreSQL | pdo_pgsql |
✅ |
| SQLite | pdo_sqlite |
✅ |
| SQLServer | pdo_sqlsrv |
✅ |
| SQLServer | pdo_odbc |
|
| SQLServer | pdo_dblib |
|
| Oracle | pdo_oci |
✅ |
Usage
use Mpyw\UniqueViolationDetector\MySQLDetector; // Explicitly instantiate a detector $violated = (new MySQLDetector())->uniqueConstraintViolated($exception);
use Mpyw\UniqueViolationDetector\DetectorDiscoverer; // Discover a detector from a PDO instance // (Not available for pdo_odbc and pdo_dblib) $violated = (new DetectorDiscoverer()) ->discover($pdo) ->uniqueConstraintViolated($exception);
统计信息
- 总下载量: 62.92k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-11-26