nexusLIMS.db.engine#

Database engine and session management for NexusLIMS.

This module provides a centralized SQLModel engine and session factory for database operations, replacing the manual sqlite3 connection management.

Module Contents#

Functions#

get_engine

Get the database engine, creating it lazily on first access.

API#

nexusLIMS.db.engine.get_engine() Engine[source]#

Get the database engine, creating it lazily on first access.

Returns:

The SQLAlchemy/SQLModel engine for the NexusLIMS database.

Return type:

Engine

Examples:

>>> from nexusLIMS.db.engine import get_engine
>>> engine = get_engine()
>>> # Use engine for advanced operations