Update license information
[keruald.git] / database / README.md
blob23b2692d4825d526747e825adde72b2f463e229a
1 # keruald/database
3 This library offers a simple layer of abstraction for database operations.
5 ## Configuration
7 To get a database instance, you need to pass configuration as an array.
8 The properties and values depend on the engine you want to use.
10 ### MySQLi
12 |    Key   | Value                                |          |
13 |----------|--------------------------------------|:--------:|
14 | engine   | MySQLiEngine class reference         |          |
15 | host     | The MySQL hostname, e.g. "localhost" |          |
16 | username | The MySQL user to use for connection |          |
17 | password | The clear text password to use       |          |
18 | database | The default db to select for queries | optional |
20 For example:
22 ```php
24     'engine' => Keruald\Database\Engines\MySQLiEngine::class,
25     'host' => 'localhost',
26     'username' => 'app',
27     'password' => 'someSecret',
28     'database' => 'app',          // optional
30 ```
32 ## Legacy drivers
34 The mysql extension has been deprecated in PHP 5.7 and removed in PHP 7.
35 As such, this extension isn't supported anymore. You can use straightforwardly
36 replace 'MySQL' by 'MySQLi' as engine.