Skip to content

Commit

Permalink
Add Driver SQLite3 (#18)
Browse files Browse the repository at this point in the history
* Add Driver SQLite3

* Preparation for later implementation of lastId

* Preparation for later implementation of lastId
  • Loading branch information
schengawegga committed Nov 4, 2023
1 parent c4a9ae0 commit d837b7b
Show file tree
Hide file tree
Showing 8 changed files with 988 additions and 2 deletions.
6 changes: 5 additions & 1 deletion DB.php
Expand Up @@ -765,7 +765,11 @@ public static function parseDSN($dsn)
if (is_array($dsn)) {
$dsn = array_merge($parsed, $dsn);
if (!$dsn['dbsyntax']) {
$dsn['dbsyntax'] = $dsn['phptype'];
if($dsn['phptype'] == "sqlite3") {
$dsn['dbsyntax'] = "sqlite";
} else {
$dsn['dbsyntax'] = $dsn['phptype'];
}
}
return $dsn;
}
Expand Down
7 changes: 7 additions & 0 deletions DB/common.php
Expand Up @@ -315,6 +315,7 @@ function quote($string = null)
* + odbc(db2)
* + pgsql
* + sqlite
* + sqlite3
* + sybase (must execute <kbd>set quoted_identifier on</kbd> sometime
* prior to use)
*
Expand Down Expand Up @@ -417,6 +418,10 @@ function quoteIdentifier($str)
* (<kbd>INTEGER</kbd>)
* </li>
* <li>
* <kbd>sqlite3</kbd> -> <samp>1/0</samp>
* (<kbd>INTEGER</kbd>)
* </li>
* <li>
* <kbd>sybase</kbd> -> <samp>1/0</samp>
* (<kbd>TINYINT(1)</kbd>)
* </li>
Expand Down Expand Up @@ -641,6 +646,7 @@ function setFetchMode($fetchmode, $object_class = 'stdClass')
* + mysql
* + mysqli
* + sqlite
* + sqlite3
*
*
* <samp>DB_PORTABILITY_NUMROWS</samp>
Expand Down Expand Up @@ -720,6 +726,7 @@ function setOption($option, $value)
case 'mysql':
case 'mysqli':
case 'sqlite':
case 'sqlite3':
$this->options['portability'] =
DB_PORTABILITY_DELETE_COUNT;
break;
Expand Down

0 comments on commit d837b7b

Please sign in to comment.