class SQLiteConnection extends Connection (View source)

Traits

Methods

void
__construct( PDO $pdo, string $database = '', string $tablePrefix = '', array $config = array())

Create a new database connection instance.

void
useDefaultQueryGrammar()

Set the query grammar to the default implementation.

void
useDefaultSchemaGrammar()

Set the schema grammar to the default implementation.

void
useDefaultPostProcessor()

Set the query post processor to the default implementation.

getSchemaBuilder()

Get a schema builder instance for the connection.

table( string $table)

Begin a fluent query against a database table.

query()

Get a new query builder instance.

raw( mixed $value)

Get a new raw query expression.

mixed
selectOne( string $query, array $bindings = array())

Run a select statement and return a single result.

array
selectFromWriteConnection( string $query, array $bindings = array())

Run a select statement against the database.

array
select( string $query, array $bindings = array(), bool $useReadPdo = true)

Run a select statement against the database.

bool
insert( string $query, array $bindings = array())

Run an insert statement against the database.

int
update( string $query, array $bindings = array())

Run an update statement against the database.

int
delete( string $query, array $bindings = array())

Run a delete statement against the database.

bool
statement( string $query, array $bindings = array())

Execute an SQL statement and return the boolean result.

int
affectingStatement( string $query, array $bindings = array())

Run an SQL statement and get the number of rows affected.

bool
unprepared( string $query)

Run a raw, unprepared query against the PDO connection.

array
prepareBindings( array $bindings)

Prepare the query bindings for execution.

mixed
transaction( Closure $callback)

Execute a Closure within a transaction.

void
beginTransaction()

Start a new database transaction.

void
commit()

Commit the active database transaction.

void
rollBack()

Rollback the active database transaction.

int
transactionLevel()

Get the number of active transactions.

array
pretend( Closure $callback)

Execute the given callback in "dry run" mode.

void
disconnect()

Disconnect from the underlying PDO connection.

void
reconnect()

Reconnect to the database.

void
logQuery( string $query, array $bindings, float|null $time = null)

Log a query in the connection's query log.

void
listen( Closure $callback)

Register a database query listener with the connection.

bool
isDoctrineAvailable()

Is Doctrine available?

Column
getDoctrineColumn( string $table, string $column)

Get a Doctrine Schema Column instance.

AbstractSchemaManager
getDoctrineSchemaManager()

Get the Doctrine DBAL schema manager for the connection.

Connection
getDoctrineConnection()

Get the Doctrine DBAL database connection instance.

PDO
getPdo()

Get the current PDO connection.

PDO
getReadPdo()

Get the current PDO connection used for reading.

$this
setPdo( PDO|null $pdo)

Set the PDO connection.

$this
setReadPdo( PDO|null $pdo)

Set the PDO connection used for reading.

$this
setReconnector( callable $reconnector)

Set the reconnect instance on the connection.

string|null
getName()

Get the database connection name.

mixed
getConfig( string $option)

Get an option from the configuration options.

string
getDriverName()

Get the PDO driver name.

getQueryGrammar()

Get the query grammar used by the connection.

void
setQueryGrammar( Grammar $grammar)

Set the query grammar used by the connection.

getSchemaGrammar()

Get the schema grammar used by the connection.

void
setSchemaGrammar( Grammar $grammar)

Set the schema grammar used by the connection.

getPostProcessor()

Get the query post processor used by the connection.

void
setPostProcessor( Processor $processor)

Set the query post processor used by the connection.

getEventDispatcher()

Get the event dispatcher used by the connection.

void
setEventDispatcher( Dispatcher $events)

Set the event dispatcher instance on the connection.

bool
pretending()

Determine if the connection in a "dry run".

int
getFetchMode()

Get the default fetch mode for the connection.

int
setFetchMode( int $fetchMode)

Set the default fetch mode for the connection.

array
getQueryLog()

Get the connection query log.

void
flushQueryLog()

Clear the query log.

void
enableQueryLog()

Enable the query log on the connection.

void
disableQueryLog()

Disable the query log on the connection.

bool
logging()

Determine whether we're logging queries.

string
getDatabaseName()

Get the name of the connected database.

string
setDatabaseName( string $database)

Set the name of the connected database.

string
getTablePrefix()

Get the table prefix for the connection.

void
setTablePrefix( string $prefix)

Set the table prefix in use by the connection.

withTablePrefix( Grammar $grammar)

Set the table prefix and return the grammar.

Details

in Connection at line line 146
void __construct( PDO $pdo, string $database = '', string $tablePrefix = '', array $config = array())

Create a new database connection instance.

Parameters

PDO $pdo
string $database
string $tablePrefix
array $config

Return Value

void

in Connection at line line 172
void useDefaultQueryGrammar()

Set the query grammar to the default implementation.

Return Value

void

in Connection at line line 192
void useDefaultSchemaGrammar()

Set the schema grammar to the default implementation.

Return Value

void

in Connection at line line 212
void useDefaultPostProcessor()

Set the query post processor to the default implementation.

Return Value

void

in Connection at line line 232
Builder getSchemaBuilder()

Get a schema builder instance for the connection.

Return Value

Builder

in Connection at line line 247
Builder table( string $table)

Begin a fluent query against a database table.

Parameters

string $table

Return Value

Builder

in Connection at line line 257
Builder query()

Get a new query builder instance.

Return Value

Builder

in Connection at line line 270
Expression raw( mixed $value)

Get a new raw query expression.

Parameters

mixed $value

Return Value

Expression

in Connection at line line 282
mixed selectOne( string $query, array $bindings = array())

Run a select statement and return a single result.

Parameters

string $query
array $bindings

Return Value

mixed

in Connection at line line 296
array selectFromWriteConnection( string $query, array $bindings = array())

Run a select statement against the database.

Parameters

string $query
array $bindings

Return Value

array

in Connection at line line 309
array select( string $query, array $bindings = array(), bool $useReadPdo = true)

Run a select statement against the database.

Parameters

string $query
array $bindings
bool $useReadPdo

Return Value

array

in Connection at line line 345
bool insert( string $query, array $bindings = array())

Run an insert statement against the database.

Parameters

string $query
array $bindings

Return Value

bool

in Connection at line line 357
int update( string $query, array $bindings = array())

Run an update statement against the database.

Parameters

string $query
array $bindings

Return Value

int

in Connection at line line 369
int delete( string $query, array $bindings = array())

Run a delete statement against the database.

Parameters

string $query
array $bindings

Return Value

int

in Connection at line line 381
bool statement( string $query, array $bindings = array())

Execute an SQL statement and return the boolean result.

Parameters

string $query
array $bindings

Return Value

bool

in Connection at line line 401
int affectingStatement( string $query, array $bindings = array())

Run an SQL statement and get the number of rows affected.

Parameters

string $query
array $bindings

Return Value

int

in Connection at line line 425
bool unprepared( string $query)

Run a raw, unprepared query against the PDO connection.

Parameters

string $query

Return Value

bool

in Connection at line line 442
array prepareBindings( array $bindings)

Prepare the query bindings for execution.

Parameters

array $bindings

Return Value

array

in Connection at line line 468
mixed transaction( Closure $callback)

Execute a Closure within a transaction.

Parameters

Closure $callback

Return Value

mixed

Exceptions

Throwable

in Connection at line line 502
void beginTransaction()

Start a new database transaction.

Return Value

void

in Connection at line line 522
void commit()

Commit the active database transaction.

Return Value

void

in Connection at line line 538
void rollBack()

Rollback the active database transaction.

Return Value

void

in Connection at line line 558
int transactionLevel()

Get the number of active transactions.

Return Value

int

in Connection at line line 569
array pretend( Closure $callback)

Execute the given callback in "dry run" mode.

Parameters

Closure $callback

Return Value

array

in Connection at line line 690
void disconnect()

Disconnect from the underlying PDO connection.

Return Value

void

in Connection at line line 702
void reconnect()

Reconnect to the database.

Return Value

void

Exceptions

LogicException

in Connection at line line 731
void logQuery( string $query, array $bindings, float|null $time = null)

Log a query in the connection's query log.

Parameters

string $query
array $bindings
float|null $time

Return Value

void

in Connection at line line 750
void listen( Closure $callback)

Register a database query listener with the connection.

Parameters

Closure $callback

Return Value

void

in Connection at line line 786
bool isDoctrineAvailable()

Is Doctrine available?

Return Value

bool

in Connection at line line 798
Column getDoctrineColumn( string $table, string $column)

Get a Doctrine Schema Column instance.

Parameters

string $table
string $column

Return Value

Column

in Connection at line line 810
AbstractSchemaManager getDoctrineSchemaManager()

Get the Doctrine DBAL schema manager for the connection.

Return Value

AbstractSchemaManager

in Connection at line line 820
Connection getDoctrineConnection()

Get the Doctrine DBAL database connection instance.

Return Value

Connection

in Connection at line line 838
PDO getPdo()

Get the current PDO connection.

Return Value

PDO

in Connection at line line 848
PDO getReadPdo()

Get the current PDO connection used for reading.

Return Value

PDO

in Connection at line line 863
$this setPdo( PDO|null $pdo)

Set the PDO connection.

Parameters

PDO|null $pdo

Return Value

$this

in Connection at line line 880
$this setReadPdo( PDO|null $pdo)

Set the PDO connection used for reading.

Parameters

PDO|null $pdo

Return Value

$this

in Connection at line line 893
$this setReconnector( callable $reconnector)

Set the reconnect instance on the connection.

Parameters

callable $reconnector

Return Value

$this

in Connection at line line 905
string|null getName()

Get the database connection name.

Return Value

string|null

in Connection at line line 916
mixed getConfig( string $option)

Get an option from the configuration options.

Parameters

string $option

Return Value

mixed

in Connection at line line 926
string getDriverName()

Get the PDO driver name.

Return Value

string

in Connection at line line 936
Grammar getQueryGrammar()

Get the query grammar used by the connection.

Return Value

Grammar

in Connection at line line 947
void setQueryGrammar( Grammar $grammar)

Set the query grammar used by the connection.

Parameters

Grammar $grammar

Return Value

void

in Connection at line line 957
Grammar getSchemaGrammar()

Get the schema grammar used by the connection.

Return Value

Grammar

in Connection at line line 968
void setSchemaGrammar( Grammar $grammar)

Set the schema grammar used by the connection.

Parameters

Grammar $grammar

Return Value

void

in Connection at line line 978
Processor getPostProcessor()

Get the query post processor used by the connection.

Return Value

Processor

in Connection at line line 989
void setPostProcessor( Processor $processor)

Set the query post processor used by the connection.

Parameters

Processor $processor

Return Value

void

in Connection at line line 999
Dispatcher getEventDispatcher()

Get the event dispatcher used by the connection.

Return Value

Dispatcher

void setEventDispatcher( Dispatcher $events)

Set the event dispatcher instance on the connection.

Parameters

Dispatcher $events

Return Value

void

bool pretending()

Determine if the connection in a "dry run".

Return Value

bool

int getFetchMode()

Get the default fetch mode for the connection.

Return Value

int

int setFetchMode( int $fetchMode)

Set the default fetch mode for the connection.

Parameters

int $fetchMode

Return Value

int

array getQueryLog()

Get the connection query log.

Return Value

array

void flushQueryLog()

Clear the query log.

Return Value

void

void enableQueryLog()

Enable the query log on the connection.

Return Value

void

void disableQueryLog()

Disable the query log on the connection.

Return Value

void

bool logging()

Determine whether we're logging queries.

Return Value

bool

string getDatabaseName()

Get the name of the connected database.

Return Value

string

string setDatabaseName( string $database)

Set the name of the connected database.

Parameters

string $database

Return Value

string

string getTablePrefix()

Get the table prefix for the connection.

Return Value

string

void setTablePrefix( string $prefix)

Set the table prefix in use by the connection.

Parameters

string $prefix

Return Value

void

Grammar withTablePrefix( Grammar $grammar)

Set the table prefix and return the grammar.

Parameters

Grammar $grammar

Return Value

Grammar