catch (\PDOException
$e) { if ($e->
getCode() ==
static::DATABASE_NOT_FOUND
) { throw new DatabaseNotFoundException($e->
getMessage(),
$e->
getCode(),
$e);
} // SQLite doesn't have a distinct error code for access denied, so don't
// deal with that case.
throw $e;
} // Create functions needed by SQLite.
$pdo->
sqliteCreateFunction('if',
[__CLASS__, 'sqlFunctionIf'
]);
$pdo->
sqliteCreateFunction('greatest',
[__CLASS__, 'sqlFunctionGreatest'
]);
$pdo->
sqliteCreateFunction('least',
[__CLASS__, 'sqlFunctionLeast'
]);
$pdo->
sqliteCreateFunction('pow', 'pow', 2
);
$pdo->
sqliteCreateFunction('exp', 'exp', 1
);
$pdo->
sqliteCreateFunction('length', 'strlen', 1
);
$pdo->
sqliteCreateFunction('md5', 'md5', 1
);
$pdo->
sqliteCreateFunction('concat',
[__CLASS__, 'sqlFunctionConcat'
]);
$pdo->
sqliteCreateFunction('concat_ws',
[__CLASS__, 'sqlFunctionConcatWs'
]);
$pdo->
sqliteCreateFunction('substring',
[__CLASS__, 'sqlFunctionSubstring'
], 3
);
$pdo->
sqliteCreateFunction('substring_index',
[__CLASS__, 'sqlFunctionSubstringIndex'
], 3
);
$pdo->
sqliteCreateFunction('rand',
[__CLASS__, 'sqlFunctionRand'
]);