Interface IGraphStatement
Represents a graph statement.
Namespace: Cassandra.DataStax.Graph
Assembly: Cassandra.dll
Syntax
public interface IGraphStatement
Properties
ConsistencyLevel
Returns the consistency level to use for this statement.
Declaration
ConsistencyLevel? ConsistencyLevel { get; }
Property Value
| Type | Description |
|---|---|
| ConsistencyLevel? |
GraphLanguage
Gets the graph language to use with this statement.
Declaration
string GraphLanguage { get; }
Property Value
| Type | Description |
|---|---|
| string |
GraphName
Gets the graph name to use with this statement.
Declaration
string GraphName { get; }
Property Value
| Type | Description |
|---|---|
| string |
GraphProtocolVersion
Gets the graph protocol version to use with this statement. See GraphProtocolVersion.
Declaration
GraphProtocol? GraphProtocolVersion { get; }
Property Value
| Type | Description |
|---|---|
| GraphProtocol? |
GraphReadConsistencyLevel
Gets the consistency level used for read graph queries.
Declaration
ConsistencyLevel? GraphReadConsistencyLevel { get; }
Property Value
| Type | Description |
|---|---|
| ConsistencyLevel? |
GraphSource
Gets the graph traversal source name to use with this statement.
Declaration
string GraphSource { get; }
Property Value
| Type | Description |
|---|---|
| string |
GraphWriteConsistencyLevel
Gets the consistency level used for write graph queries.
Declaration
ConsistencyLevel? GraphWriteConsistencyLevel { get; }
Property Value
| Type | Description |
|---|---|
| ConsistencyLevel? |
IsSystemQuery
Determines whether this statement is marked as a system query.
Declaration
bool IsSystemQuery { get; }
Property Value
| Type | Description |
|---|---|
| bool |
ReadTimeoutMillis
Gets the ReadTimeout for the statement that, when is different than 0, overrides ReadTimeoutMillis.
Use System.Threading.Timeout.Infinite to disable timeouts for this Statement.
Declaration
int ReadTimeoutMillis { get; }
Property Value
| Type | Description |
|---|---|
| int |
Timestamp
Gets the default timestamp for this query.
Declaration
DateTimeOffset? Timestamp { get; }
Property Value
| Type | Description |
|---|---|
| DateTimeOffset? |
Methods
SetConsistencyLevel(ConsistencyLevel)
Sets the consistency level to use for this statement.
This setting will affect the general consistency when executing the gremlin query. However executing a gremlin query on the server side is going to involve the execution of CQL queries to the persistence engine that is Cassandra. Those queries can be both reads and writes and both will have a settable consistency level. Setting only this property will indicate to the server to use this consistency level for both reads and writes in Cassandra. Read or write consistency level can be set separately with respectively SetGraphReadConsistencyLevel(ConsistencyLevel) and SetGraphWriteConsistencyLevel(ConsistencyLevel) will override the consistency set here.
Declaration
IGraphStatement SetConsistencyLevel(ConsistencyLevel consistency)
Parameters
| Type | Name | Description |
|---|---|---|
| ConsistencyLevel | consistency |
Returns
| Type | Description |
|---|---|
| IGraphStatement |
SetGraphLanguage(string)
Sets the graph language to use with this statement.
This property is not required; if it is not set, the default Language will be used when executing the statement.
Declaration
IGraphStatement SetGraphLanguage(string language)
Parameters
| Type | Name | Description |
|---|---|---|
| string | language |
Returns
| Type | Description |
|---|---|
| IGraphStatement |
SetGraphName(string)
Sets the graph name to use in graph queries. If you don't call this method, it is left unset.
Declaration
IGraphStatement SetGraphName(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name |
Returns
| Type | Description |
|---|---|
| IGraphStatement |
SetGraphProtocolVersion(GraphProtocol)
Sets the graph protocol version to use in graph queries. If you don't call this method, the default will be used (check GraphProtocolVersion).
Declaration
IGraphStatement SetGraphProtocolVersion(GraphProtocol graphProtocol)
Parameters
| Type | Name | Description |
|---|---|---|
| GraphProtocol | graphProtocol |
Returns
| Type | Description |
|---|---|
| IGraphStatement |
SetGraphReadConsistencyLevel(ConsistencyLevel)
Sets the consistency level used for the graph read query.
This setting will override the consistency level set with SetConsistencyLevel(ConsistencyLevel) only for the READ part of the graph query.
Declaration
IGraphStatement SetGraphReadConsistencyLevel(ConsistencyLevel consistency)
Parameters
| Type | Name | Description |
|---|---|---|
| ConsistencyLevel | consistency |
Returns
| Type | Description |
|---|---|
| IGraphStatement |
SetGraphSource(string)
Sets the graph traversal source name to use in graph queries. If you don't call this method, it defaults to Source.
Declaration
IGraphStatement SetGraphSource(string source)
Parameters
| Type | Name | Description |
|---|---|---|
| string | source |
Returns
| Type | Description |
|---|---|
| IGraphStatement |
SetGraphSourceAnalytics()
Sets the graph source to the server-defined analytic traversal source ("a") for this statement.
Declaration
IGraphStatement SetGraphSourceAnalytics()
Returns
| Type | Description |
|---|---|
| IGraphStatement |
SetGraphWriteConsistencyLevel(ConsistencyLevel)
Sets the consistency level used for the graph write query.
This setting will override the consistency level set with SetConsistencyLevel(ConsistencyLevel) only for the WRITE part of the graph query.
Declaration
IGraphStatement SetGraphWriteConsistencyLevel(ConsistencyLevel consistency)
Parameters
| Type | Name | Description |
|---|---|---|
| ConsistencyLevel | consistency |
Returns
| Type | Description |
|---|---|
| IGraphStatement |
SetReadTimeoutMillis(int)
Sets the per-host read timeout in milliseconds for this statement.
Use System.Threading.Timeout.Infinite to disable timeouts for this Statement.
Use zero to use the default value specified in the ReadTimeoutMillis.
Declaration
IGraphStatement SetReadTimeoutMillis(int timeout)
Parameters
| Type | Name | Description |
|---|---|---|
| int | timeout | Timeout in milliseconds. |
Returns
| Type | Description |
|---|---|
| IGraphStatement | This instance |
SetSystemQuery()
Forces this statement to use no graph name, even if a default graph name was defined with SetName(string).
If a graph name was previously defined on this statement, it will be reset.
Declaration
IGraphStatement SetSystemQuery()
Returns
| Type | Description |
|---|---|
| IGraphStatement |
SetTimestamp(DateTimeOffset)
Sets the timestamp associated with this query.
Declaration
IGraphStatement SetTimestamp(DateTimeOffset timestamp)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTimeOffset | timestamp |
Returns
| Type | Description |
|---|---|
| IGraphStatement |
ToIStatement(GraphOptions)
DEPRECATED. Returns the IStatement representation of the Graph statement.
Declaration
IStatement ToIStatement(GraphOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| GraphOptions | options |
Returns
| Type | Description |
|---|---|
| IStatement |