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.

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

string or statement to be executed.

$options array|Dse\ExecutionOptions

execution options (optional)

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

execution options (optional)

Returns:
Type Details
Dse\FutureRows

A future that can be used to retrieve the result.

Dse\PreparedStatement

prepare

( string $cql, Dse\ExecutionOptions $options )

Prepare a query for execution.

Parameters:
Name Type Details
$cql string

The query to be prepared.

$options 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.

Dse\FuturePreparedStatement

prepareAsync

( string $cql, Dse\ExecutionOptions $options )

Asynchronously prepare a query for execution.

Parameters:
Name Type Details
$cql string

The query to be prepared.

$options Dse\ExecutionOptions

Options to control preparing the query.

Returns:
Type Details
Dse\FuturePreparedStatement

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

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.

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. * array[“graph_language”] string Graph language; default “gremlin-groovy” * array[“graph_source”] string Graph source; default “g”. If running analytics (OLAP) query then it should use “a” * array[“graph_name”] string Graph name * array[“read_consistency”] consistency Read consistency of graph queries; default Dse::CONSISTENCY\_ONE * array[“write_consistency”] consistency Write consistency of graph queries; default Dse::CONSISTENCY\_QUORUM * array[“request_timeout”] double|int Request time of graph queries in seconds; default 0 (no timeout) * array[“timestamp”] int|string Either an integer or integer string timestamp that represents the number of microseconds since the epoch

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: