Documentation

Sqlite extends AbstractAdapter
in package

SQLite database adapter class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2023 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
5.3.0

Table of Contents

$connection  : mixed
Database connection object/resource
$error  : mixed
Error string/object/resource
$flags  : int
SQLite flags
$key  : string
SQLite key
$lastResult  : resource
Last result
$lastSql  : string
Last SQL query
$listener  : CallableObject
Query listener object/resource
$options  : mixed
Database connection options
$profiler  : Profiler
Query profiler
$result  : mixed
Result object/resource
$statement  : mixed
Statement object/resource
__construct()  : mixed
Constructor
beginTransaction()  : Sqlite
Begin a transaction
bindParam()  : Sqlite
Bind a parameter for a prepared SQL query
bindParams()  : Sqlite
Bind parameters to a prepared SQL query
bindValue()  : Sqlite
Bind a value for a prepared SQL query
clearError()  : AbstractAdapter
Clear the error
clearProfiler()  : AbstractAdapter
Clear query profiler
commit()  : Sqlite
Commit a transaction
connect()  : Sqlite
Connect to the database
createSchema()  : Schema
Create Schema builder
createSql()  : Sql
Create SQL builder
dbFileExists()  : bool
Does the database file exist
disconnect()  : void
Disconnect from the database
escape()  : string
Escape the value
execute()  : Sqlite
Execute a prepared SQL query
fetch()  : array<string|int, mixed>
Fetch and return a row from the result
fetchAll()  : array<string|int, mixed>
Fetch and return all rows from the result
getConnection()  : mixed
Get the connection object/resource
getError()  : mixed
Get the error
getLastId()  : int
Return the last ID of the last query
getListener()  : CallableObject
Get query listener
getNumberOfRows()  : int
Return the number of rows from the last query
getOptions()  : array<string|int, mixed>
Get database connection options
getProfiler()  : Profiler
Get query profiler
getResult()  : mixed
Get the result object/resource
getStatement()  : mixed
Get the statement object/resource
getTables()  : array<string|int, mixed>
Return the tables in the database
getVersion()  : string
Return the database version
hasError()  : bool
Determine whether or not there is an error
hasOptions()  : bool
Has database connection options
hasResult()  : bool
Determine whether or not a result resource exists
hasStatement()  : bool
Determine whether or not a statement resource exists
hasTable()  : bool
Return if the database has a table
isConnected()  : bool
Determine whether or not connected
listen()  : mixed
Add query listener to the adapter
prepare()  : Sqlite
Prepare a SQL query
query()  : Sqlite
Execute a SQL query directly
rollback()  : Sqlite
Rollback a transaction
setError()  : AbstractAdapter
Set the error
setOptions()  : Sqlite
Set database connection options
setProfiler()  : AbstractAdapter
Set query profiler
throwError()  : void
Throw a database error exception

Properties

$connection

Database connection object/resource

protected mixed $connection = null

$flags

SQLite flags

protected int $flags = null

$key

SQLite key

protected string $key = null

$lastResult

Last result

protected resource $lastResult

$lastSql

Last SQL query

protected string $lastSql = null

$statement

Statement object/resource

protected mixed $statement = null

Methods

__construct()

Constructor

public __construct([array<string|int, mixed> $options = [] ]) : mixed

Instantiate the SQLite database connection object using SQLite3

Parameters
$options : array<string|int, mixed> = []
Return values
mixed

beginTransaction()

Begin a transaction

public beginTransaction() : Sqlite
Return values
Sqlite

bindParam()

Bind a parameter for a prepared SQL query

public bindParam(mixed $param, mixed $value[, int $type = SQLITE3_BLOB ]) : Sqlite
Parameters
$param : mixed
$value : mixed
$type : int = SQLITE3_BLOB
Return values
Sqlite

bindParams()

Bind parameters to a prepared SQL query

public bindParams(array<string|int, mixed> $params) : Sqlite
Parameters
$params : array<string|int, mixed>
Return values
Sqlite

bindValue()

Bind a value for a prepared SQL query

public bindValue(mixed $param, mixed $value[, int $type = SQLITE3_BLOB ]) : Sqlite
Parameters
$param : mixed
$value : mixed
$type : int = SQLITE3_BLOB
Return values
Sqlite

connect()

Connect to the database

public connect([array<string|int, mixed> $options = [] ]) : Sqlite
Parameters
$options : array<string|int, mixed> = []
Return values
Sqlite

dbFileExists()

Does the database file exist

public dbFileExists() : bool
Return values
bool

disconnect()

Disconnect from the database

public disconnect() : void
Return values
void

escape()

Escape the value

public escape(string $value) : string
Parameters
$value : string
Return values
string

fetch()

Fetch and return a row from the result

public fetch() : array<string|int, mixed>
Return values
array<string|int, mixed>

fetchAll()

Fetch and return all rows from the result

public fetchAll() : array<string|int, mixed>
Return values
array<string|int, mixed>

getConnection()

Get the connection object/resource

public getConnection() : mixed
Return values
mixed

getError()

Get the error

public getError() : mixed
Return values
mixed

getLastId()

Return the last ID of the last query

public getLastId() : int
Return values
int

getNumberOfRows()

Return the number of rows from the last query

public getNumberOfRows() : int
Return values
int

getOptions()

Get database connection options

public getOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>

getResult()

Get the result object/resource

public getResult() : mixed
Return values
mixed

getStatement()

Get the statement object/resource

public getStatement() : mixed
Return values
mixed

getTables()

Return the tables in the database

public getTables() : array<string|int, mixed>
Return values
array<string|int, mixed>

getVersion()

Return the database version

public getVersion() : string
Return values
string

hasError()

Determine whether or not there is an error

public hasError() : bool
Return values
bool

hasOptions()

Has database connection options

public hasOptions() : bool
Return values
bool

hasResult()

Determine whether or not a result resource exists

public hasResult() : bool
Return values
bool

hasStatement()

Determine whether or not a statement resource exists

public hasStatement() : bool
Return values
bool

hasTable()

Return if the database has a table

public hasTable(string $table) : bool
Parameters
$table : string
Return values
bool

isConnected()

Determine whether or not connected

public isConnected() : bool
Return values
bool

listen()

Add query listener to the adapter

public listen(mixed $listener[, mixed $params = null ][, Profiler $profiler = null ]) : mixed
Parameters
$listener : mixed
$params : mixed = null
$profiler : Profiler = null
Return values
mixed

prepare()

Prepare a SQL query

public prepare(mixed $sql) : Sqlite
Parameters
$sql : mixed
Return values
Sqlite

query()

Execute a SQL query directly

public query(mixed $sql) : Sqlite
Parameters
$sql : mixed
Return values
Sqlite

setOptions()

Set database connection options

public setOptions(array<string|int, mixed> $options) : Sqlite
Parameters
$options : array<string|int, mixed>
Return values
Sqlite

throwError()

Throw a database error exception

public throwError([string $error = null ]) : void
Parameters
$error : string = null
Tags
throws
Exception
Return values
void

Search results