entity.resources.database module

Database resource that executes queries using a DuckDB backend.

class entity.resources.database.DatabaseResource(infrastructure)[source]

Bases: object

Layer 2 resource providing database access.

Parameters:

infrastructure (DatabaseInfrastructure | None)

__init__(infrastructure)[source]

Initialize with an injected database infrastructure.

Parameters:

infrastructure (DatabaseInfrastructure | None)

Return type:

None

async health_check()[source]

Return True if the underlying infrastructure is healthy.

Return type:

bool

health_check_sync()[source]

Synchronous wrapper for health_check for compatibility.

Return type:

bool

execute(query, *params)[source]

Execute a SQL query and return the result cursor.

Parameters:
Return type:

object