StarRocks¶
The starrocks/sqlalchemy adapter provides integration with StarRocks, a high-performance analytical database
compatible with the MySQL protocol, using SQLAlchemy.
Session Managers¶
StarRocks-specific session manager handling connection management for the StarRocks analytical engine.
archipy.adapters.starrocks.sqlalchemy.session_managers.StarRocksSQlAlchemySessionManager ¶
Bases: BaseSQLAlchemySessionManager[StarRocksSQLAlchemyConfig]
Synchronous SQLAlchemy session manager for StarRocks.
Inherits from BaseSQLAlchemySessionManager to provide StarRocks-specific session management, including connection URL creation and engine configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
orm_config
|
StarRocksSQLAlchemyConfig | None
|
StarRocks-specific configuration. If None, uses global config. |
None
|
Source code in archipy/adapters/starrocks/sqlalchemy/session_managers.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | |
archipy.adapters.starrocks.sqlalchemy.session_managers.StarRocksSQlAlchemySessionManager.engine
instance-attribute
¶
archipy.adapters.starrocks.sqlalchemy.session_managers.StarRocksSQlAlchemySessionManager.get_session ¶
Retrieve a thread-safe SQLAlchemy session.
Returns:
| Name | Type | Description |
|---|---|---|
Session |
Session
|
A SQLAlchemy session instance for database operations. |
Raises:
| Type | Description |
|---|---|
DatabaseConnectionError
|
If there's an error creating the session. |
DatabaseConfigurationError
|
If there's an error in the database configuration. |
Source code in archipy/adapters/base/sqlalchemy/session_managers.py
archipy.adapters.starrocks.sqlalchemy.session_managers.StarRocksSQlAlchemySessionManager.remove_session ¶
Remove the current session from the registry.
Cleans up the session to prevent resource leaks, typically called at the end of a request.
Raises:
| Type | Description |
|---|---|
DatabaseConnectionError
|
If there's an error removing the session. |
DatabaseConfigurationError
|
If there's an error in the database configuration. |
Source code in archipy/adapters/base/sqlalchemy/session_managers.py
archipy.adapters.starrocks.sqlalchemy.session_managers.AsyncStarRocksSQlAlchemySessionManager ¶
Bases: AsyncBaseSQLAlchemySessionManager[StarRocksSQLAlchemyConfig]
Asynchronous SQLAlchemy session manager for StarRocks.
Inherits from AsyncBaseSQLAlchemySessionManager to provide async StarRocks-specific session management, including connection URL creation and async engine configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
orm_config
|
StarRocksSQLAlchemyConfig | None
|
StarRocks-specific configuration. If None, uses global config. |
None
|
Source code in archipy/adapters/starrocks/sqlalchemy/session_managers.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | |
archipy.adapters.starrocks.sqlalchemy.session_managers.AsyncStarRocksSQlAlchemySessionManager.engine
instance-attribute
¶
archipy.adapters.starrocks.sqlalchemy.session_managers.AsyncStarRocksSQlAlchemySessionManager.get_session ¶
Retrieve a task-safe async SQLAlchemy session.
Returns:
| Name | Type | Description |
|---|---|---|
AsyncSession |
AsyncSession
|
An async SQLAlchemy session instance for database operations. |
Raises:
| Type | Description |
|---|---|
DatabaseConnectionError
|
If there's an error creating the session. |
DatabaseConfigurationError
|
If there's an error in the database configuration. |
Source code in archipy/adapters/base/sqlalchemy/session_managers.py
archipy.adapters.starrocks.sqlalchemy.session_managers.AsyncStarRocksSQlAlchemySessionManager.remove_session
async
¶
Remove the current session from the registry.
Cleans up the session to prevent resource leaks, typically called at the end of a request.
Raises:
| Type | Description |
|---|---|
DatabaseConnectionError
|
If there's an error removing the session. |
DatabaseConfigurationError
|
If there's an error in the database configuration. |
Source code in archipy/adapters/base/sqlalchemy/session_managers.py
options: show_root_toc_entry: false heading_level: 3
Session Manager Registry¶
Registry for StarRocks session manager instances.
archipy.adapters.starrocks.sqlalchemy.session_manager_registry.StarRocksSessionManagerRegistry ¶
Bases: SessionManagerRegistry
Registry for StarRocks SQLAlchemy session managers.
This registry provides a centralized access point for both synchronous and asynchronous StarRocks session managers, implementing the Service Locator pattern. It lazily initializes the appropriate session manager when first requested.
The registry maintains singleton instances of: - A synchronous session manager (StarRocksSQlAlchemySessionManager) - An asynchronous session manager (AsyncStarRocksSQlAlchemySessionManager)
Source code in archipy/adapters/starrocks/sqlalchemy/session_manager_registry.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | |
archipy.adapters.starrocks.sqlalchemy.session_manager_registry.StarRocksSessionManagerRegistry.get_sync_manager
classmethod
¶
Get the synchronous StarRocks session manager instance.
Lazily initializes a default StarRocksSQlAlchemySessionManager if none has been set.
Returns:
| Name | Type | Description |
|---|---|---|
SessionManagerPort |
SessionManagerPort
|
The registered synchronous session manager |
Raises:
| Type | Description |
|---|---|
DatabaseConnectionError
|
If there's an error initializing the session manager |
Source code in archipy/adapters/starrocks/sqlalchemy/session_manager_registry.py
archipy.adapters.starrocks.sqlalchemy.session_manager_registry.StarRocksSessionManagerRegistry.set_sync_manager
classmethod
¶
Set a custom synchronous session manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
manager
|
SessionManagerPort
|
An instance implementing SessionManagerPort |
required |
Raises:
| Type | Description |
|---|---|
InvalidArgumentError
|
If the manager is None or doesn't implement SessionManagerPort |
Source code in archipy/adapters/starrocks/sqlalchemy/session_manager_registry.py
archipy.adapters.starrocks.sqlalchemy.session_manager_registry.StarRocksSessionManagerRegistry.get_async_manager
classmethod
¶
Get the asynchronous StarRocks session manager instance.
Lazily initializes a default AsyncStarRocksSQlAlchemySessionManager if none has been set.
Returns:
| Name | Type | Description |
|---|---|---|
AsyncSessionManagerPort |
AsyncSessionManagerPort
|
The registered asynchronous session manager |
Raises:
| Type | Description |
|---|---|
DatabaseConnectionError
|
If there's an error initializing the session manager |
Source code in archipy/adapters/starrocks/sqlalchemy/session_manager_registry.py
archipy.adapters.starrocks.sqlalchemy.session_manager_registry.StarRocksSessionManagerRegistry.set_async_manager
classmethod
¶
Set a custom asynchronous session manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
manager
|
AsyncSessionManagerPort
|
An instance implementing AsyncSessionManagerPort |
required |
Raises:
| Type | Description |
|---|---|
InvalidArgumentError
|
If the manager is None or doesn't implement AsyncSessionManagerPort |
Source code in archipy/adapters/starrocks/sqlalchemy/session_manager_registry.py
archipy.adapters.starrocks.sqlalchemy.session_manager_registry.StarRocksSessionManagerRegistry.reset
classmethod
¶
Reset the registry to its initial state.
This method clears both registered managers, useful for testing.
Source code in archipy/adapters/starrocks/sqlalchemy/session_manager_registry.py
options: show_root_toc_entry: false heading_level: 3
Adapters¶
Concrete StarRocks adapter built on the base SQLAlchemy adapter with StarRocks-specific dialect configuration.
archipy.adapters.starrocks.sqlalchemy.adapters.StarrocksSQLAlchemyAdapter ¶
Bases: BaseSQLAlchemyAdapter[StarRocksSQLAlchemyConfig]
Synchronous SQLAlchemy adapter for Starrocks.
Inherits from BaseSQLAlchemyAdapter to provide Starrocks-specific session management and database operations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
orm_config
|
StarRocksSQLAlchemyConfig | None
|
Starrocks-specific configuration. If None, uses global config. |
None
|
Source code in archipy/adapters/starrocks/sqlalchemy/adapters.py
archipy.adapters.starrocks.sqlalchemy.adapters.StarrocksSQLAlchemyAdapter.session_manager
instance-attribute
¶
archipy.adapters.starrocks.sqlalchemy.adapters.StarrocksSQLAlchemyAdapter.get_session ¶
Get a database session.
Returns:
| Name | Type | Description |
|---|---|---|
Session |
Session
|
A SQLAlchemy session. |
Raises:
| Type | Description |
|---|---|
DatabaseConnectionError
|
If there's an error getting the session. |
DatabaseConfigurationError
|
If there's an error in the database configuration. |
Source code in archipy/adapters/base/sqlalchemy/adapters.py
archipy.adapters.starrocks.sqlalchemy.adapters.StarrocksSQLAlchemyAdapter.execute_search_query ¶
execute_search_query(
entity: type[T],
query: Select,
pagination: PaginationDTO | None = None,
sort_info: SortDTO | None = None,
has_multiple_entities: bool = False,
) -> tuple[list[T], int]
Execute a search query with pagination and sorting.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity
|
type[T]
|
The entity class to query. |
required |
query
|
Select
|
The SQLAlchemy SELECT query. |
required |
pagination
|
PaginationDTO | None
|
Optional pagination settings. |
None
|
sort_info
|
SortDTO | None
|
Optional sorting information. |
None
|
has_multiple_entities
|
bool
|
Optional bool. |
False
|
Returns:
| Type | Description |
|---|---|
tuple[list[T], int]
|
Tuple of the list of entities and the total count. |
Raises:
| Type | Description |
|---|---|
DatabaseQueryError
|
If the database query fails. |
DatabaseTimeoutError
|
If the query times out. |
DatabaseConnectionError
|
If there's a connection error. |
DatabaseTransactionError
|
If there's a transaction error. |
Source code in archipy/adapters/base/sqlalchemy/adapters.py
archipy.adapters.starrocks.sqlalchemy.adapters.StarrocksSQLAlchemyAdapter.create ¶
Create a new entity in the database.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity
|
T
|
The entity to create. |
required |
Returns:
| Type | Description |
|---|---|
T | None
|
The created entity with updated attributes, preserving the original type. |
Raises:
| Type | Description |
|---|---|
InvalidEntityTypeError
|
If the entity type is not a valid SQLAlchemy model. |
DatabaseQueryError
|
If the database operation fails. |
DatabaseIntegrityError
|
If there's an integrity constraint violation. |
DatabaseConstraintError
|
If there's a constraint violation. |
DatabaseConnectionError
|
If there's a connection error. |
DatabaseTransactionError
|
If there's a transaction error. |
Source code in archipy/adapters/base/sqlalchemy/adapters.py
archipy.adapters.starrocks.sqlalchemy.adapters.StarrocksSQLAlchemyAdapter.bulk_create ¶
Creates multiple entities in a single database operation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entities
|
list[T]
|
List of entities to create. |
required |
Returns:
| Type | Description |
|---|---|
list[T] | None
|
List of created entities with updated attributes, preserving original types. |
Raises:
| Type | Description |
|---|---|
InvalidEntityTypeError
|
If any entity is not a valid SQLAlchemy model. |
DatabaseQueryError
|
If the database operation fails. |
DatabaseIntegrityError
|
If there's an integrity constraint violation. |
DatabaseConstraintError
|
If there's a constraint violation. |
DatabaseConnectionError
|
If there's a connection error. |
DatabaseTransactionError
|
If there's a transaction error. |
Source code in archipy/adapters/base/sqlalchemy/adapters.py
archipy.adapters.starrocks.sqlalchemy.adapters.StarrocksSQLAlchemyAdapter.get_by_uuid ¶
Retrieve an entity by its UUID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity_type
|
type[T]
|
The type of entity to retrieve. |
required |
entity_uuid
|
UUID
|
The UUID of the entity. |
required |
Returns:
| Type | Description |
|---|---|
BaseEntity | None
|
The entity if found, None otherwise. |
Raises:
| Type | Description |
|---|---|
InvalidEntityTypeError
|
If the entity type is not a valid SQLAlchemy model. |
DatabaseQueryError
|
If the database operation fails. |
DatabaseTimeoutError
|
If the query times out. |
DatabaseConnectionError
|
If there's a connection error. |
DatabaseTransactionError
|
If there's a transaction error. |
Source code in archipy/adapters/base/sqlalchemy/adapters.py
archipy.adapters.starrocks.sqlalchemy.adapters.StarrocksSQLAlchemyAdapter.delete ¶
Delete an entity from the database.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity
|
T
|
The entity to delete. |
required |
Raises:
| Type | Description |
|---|---|
InvalidEntityTypeError
|
If the entity is not a valid SQLAlchemy model. |
DatabaseQueryError
|
If the database operation fails. |
DatabaseIntegrityError
|
If there's an integrity constraint violation. |
DatabaseConstraintError
|
If there's a constraint violation. |
DatabaseConnectionError
|
If there's a connection error. |
DatabaseTransactionError
|
If there's a transaction error. |
Source code in archipy/adapters/base/sqlalchemy/adapters.py
archipy.adapters.starrocks.sqlalchemy.adapters.StarrocksSQLAlchemyAdapter.bulk_delete ¶
Delete multiple entities from the database.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entities
|
list[T]
|
List of entities to delete. |
required |
Raises:
| Type | Description |
|---|---|
InvalidEntityTypeError
|
If any entity is not a valid SQLAlchemy model. |
DatabaseQueryError
|
If the database operation fails. |
DatabaseIntegrityError
|
If there's an integrity constraint violation. |
DatabaseConstraintError
|
If there's a constraint violation. |
DatabaseConnectionError
|
If there's a connection error. |
DatabaseTransactionError
|
If there's a transaction error. |
Source code in archipy/adapters/base/sqlalchemy/adapters.py
archipy.adapters.starrocks.sqlalchemy.adapters.StarrocksSQLAlchemyAdapter.execute ¶
Execute a SQLAlchemy statement.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
statement
|
Executable
|
The SQLAlchemy statement to execute. |
required |
params
|
AnyExecuteParams | None
|
Optional parameters for the statement. |
None
|
Returns:
| Type | Description |
|---|---|
Result[Any]
|
The result of the execution. |
Raises:
| Type | Description |
|---|---|
DatabaseQueryError
|
If the database operation fails. |
DatabaseTimeoutError
|
If the query times out. |
DatabaseConnectionError
|
If there's a connection error. |
DatabaseTransactionError
|
If there's a transaction error. |
Source code in archipy/adapters/base/sqlalchemy/adapters.py
archipy.adapters.starrocks.sqlalchemy.adapters.StarrocksSQLAlchemyAdapter.scalars ¶
Execute a SQLAlchemy statement and return scalar results.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
statement
|
Executable
|
The SQLAlchemy statement to execute. |
required |
params
|
AnyExecuteParams | None
|
Optional parameters for the statement. |
None
|
Returns:
| Type | Description |
|---|---|
ScalarResult[Any]
|
The scalar results of the execution. |
Raises:
| Type | Description |
|---|---|
DatabaseQueryError
|
If the database operation fails. |
DatabaseTimeoutError
|
If the query times out. |
DatabaseConnectionError
|
If there's a connection error. |
DatabaseTransactionError
|
If there's a transaction error. |
Source code in archipy/adapters/base/sqlalchemy/adapters.py
archipy.adapters.starrocks.sqlalchemy.adapters.AsyncStarrocksSQLAlchemyAdapter ¶
Bases: AsyncBaseSQLAlchemyAdapter[StarRocksSQLAlchemyConfig]
Asynchronous SQLAlchemy adapter for Starrocks.
Inherits from AsyncBaseSQLAlchemyAdapter to provide async Starrocks-specific session management and database operations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
orm_config
|
StarRocksSQLAlchemyConfig | None
|
Starrocks-specific configuration. If None, uses global config. |
None
|
Source code in archipy/adapters/starrocks/sqlalchemy/adapters.py
archipy.adapters.starrocks.sqlalchemy.adapters.AsyncStarrocksSQLAlchemyAdapter.session_manager
instance-attribute
¶
session_manager: AsyncBaseSQLAlchemySessionManager[
ConfigT
] = _create_async_session_manager(configs)
archipy.adapters.starrocks.sqlalchemy.adapters.AsyncStarrocksSQLAlchemyAdapter.get_session ¶
Get a database session.
Returns:
| Name | Type | Description |
|---|---|---|
AsyncSession |
AsyncSession
|
A SQLAlchemy async session. |
Raises:
| Type | Description |
|---|---|
DatabaseConnectionError
|
If there's an error getting the session. |
DatabaseConfigurationError
|
If there's an error in the database configuration. |
Source code in archipy/adapters/base/sqlalchemy/adapters.py
archipy.adapters.starrocks.sqlalchemy.adapters.AsyncStarrocksSQLAlchemyAdapter.execute_search_query
async
¶
execute_search_query(
entity: type[T],
query: Select,
pagination: PaginationDTO | None,
sort_info: SortDTO | None = None,
has_multiple_entities: bool = False,
) -> tuple[list[T], int]
Execute a search query with pagination and sorting.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity
|
type[T]
|
The entity class to query. |
required |
query
|
Select
|
The SQLAlchemy SELECT query. |
required |
pagination
|
PaginationDTO | None
|
Optional pagination settings. |
required |
sort_info
|
SortDTO | None
|
Optional sorting information. |
None
|
has_multiple_entities
|
bool
|
Optional bool |
False
|
Returns:
| Type | Description |
|---|---|
tuple[list[T], int]
|
Tuple of the list of entities and the total count. |
Raises:
| Type | Description |
|---|---|
DatabaseQueryError
|
If the database query fails. |
DatabaseTimeoutError
|
If the query times out. |
DatabaseConnectionError
|
If there's a connection error. |
DatabaseTransactionError
|
If there's a transaction error. |
Source code in archipy/adapters/base/sqlalchemy/adapters.py
archipy.adapters.starrocks.sqlalchemy.adapters.AsyncStarrocksSQLAlchemyAdapter.create
async
¶
Create a new entity in the database.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity
|
T
|
The entity to create. |
required |
Returns:
| Type | Description |
|---|---|
T | None
|
The created entity with updated attributes, preserving the original type. |
Raises:
| Type | Description |
|---|---|
InvalidEntityTypeError
|
If the entity type is not a valid SQLAlchemy model. |
DatabaseQueryError
|
If the database operation fails. |
DatabaseIntegrityError
|
If there's an integrity constraint violation. |
DatabaseConstraintError
|
If there's a constraint violation. |
DatabaseConnectionError
|
If there's a connection error. |
DatabaseTransactionError
|
If there's a transaction error. |
Source code in archipy/adapters/base/sqlalchemy/adapters.py
archipy.adapters.starrocks.sqlalchemy.adapters.AsyncStarrocksSQLAlchemyAdapter.bulk_create
async
¶
Creates multiple entities in a single database operation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entities
|
list[T]
|
List of entities to create. |
required |
Returns:
| Type | Description |
|---|---|
list[T] | None
|
List of created entities with updated attributes, preserving original types. |
Raises:
| Type | Description |
|---|---|
InvalidEntityTypeError
|
If any entity is not a valid SQLAlchemy model. |
DatabaseQueryError
|
If the database operation fails. |
DatabaseIntegrityError
|
If there's an integrity constraint violation. |
DatabaseConstraintError
|
If there's a constraint violation. |
DatabaseConnectionError
|
If there's a connection error. |
DatabaseTransactionError
|
If there's a transaction error. |
Source code in archipy/adapters/base/sqlalchemy/adapters.py
archipy.adapters.starrocks.sqlalchemy.adapters.AsyncStarrocksSQLAlchemyAdapter.get_by_uuid
async
¶
Retrieve an entity by its UUID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity_type
|
type[T]
|
The type of entity to retrieve. |
required |
entity_uuid
|
UUID
|
The UUID of the entity. |
required |
Returns:
| Type | Description |
|---|---|
BaseEntity | None
|
The entity if found, None otherwise. |
Raises:
| Type | Description |
|---|---|
InvalidEntityTypeError
|
If the entity type is not a valid SQLAlchemy model. |
DatabaseQueryError
|
If the database operation fails. |
DatabaseTimeoutError
|
If the query times out. |
DatabaseConnectionError
|
If there's a connection error. |
DatabaseTransactionError
|
If there's a transaction error. |
Source code in archipy/adapters/base/sqlalchemy/adapters.py
archipy.adapters.starrocks.sqlalchemy.adapters.AsyncStarrocksSQLAlchemyAdapter.delete
async
¶
Delete an entity from the database.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity
|
BaseEntity
|
The entity to delete. |
required |
Raises:
| Type | Description |
|---|---|
InvalidEntityTypeError
|
If the entity is not a valid SQLAlchemy model. |
DatabaseQueryError
|
If the database operation fails. |
DatabaseIntegrityError
|
If there's an integrity constraint violation. |
DatabaseConstraintError
|
If there's a constraint violation. |
DatabaseConnectionError
|
If there's a connection error. |
DatabaseTransactionError
|
If there's a transaction error. |
Source code in archipy/adapters/base/sqlalchemy/adapters.py
archipy.adapters.starrocks.sqlalchemy.adapters.AsyncStarrocksSQLAlchemyAdapter.bulk_delete
async
¶
Delete multiple entities from the database.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entities
|
list[T]
|
List of entities to delete. |
required |
Raises:
| Type | Description |
|---|---|
InvalidEntityTypeError
|
If any entity is not a valid SQLAlchemy model. |
DatabaseQueryError
|
If the database operation fails. |
DatabaseIntegrityError
|
If there's an integrity constraint violation. |
DatabaseConstraintError
|
If there's a constraint violation. |
DatabaseConnectionError
|
If there's a connection error. |
DatabaseTransactionError
|
If there's a transaction error. |
Source code in archipy/adapters/base/sqlalchemy/adapters.py
archipy.adapters.starrocks.sqlalchemy.adapters.AsyncStarrocksSQLAlchemyAdapter.execute
async
¶
Execute a SQLAlchemy statement.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
statement
|
Executable
|
The SQLAlchemy statement to execute. |
required |
params
|
AnyExecuteParams | None
|
Optional parameters for the statement. |
None
|
Returns:
| Type | Description |
|---|---|
Result[Any]
|
The result of the execution. |
Raises:
| Type | Description |
|---|---|
DatabaseQueryError
|
If the database operation fails. |
DatabaseTimeoutError
|
If the query times out. |
DatabaseConnectionError
|
If there's a connection error. |
DatabaseTransactionError
|
If there's a transaction error. |
Source code in archipy/adapters/base/sqlalchemy/adapters.py
archipy.adapters.starrocks.sqlalchemy.adapters.AsyncStarrocksSQLAlchemyAdapter.scalars
async
¶
Execute a SQLAlchemy statement and return scalar results.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
statement
|
Executable
|
The SQLAlchemy statement to execute. |
required |
params
|
AnyExecuteParams | None
|
Optional parameters for the statement. |
None
|
Returns:
| Type | Description |
|---|---|
ScalarResult[Any]
|
The scalar results of the execution. |
Raises:
| Type | Description |
|---|---|
DatabaseQueryError
|
If the database operation fails. |
DatabaseTimeoutError
|
If the query times out. |
DatabaseConnectionError
|
If there's a connection error. |
DatabaseTransactionError
|
If there's a transaction error. |
Source code in archipy/adapters/base/sqlalchemy/adapters.py
options: show_root_toc_entry: false heading_level: 3