Skip to main content

Module db_service

Module db_service 

Source
Expand description

Database service abstraction layer

This module provides an async database interface that abstracts away the underlying database implementation. This makes it easy to:

  • Switch between sync (rusqlite) and async (tokio-rusqlite) implementations
  • Prevent blocking the async runtime with synchronous database calls
  • Test with different database backends
  • Migrate to other database systems in the future

Structsยง

Query
Represents a database query that can be executed
RusqliteService
Rusqlite-based database service implementation
Transaction
Transaction handle for batching multiple operations

Enumsยง

QueryParam
Query parameter types supported by the database

Traitsยง

DatabaseService
Database service trait - abstraction over database operations

Functionsยง

convert_params ๐Ÿ”’
Convert QueryParam to rusqlite::types::Value
execute_query ๐Ÿ”’
query_many ๐Ÿ”’
query_one ๐Ÿ”’
query_optional ๐Ÿ”’

Type Aliasesยง

DbResult
Database query result type