SQLiteConnection (Database)
SQLiteConnection
class SQLiteConnection extends Connection (View source)
Traits
DetectsLostConnections |
Methods
void | __construct(PDO $pdo, string $database = '', string $tablePrefix = '', array $config = array()) Create a new database connection instance. | from Connection |
void | useDefaultQueryGrammar() Set the query grammar to the default implementation. | from Connection |
void | useDefaultSchemaGrammar() Set the schema grammar to the default implementation. | from Connection |
void | useDefaultPostProcessor() Set the query post processor to the default implementation. | from Connection |
Builder | getSchemaBuilder() Get a schema builder instance for the connection. | from Connection |
Builder | table(string $table) Begin a fluent query against a database table. | from Connection |
Builder | query() Get a new query builder instance. | from Connection |
Expression | raw(mixed $value) Get a new raw query expression. | from Connection |
mixed | selectOne(string $query, array $bindings = array()) Run a select statement and return a single result. | from Connection |
array | selectFromWriteConnection(string $query, array $bindings = array()) Run a select statement against the database. | from Connection |
array | select(string $query, array $bindings = array(), bool $useReadPdo = true) Run a select statement against the database. | from Connection |
bool | insert(string $query, array $bindings = array()) Run an insert statement against the database. | from Connection |
int | update(string $query, array $bindings = array()) Run an update statement against the database. | from Connection |
int | delete(string $query, array $bindings = array()) Run a delete statement against the database. | from Connection |
bool | statement(string $query, array $bindings = array()) Execute an SQL statement and return the boolean result. | from Connection |
int | affectingStatement(string $query, array $bindings = array()) Run an SQL statement and get the number of rows affected. | from Connection |
bool | unprepared(string $query) Run a raw, unprepared query against the PDO connection. | from Connection |
array | prepareBindings(array $bindings) Prepare the query bindings for execution. | from Connection |
mixed | transaction(Closure $callback) Execute a Closure within a transaction. | from Connection |
void | beginTransaction() Start a new database transaction. | from Connection |
void | commit() Commit the active database transaction. | from Connection |
void | rollBack() Rollback the active database transaction. | from Connection |
int | transactionLevel() Get the number of active transactions. | from Connection |
array | pretend(Closure $callback) Execute the given callback in "dry run" mode. | from Connection |
void | disconnect() Disconnect from the underlying PDO connection. | from Connection |
void | reconnect() Reconnect to the database. | from Connection |
void | logQuery(string $query, array $bindings, float|null $time = null) Log a query in the connection's query log. | from Connection |
void | listen(Closure $callback) Register a database query listener with the connection. | from Connection |
bool | isDoctrineAvailable() Is Doctrine available? | from Connection |
Column | getDoctrineColumn(string $table, string $column) Get a Doctrine Schema Column instance. | from Connection |
AbstractSchemaManager | getDoctrineSchemaManager() Get the Doctrine DBAL schema manager for the connection. | from Connection |
Connection | getDoctrineConnection() Get the Doctrine DBAL database connection instance. | from Connection |
PDO | getPdo() Get the current PDO connection. | from Connection |
PDO | getReadPdo() Get the current PDO connection used for reading. | from Connection |
$this | setPdo(PDO|null $pdo) Set the PDO connection. | from Connection |
$this | setReadPdo(PDO|null $pdo) Set the PDO connection used for reading. | from Connection |
$this | setReconnector(callable $reconnector) Set the reconnect instance on the connection. | from Connection |
string|null | getName() Get the database connection name. | from Connection |
mixed | getConfig(string $option) Get an option from the configuration options. | from Connection |
string | getDriverName() Get the PDO driver name. | from Connection |
Grammar | getQueryGrammar() Get the query grammar used by the connection. | from Connection |
void | setQueryGrammar(Grammar $grammar) Set the query grammar used by the connection. | from Connection |
Grammar | getSchemaGrammar() Get the schema grammar used by the connection. | from Connection |
void | setSchemaGrammar(Grammar $grammar) Set the schema grammar used by the connection. | from Connection |
Processor | getPostProcessor() Get the query post processor used by the connection. | from Connection |
void | setPostProcessor(Processor $processor) Set the query post processor used by the connection. | from Connection |
Dispatcher | getEventDispatcher() Get the event dispatcher used by the connection. | from Connection |
void | setEventDispatcher(Dispatcher $events) Set the event dispatcher instance on the connection. | from Connection |
bool | pretending() Determine if the connection in a "dry run". | from Connection |
int | getFetchMode() Get the default fetch mode for the connection. | from Connection |
int | setFetchMode(int $fetchMode) Set the default fetch mode for the connection. | from Connection |
array | getQueryLog() Get the connection query log. | from Connection |
void | flushQueryLog() Clear the query log. | from Connection |
void | enableQueryLog() Enable the query log on the connection. | from Connection |
void | disableQueryLog() Disable the query log on the connection. | from Connection |
bool | logging() Determine whether we're logging queries. | from Connection |
string | getDatabaseName() Get the name of the connected database. | from Connection |
string | setDatabaseName(string $database) Set the name of the connected database. | from Connection |
string | getTablePrefix() Get the table prefix for the connection. | from Connection |
void | setTablePrefix(string $prefix) Set the table prefix in use by the connection. | from Connection |
Grammar | withTablePrefix(Grammar $grammar) Set the table prefix and return the grammar. | from Connection |
Details
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.
Builder getSchemaBuilder()
Get a schema builder instance for the connection.
Builder table(string $table)
Begin a fluent query against a database table.
Builder query()
Get a new query builder instance.
Expression 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.
Grammar getQueryGrammar()
Get the query grammar used by the connection.
void setQueryGrammar(Grammar $grammar)
Set the query grammar used by the connection.
Grammar getSchemaGrammar()
Get the schema grammar used by the connection.
void setSchemaGrammar(Grammar $grammar)
Set the schema grammar used by the connection.
Processor getPostProcessor()
Get the query post processor used by the connection.
void setPostProcessor(Processor $processor)
Set the query post processor used by the connection.
Dispatcher 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.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.4/Illuminate/Database/SQLiteConnection.html