SqlServerConnection
class SqlServerConnection extends Connection (View source)
Traits
Methods
Create a new database connection instance.
Set the schema grammar to the default implementation.
Set the query post processor to the default implementation.
Run a select statement and return a single result.
Run a select statement against the database.
Run a select statement against the database.
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.
Log a query in the connection's query log.
Get a Doctrine Schema Column instance.
Get the Doctrine DBAL schema manager for the connection.
Get the Doctrine DBAL database connection instance.
Set the reconnect instance on the connection.
Get custom constructor arguments for the PDO::FETCH_CLASS fetch mode.
Set the default fetch mode for the connection, and optional arguments for the given fetch mode.
Details
in Connection at line line 160
void
__construct(
PDO|Closure $pdo,
string $database = '',
string $tablePrefix = '',
array $config = array())
Create a new database connection instance.
in Connection at line line 186
void
useDefaultQueryGrammar()
Set the query grammar to the default implementation.
in Connection at line line 206
void
useDefaultSchemaGrammar()
Set the schema grammar to the default implementation.
in Connection at line line 226
void
useDefaultPostProcessor()
Set the query post processor to the default implementation.
in Connection at line line 246
Builder
getSchemaBuilder()
Get a schema builder instance for the connection.
in Connection at line line 261
Builder
table(
string $table)
Begin a fluent query against a database table.
in Connection at line line 296
mixed
selectOne(
string $query,
array $bindings = array())
Run a select statement and return a single result.
in Connection at line line 310
array
selectFromWriteConnection(
string $query,
array $bindings = array())
Run a select statement against the database.
in Connection at line line 323
array
select(
string $query,
array $bindings = array(),
bool $useReadPdo = true)
Run a select statement against the database.
in Connection at line line 363
bool
insert(
string $query,
array $bindings = array())
Run an insert statement against the database.
in Connection at line line 375
int
update(
string $query,
array $bindings = array())
Run an update statement against the database.
in Connection at line line 387
int
delete(
string $query,
array $bindings = array())
Run a delete statement against the database.
in Connection at line line 399
bool
statement(
string $query,
array $bindings = array())
Execute an SQL statement and return the boolean result.
in Connection at line line 419
int
affectingStatement(
string $query,
array $bindings = array())
Run an SQL statement and get the number of rows affected.
in Connection at line line 443
bool
unprepared(
string $query)
Run a raw, unprepared query against the PDO connection.
in Connection at line line 460
array
prepareBindings(
array $bindings)
Prepare the query bindings for execution.
in Connection at line line 587
array
pretend(
Closure $callback)
Execute the given callback in "dry run" mode.
in Connection at line line 749
void
logQuery(
string $query,
array $bindings,
float|null $time = null)
Log a query in the connection's query log.
in Connection at line line 768
void
listen(
Closure $callback)
Register a database query listener with the connection.
in Connection at line line 825
Column
getDoctrineColumn(
string $table,
string $column)
Get a Doctrine Schema Column instance.
in Connection at line line 837
AbstractSchemaManager
getDoctrineSchemaManager()
Get the Doctrine DBAL schema manager for the connection.
in Connection at line line 847
Connection
getDoctrineConnection()
Get the Doctrine DBAL database connection instance.
in Connection at line line 913
$this
setReadPdo(
PDO|null $pdo)
Set the PDO connection used for reading.
in Connection at line line 926
$this
setReconnector(
callable $reconnector)
Set the reconnect instance on the connection.
in Connection at line line 949
mixed
getConfig(
string $option)
Get an option from the configuration options.
in Connection at line line 969
Grammar
getQueryGrammar()
Get the query grammar used by the connection.
in Connection at line line 980
void
setQueryGrammar(
Grammar $grammar)
Set the query grammar used by the connection.
in Connection at line line 990
Grammar
getSchemaGrammar()
Get the schema grammar used by the connection.
in Connection at line line 1001
void
setSchemaGrammar(
Grammar $grammar)
Set the schema grammar used by the connection.
in Connection at line line 1011
Processor
getPostProcessor()
Get the query post processor used by the connection.
in Connection at line line 1022
void
setPostProcessor(
Processor $processor)
Set the query post processor used by the connection.
in Connection at line line 1032
Dispatcher
getEventDispatcher()
Get the event dispatcher used by the connection.
in Connection at line line 1043
void
setEventDispatcher(
Dispatcher $events)
Set the event dispatcher instance on the connection.
in Connection at line line 1073
mixed
getFetchArgument()
Get the fetch argument to be applied when selecting.
in Connection at line line 1083
array
getFetchConstructorArgument()
Get custom constructor arguments for the PDO::FETCH_CLASS fetch mode.
in Connection at line line 1096
int
setFetchMode(
int $fetchMode,
mixed $fetchArgument = null,
array $fetchConstructorArgument = array())
Set the default fetch mode for the connection, and optional arguments for the given fetch mode.
in Connection at line line 1169
string
setDatabaseName(
string $database)
Set the name of the connected database.
in Connection at line line 1190
void
setTablePrefix(
string $prefix)
Set the table prefix in use by the connection.
in Connection at line line 1203
Grammar
withTablePrefix(
Grammar $grammar)
Set the table prefix and return the grammar.