@@ -16,33 +16,16 @@ class PeachySql
1616{
1717 public Options $ options ;
1818 private PDO $ conn ;
19- private bool $ usedPrepare ;
19+ private bool $ usedPrepare = true ;
2020
2121 public function __construct (PDO $ connection , ?Options $ options = null )
2222 {
2323 $ this ->conn = $ connection ;
24- $ this ->usedPrepare = true ;
2524
2625 if ($ options === null ) {
26+ /** @var string $driver */
2727 $ driver = $ connection ->getAttribute (PDO ::ATTR_DRIVER_NAME );
28- $ options = new Options ();
29-
30- if ($ driver === 'sqlsrv ' ) {
31- // https://learn.microsoft.com/en-us/sql/sql-server/maximum-capacity-specifications-for-sql-server
32- $ options ->maxBoundParams = 2100 - 1 ;
33- $ options ->maxInsertRows = 1000 ;
34- $ options ->affectedIsRowCount = false ;
35- $ options ->fetchNextSyntax = true ;
36- $ options ->sqlsrvBinaryEncoding = true ;
37- $ options ->multiRowset = true ;
38- } elseif ($ driver === 'mysql ' ) {
39- $ options ->lastIdIsFirstOfBatch = true ;
40- $ options ->identifierQuote = '` ' ; // needed since not everyone uses ANSI mode
41- } elseif ($ driver === 'pgsql ' ) {
42- $ options ->binarySelectedAsStream = true ;
43- $ options ->nativeBoolColumns = true ;
44- $ options ->floatSelectedAsString = true ;
45- }
28+ $ options = new Options ($ driver );
4629 }
4730
4831 $ this ->options = $ options ;
0 commit comments