SQLiteBackend
in package
implements
IDbBackend
Information about the SQLite 3 database layer.
Table of Contents
Interfaces
- IDbBackend
- Information about a database layer. Should not have any external dependencies.
Methods
- createConnection() : SQLiteConnection
- Creates a new SQLite client.
- getVersion() : Version
- Gets the version of the underlying library.
- isAvailable() : bool
- Checks whether the driver is available and a connection can be made.
- parseDsn() : SQLiteConnectionInfo
- Constructs a connection info instance from a dsn.
Methods
createConnection()
Creates a new SQLite client.
public
createConnection(SQLiteConnectionInfo $connectionInfo) : SQLiteConnection
Parameters
- $connectionInfo : SQLiteConnectionInfo
-
Object that describes the desired connection.
Return values
SQLiteConnection —A client for an SQLite database.
getVersion()
Gets the version of the underlying library.
public
getVersion() : Version
Return values
Version —Version of the library.
isAvailable()
Checks whether the driver is available and a connection can be made.
public
isAvailable() : bool
Return values
bool —If true a connection can be made, if false a required extension is missing.
parseDsn()
Constructs a connection info instance from a dsn.
public
parseDsn(string|array<string|int, mixed> $dsn) : SQLiteConnectionInfo
SQLite DSNs have no username, password, host or port parts.
The path can be set to any location on the filesystem to specify what file to use, or the special :memory:
value to use an in-memory database.
Supported query parameters are:
-
key=<string>
to specify an encryption key. -
readOnly
to open a database in read-only mode. -
openOnly
to prevent a new file from being created if the specified path does not exist.
Parameters
- $dsn : string|array<string|int, mixed>
-
DSN with connection information.
Return values
SQLiteConnectionInfo —SQLite connection info.