Opens a connection to the IndexedDB database and creates necessary object stores.
This function implements a singleton pattern to ensure only one database connection
is active at a time. It also handles database version upgrades automatically.
Returns Promise<IDBDatabase>
Promise that resolves to the opened IndexedDB database instance
Throws
If the database cannot be opened or an error occurs
Opens a connection to the IndexedDB database and creates necessary object stores. This function implements a singleton pattern to ensure only one database connection is active at a time. It also handles database version upgrades automatically.