Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseConnection ¶
func CloseConnection() error
func NewConnection ¶
func NewConnection(ctx context.Context, log zerolog.Logger, dbFilePath string) (*models.Queries, error)
NewConnection establishes a new SQLite database connection and returns a Queries instance. It opens a connection to the SQLite database at the specified file path with foreign keys enabled, verifies the connection is valid by pinging the database, executes the DDL schema to initialize or update the database structure, and returns a Queries instance for executing database operations.
Parameters:
- ctx: Context for managing the database connection lifecycle and cancellation
- dbFilePath: File system path to the SQLite database file
Returns:
- *models.Queries: A queries instance for database operations
- error: An error if the connection fails, ping fails, or DDL execution fails
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.