| | |
| | | */ |
| | | class rcube_db_sqlite extends rcube_db |
| | | { |
| | | |
| | | /** |
| | | * Database character set |
| | | */ |
| | | protected function set_charset($charset) |
| | | { |
| | | } |
| | | |
| | | /** |
| | | * Prepare connection |
| | | */ |
| | | protected function conn_prepare($dsn) |
| | | { |
| | | // Create database file, required by PDO to exist on connection |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Configure connection, create database if not exists |
| | | */ |
| | | protected function conn_configure($dsn, $dbh) |
| | | { |
| | | // we emulate via callback some missing functions |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Callback for sqlite: unix_timestamp() |
| | | */ |
| | |
| | | return $ret; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Callback for sqlite: now() |
| | | */ |
| | |
| | | { |
| | | return date("Y-m-d H:i:s"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Returns list of tables in database |
| | |
| | | |
| | | return $this->tables; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Returns list of columns in database table |
| | |
| | | return $columns; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Build DSN string for PDO constructor |
| | | */ |
| | | protected function dsn_string($dsn) |
| | | { |
| | | return $dsn['phptype'] . ':' . $dsn['database']; |