stefano / stefano-lock-table
构建锁表 SQL 查询
0.1.1
2022-09-30 18:39 UTC
Requires
- php: >=7.1.0
Requires (Dev)
- mockery/mockery: ^1.0.0
- php-coveralls/php-coveralls: ^2.0
- phpunit/phpunit: >=7 <10
This package is auto-updated.
Last update: 2024-08-29 04:42:43 UTC
README
使用 Composer 安装
- 运行命令
composer require stefano/stefano-lock-table
功能
- 构建锁表 SQL 字符串
- 构建解锁表 SQL 字符串
- 支持的数据库供应商:mysql, postgresql
使用方法
$factory = new \StefanoLockTable\Factory();
$vendor = 'Mysql'; //or any supported database
$adapter = $factory->createAdapter($vendor);
//build lock table sql string (exclusive lock)
$adapter->getLockSqlString('tableName');
$adapter->getLockSqlString(array('tableName', 'anotherTable'));
//build unlock table sql string
$adapter->getUnlockSqlString();