File tree Expand file tree Collapse file tree 3 files changed +16
-17
lines changed Expand file tree Collapse file tree 3 files changed +16
-17
lines changed Original file line number Diff line number Diff line change 1
- .buildpath
2
- .project
3
- .settings
1
+ notes.md
4
2
coverage
5
3
vendor
6
4
composer.lock
Original file line number Diff line number Diff line change 1
- # Piko DbRecord
1
+ # Piko Db Record
2
2
3
3
[ ![ build] ( https://github.com/piko-framework/db-record/actions/workflows/php.yml/badge.svg )] ( https://github.com/piko-framework/db-record/actions/workflows/php.yml )
4
4
[ ![ Coverage Status] ( https://coveralls.io/repos/github/piko-framework/db-record/badge.svg?branch=main )] ( https://coveralls.io/github/piko-framework/db-record?branch=main )
5
5
6
6
Piko Db Record is a lightweight Active Record implementation built on top of PDO.
7
7
8
+ It has been tested and works with the following databases:
9
+
10
+ - SQLite
11
+ - MySQL
12
+ - PostgreSQL
13
+ - MSSQL
14
+
8
15
## Installation
9
16
10
- It's recommended that you use Composer to install Piko Db.
17
+ It's recommended that you use Composer to install Piko Db Record .
11
18
12
19
``` bash
13
20
composer require piko/db-record
Original file line number Diff line number Diff line change @@ -96,18 +96,12 @@ public function quoteIdentifier($identifier): string
96
96
{
97
97
$ driver = $ this ->db ->getAttribute (PDO ::ATTR_DRIVER_NAME );
98
98
99
- switch ($ driver ) {
100
- case 'mysql ' :
101
- case 'sqlite ' :
102
- return '` ' . $ identifier . '` ' ;
103
- case 'pgsql ' :
104
- return '" ' . $ identifier . '" ' ;
105
- case 'sqlsrv ' :
106
- case 'dblib ' :
107
- return '[ ' . $ identifier . '] ' ;
108
- default :
109
- return $ identifier ;
110
- }
99
+ return match ($ driver ) {
100
+ 'mysql ' , 'sqlite ' => '` ' . $ identifier . '` ' ,
101
+ 'pgsql ' => '" ' . $ identifier . '" ' ,
102
+ 'sqlsrv ' , 'dblib ' => '[ ' . $ identifier . '] ' ,
103
+ default => $ identifier ,
104
+ };
111
105
}
112
106
113
107
/**
You can’t perform that action at this time.
0 commit comments