Documentation
¶
Overview ¶
Package driver provides database connection management for the CarZone application. It handles PostgreSQL database connections using the lib/pq driver and manages connection lifecycle including initialization, retrieval, and cleanup.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseDB ¶
func CloseDB()
CloseDB gracefully closes the database connection pool. This function should be called during application shutdown to ensure all database connections are properly closed and resources are freed. It's typically called using defer in the main function.
func GetDB ¶
GetDB returns the singleton database connection pool instance. This function provides access to the database connection throughout the application. It returns the same *sql.DB instance that was initialized by InitDB().
Returns:
- *sql.DB: The database connection pool instance, or nil if not initialized
Types ¶
This section is empty.