passerine.db.driver.interface¶
Note
This page is automatically generated. If you don’t see anything, this means
this sub-module is not meant to be used. If you really want to know what it
is, please check out the source code at passerine/db/driver/interface.py
.
-
class
passerine.db.driver.interface.
DialectInterface
¶ Dialect interface
It is used to translate a generic query into a native query.
-
get_alias_to_native_query_map
(query)¶ Retrieve a map from alias to native query.
Parameters: passerine.db.query.Query – the query object Return type: dict
-
get_iterating_constrains
(query)¶ Retrieve the query constrains.
Raises: NotImplemented – only if the interface is not overridden.
-
get_native_operand
(generic_operand)¶ Translate a generic operand into a corresponding native operand.
Parameters: generic_operand – a generic operand Returns: a native operand Return type: str
-
process_join_conditions
(alias_to_conditions_map, alias, join_config, parent_alias)¶ Process the join conditions.
Parameters: - alias_to_conditions_map (dict) – a alias-to-conditions map
- join_config (dict) – a join config map
- alias (str) – an alias of the given join map
- parent_alias (str) – the parent alias of the given join map
Raises: NotImplemented – only if the interface is not overridden.
-
process_non_join_conditions
(alias_to_conditions_map, definition_map, left, right, operand)¶ Process the non-join conditions.
Parameters: - alias_to_conditions_map (dict) – a alias-to-conditions map
- definition_map (dict) – a parameter-to-value map
- left (passerine.db.expression.ExpressionPart) – the left expression
- right (passerine.db.expression.ExpressionPart) – the right expression
- operand – the native operand
Raises: NotImplemented – only if the interface is not overridden.
-
-
class
passerine.db.driver.interface.
DriverInterface
(config, dialect)¶ The abstract driver interface
Parameters: - config (dict) – the configuration used to initialize the database connection / client
- dialect (passerine.db.driver.interface.DialectInterface) – the corresponding dialect
-
client
¶ Driver Connection / Client
-
collection
(name)¶ Low-level Collection-class API
Returns: the low-level collection-class API Raises: NotImplemented – only if the interface is not overridden.
-
config
¶ Driver configuration
-
connect
(config)¶ Connect the client to the server.
Raises: NotImplemented – only if the interface is not overridden.
-
database_name
¶ The name of provisioned database
-
db
(name)¶ Low-level Database-class API
Returns: the low-level database-class API Raises: NotImplemented – only if the interface is not overridden.
-
dialect
¶ Driver dialect
-
disconnect
()¶ Disconnect the client.
Raises: NotImplemented – only if the interface is not overridden.
-
index_count
()¶ Retrieve the number of indexes.
Raises: NotImplemented – only if the interface is not overridden.
-
indice
()¶ Retrieve the indice.
Raises: NotImplemented – only if the interface is not overridden.
-
insert
(collection_name, data)¶ Low-level insert function
Raises: NotImplemented – only if the interface is not overridden.
-
class
passerine.db.driver.interface.
QueryIteration
(alias, native_query)¶ Driver Query Iteration
This is a metadata class representing an iteration in complex queries.
Parameters: - alias (str) – the alias of the rewritten target
- native_query (dict) – the native query for a specific engine
Note
Internal use only
-
class
passerine.db.driver.interface.
QuerySequence
¶ Driver Query Sequence
The collection represents the sequence of sub queries.
-
add
(iteration)¶ Append the the iteration
Parameters: iteration (passerine.db.driver.interface.QueryIteration) – the query iteration
-
each
()¶ Get the sequence iterator.
-