interface Illuminate / Database / ConnectionInterface
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.

ConnectionInterface

Methods

public

table ( $table , $as ) : Builder

Begin a fluent query against a database table.

Parameters

public

raw ( $value ) : Expression

Get a new raw query expression.

Parameters

  • $value mixed
public

selectOne ( $query , $bindings , $useReadPdo ) : mixed

Run a select statement and return a single result.

Parameters

  • $query string
  • $bindings array
  • $useReadPdo bool
public

scalar ( $query , $bindings , $useReadPdo ) : mixed

Run a select statement and return the first column of the first row.

Parameters

  • $query string
  • $bindings array
  • $useReadPdo bool
public

select ( $query , $bindings , $useReadPdo ) : array

Run a select statement against the database.

Parameters

  • $query string
  • $bindings array
  • $useReadPdo bool
public

cursor ( $query , $bindings , $useReadPdo ) : Generator

Run a select statement against the database and returns a generator.

Parameters

  • $query string
  • $bindings array
  • $useReadPdo bool
public

insert ( $query , $bindings ) : bool

Run an insert statement against the database.

Parameters

  • $query string
  • $bindings array
public

update ( $query , $bindings ) : int

Run an update statement against the database.

Parameters

  • $query string
  • $bindings array
public

delete ( $query , $bindings ) : int

Run a delete statement against the database.

Parameters

  • $query string
  • $bindings array
public

statement ( $query , $bindings ) : bool

Execute an SQL statement and return the boolean result.

Parameters

  • $query string
  • $bindings array
public

affectingStatement ( $query , $bindings ) : int

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

Parameters

  • $query string
  • $bindings array
public

unprepared ( $query ) : bool

Run a raw, unprepared query against the PDO connection.

Parameters

  • $query string
public

prepareBindings ( array $bindings ) : array

Prepare the query bindings for execution.

Parameters

  • $bindings array
public

transaction ( Closure $callback , $attempts ) : mixed

Execute a Closure within a transaction.

Parameters

public

beginTransaction ( ) : void

Start a new database transaction.

public

commit ( ) : void

Commit the active database transaction.

public

rollBack ( ) : void

Rollback the active database transaction.

public

transactionLevel ( ) : int

Get the number of active transactions.

public

pretend ( Closure $callback ) : array

Execute the given callback in "dry run" mode.

Parameters

public

getDatabaseName ( ) : string

Get the name of the connected database.