A class that contains and manages connections to DSE. It allows for executing or preparing queries for execution.

See Also:

Implemented by

Methods

Dse\Rows

execute

( mixed $statement, mixed $options )

Execute a query.

Available execution options:

Option Name

Option Type

Option Details

arguments

array

An array or positional or named arguments

consistency

int

A consistency constant e.g Dse::CONSISTENCY_ONE, Dse::CONSISTENCY_QUORUM, etc.

timeout

int

A number of rows to include in result for paging

paging_state_token

string

A string token use to resume from the state of a previous result set

retry_policy

Dse\RetryPolicy

A retry policy that is used to handle server-side failures for this request

serial_consistency

int

Either Dse::CONSISTENCY_SERIAL or Dse::CONSISTENCY_LOCAL_SERIAL

timestamp

int|string

Either an integer or integer string timestamp that represents the number of microseconds since the epoch

execute_as

string

User to execute statement as

Parameters:
Name Type Details
$statement string|Dse\Statement

string or statement to be executed.

$options array|Dse\ExecutionOptions

Options to control execution of the query.

Throws:
Type Details
Dse\Exception
Returns:
Type Details
Dse\Rows

A collection of rows.

Dse\FutureRows

executeAsync

( mixed $statement, mixed $options )

Execute a query asynchronously. This method returns immediately, but the query continues execution in the background.

Parameters:
Name Type Details
$statement string|Dse\Statement

string or statement to be executed.

$options array|Dse\ExecutionOptions

Options to control execution of the query.

Returns:
Type Details
Dse\FutureRows

A future that can be used to retrieve the result.

See Also:
Dse\PreparedStatement

prepare

( string $cql, mixed $options )

Prepare a query for execution.

Parameters:
Name Type Details
$cql string

The query to be prepared.

$options array|Dse\ExecutionOptions

Options to control preparing the query.

Throws:
Type Details
Dse\Exception
Returns:
Type Details
Dse\PreparedStatement

A prepared statement that can be bound with parameters and executed.

See Also:
Dse\FuturePreparedStatement

prepareAsync

( string $cql, mixed $options )

Asynchronously prepare a query for execution.

Parameters:
Name Type Details
$cql string

The query to be prepared.

$options array|Dse\ExecutionOptions

Options to control preparing the query.

Returns:
Type Details
Dse\FuturePreparedStatement

A future that can be used to retrieve the prepared statement.

See Also:
null

close

( double $timeout )

Close the session and all its connections.

Parameters:
Name Type Details
$timeout double

The amount of time in seconds to wait for the session to close.

Throws:
Type Details
Dse\Exception
Returns:
Type Details
null

Nothing.

Dse\FutureClose

closeAsync

( )

Asynchronously close the session and all its connections.

Returns:
Type Details
Dse\FutureClose

A future that can be waited on.

Dse\Schema

schema

( )

Get a snapshot of the cluster’s current schema.

Returns:
Type Details
Dse\Schema

A snapshot of the cluster’s schema.

Graph\ResultSet

executeGraph

( mixed $statement, array $options )

Execute graph queries.

Available execution options:

Option Name

Option Type

Option Details

graph_language

string

Dse\Graph language; default “gremlin-groovy”

graph_source

string

Dse\Graph source; default “g”. If running analytics (OLAP) query then it should use “a”

graph_name

string

Dse\Graph name

read_consistency

consistency

Read consistency of graph queries; default Dse::CONSISTENCY_ONE

write_consistency

consistency

Write consistency of graph queries; default Dse::CONSISTENCY_QUORUM

request_timeout

double|int

Request time of graph queries in seconds; default 0 (no timeout)

timestamp

int|string

Either an integer or integer string timestamp that represents the number of microseconds since the epoch

Parameters:
Name Type Details
$statement string|Graph\Statement

A graph statement or query string to be executed.

$options array

Options to control execution of the graph query.

Throws:
Type Details
Dse\Exception
Returns:
Type Details
Graph\ResultSet

A result set.

Graph\FutureResultSet

executeGraphAsync

( mixed $statement, array $options )

Asynchronously execute a graph query.

Parameters:
Name Type Details
$statement string|Graph\Statement

A graph statement or query string to be executed.

$options array

Options to control execution of the graph query.

Returns:
Type Details
Graph\FutureResultSet

A future that can be used to retrieve the result set.

See Also: