CassandraBase¶
The CassandraBase
class serves as a common base.
Import¶
from primeight.base import CassandraColumn
Constructor¶
- config
dict
[Required]: table configuration, as returned by one of the parsers - cassandra_manager
primeight.manager.CassandraManager
(Default:None
): Cassandra manager
Attributes¶
cassandra_manager¶
Type: primeight.manager.CassandraManager
Cassandra manager where to run the statements.
config¶
Type: dict
Table configuration, as returned by one of the parsers
from the module primeight.parser
.
statements¶
Type: List[str]
Current statements in object.
Methods¶
execute¶
Execute CassandraBase.statements
sequentially using the CassandraBase.cassandra_manager
.
The return type depends on the row_factory
defined in the execution profile.
Parameters:
- execution_profile
str or cassandra.cluster.ExecutionProfile
(Default:None
): Execution profile name or ExecutionProfile object
Return: List[tuple] or List[dict]
execute_concurrent¶
Execute CassandraBase.statements
concurrently using the CassandraBase.cassandra_manager
.
The return type depends on the row_factory
defined in the execution profile.
Parameters:
- raise_on_first_error
bool
(Default:False
): Whether to stop after the first failed statement
Return: List[tuple] or List[dict]