ConnectionInterface
interface ConnectionInterface (View source)
Methods
Get a new raw query expression.
Run a select statement and return a single result.
Run a select statement and return the first column of the first row.
Run a select statement against the database.
Run a select statement against the database and returns a generator.
Run an insert statement against the database.
Run an update statement against the database.
Run a delete statement against the database.
Execute an SQL statement and return the boolean result.
Run an SQL statement and get the number of rows affected.
Run a raw, unprepared query against the PDO connection.
Prepare the query bindings for execution.
Start a new database transaction.
Commit the active database transaction.
Rollback the active database transaction.
Get the number of active transactions.
Get the name of the connected database.
Details
Builder
table(Closure|Builder|string $table, string|null $as = null)
Begin a fluent query against a database table.
mixed
selectOne(string $query, array $bindings = [], bool $useReadPdo = true)
Run a select statement and return a single result.
mixed
scalar(string $query, array $bindings = [], bool $useReadPdo = true)
Run a select statement and return the first column of the first row.
array
select(string $query, array $bindings = [], bool $useReadPdo = true)
Run a select statement against the database.
Generator
cursor(string $query, array $bindings = [], bool $useReadPdo = true)
Run a select statement against the database and returns a generator.
bool
statement(string $query, array $bindings = [])
Execute an SQL statement and return the boolean result.
int
affectingStatement(string $query, array $bindings = [])
Run an SQL statement and get the number of rows affected.