{"repo":"mpyw/laravel-database-advisory-lock","free":true,"listed":false,"github":"https://github.com/mpyw/laravel-database-advisory-lock","clone":"git clone https://github.com/mpyw/laravel-database-advisory-lock.git","description":"Advisory Locking Features for Postgres/MySQL/MariaDB on Laravel","language":"PHP","stars":28,"topics":["advisory-locks","databases","laravel","mutex","mysql","postgresql"],"license":"MIT","category":"databases-storage","readme_excerpt":"Laravel Database Advisory Lock Advisory Locking Features of Postgres/MySQL/MariaDB on Laravel Requirements Package Version Mandatory :-------- :-------------------------------------- :---------: PHP ^8.2 ✅ Laravel ^11.0 &#124;&#124; ^12.0 &#124;&#124; ^13.0 &#124;&#124; ^14.0 ✅ PHPStan &gt;=2.0 [!NOTE] Older versions have outdated dependency requirements. If you cannot prepare the latest environment, please refer to past releases. RDBMS Version :--------- :-------------------------- Postgres &gt;=9.1.14 MySQL &gt;=5.7.5 MariaDB &gt;=10.0.15 Installing Basic usage [!IMPORTANT] The default implementation is provided by ConnectionServiceProvider , however, package discovery is not available . Be careful that you MUST register it in config/app.php by yourself. Advanced Usage [!TIP] You can extend Connection classes with AdvisoryLocks trait by yourself. Implementation Details Key Hashing Algorithm - Postgres advisory locking functions only accept integer keys. So the driver converts key strings into 64-bit integers through hashtext() function. - An empty string can also be used as a key. - MySQL advisory locking function accepts string keys but their length are limited within 64 chars. When key strings exceed 64 chars limit, the driver takes first 24 chars from them and appends 40 chars sha1() hashes. - MariaDB's limit is actually 192 bytes, unlike MySQL's 64 chars. However, the key hashing algorithm is equivalent. - MariaDB accepts an empty string as a key, but does not actually ","default_branch":null,"files":null,"tree":[],"storefront":"/r/mpyw","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/mpyw/laravel-database-advisory-lock/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}