ap-lib / mysql-instance
Installs: 12
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/ap-lib/mysql-instance
Requires
- php: ^8.3
- ap-lib/mysql: dev-main
- ap-lib/scheme: dev-main
- ap-lib/to-object: dev-main
This package is auto-updated.
Last update: 2025-09-14 22:16:33 UTC
README
A lightweight MySQL connection instancer with a simple and efficient API.
Installation
composer require ap-lib/mysql-instancer
Features
- Singleton-based MySQL connection management
- Easy configuration handling
- Automatic connection instantiation
- Scheme bases settings object, can be used for conf module
Requirements
- PHP 8.3 or higher
- MySQL database
Getting Started
Define a MySQL Instance
class DbName { use MysqlInstance; static protected function conf(): Mysql { return Core::conf()->db_name(); } }
Usage
$connection = DbName::get() ->select("users") ->fetchAll();
This retrieves a singleton instance of the Connect
object with the predefined configuration.
License
This project is licensed under the MIT License.