elektro-potkan / neplus-database
NePlus Database - Custom modifications on top of Nette Database
v0.2.0
2021-10-06 23:11 UTC
Requires
- php: >= 7.2
- nette/database: ^3.0.1
Requires (Dev)
- nette/di: ^3.0.0
- phpstan/phpstan: ^0.12
- phpstan/phpstan-deprecation-rules: ^0.12
- phpstan/phpstan-nette: ^0.12
- phpstan/phpstan-strict-rules: ^0.12
This package is auto-updated.
Last update: 2025-03-07 04:40:14 UTC
README
Custom modifications on top of Nette Database.
Usage
// constructor is the same as of Nette\Database\Connection
$db = ElektroPotkan\NePlus\Database\ConnectionMySQL(
'mysql:host=localhost;dbname=mydb',
'user',
'password'
);
// query LOCK TABLES `myTable1` READ, `myTable2` WRITE
$db->lockTables([
'myTable1' => false,
'myTable2' => true,
]);
// query UNLOCK TABLES
$db->unlockTables();
Nette DI
To switch all database connections registered in DI Container
from Nette\Database\Connection
to ElektroPotkan\NePlus\Database\ConnectionMySQL
,
just use the bundled DI extension:
extensions:
- ElektroPotkan\NePlus\Bridges\Database\DI\DatabaseExtension
Author
Elektro-potkan git@elektro-potkan.cz
Info
Versioning
This project uses Semantic Versioning 2.0.0 (semver.org).
Branching
This project uses slightly modified Git-Flow Workflow and Branching Model:
- https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow
- https://nvie.com/posts/a-successful-git-branching-model/
License
You may use this program under the terms of either the BSD Zero Clause License or the GNU General Public License (GPL) version 3 or later.
See file LICENSE.