Skip to content

Being able to specify database name to use in the library #8

Description

@findolor

Currently the library works with a hardcoded database name. We need to refactor the code to pass the name into the library so multiple databases can be used with it.

Activity

  1. self-assigned this
    on Aug 29, 2025
  2. added theissue type on Aug 29, 2025
  3. Jatkingmodern commented on Sep 14, 2025

    @Jatkingmodern

    // before
    const DB_NAME = "app_db";
    export function openDB() { return open(DB_NAME); }

    // after
    export function openDB(dbName = "app_db") { return open(dbName); }
    // or for OO API:
    class Lib {
    constructor({ dbName = "app_db" } = {}) { this.dbName = dbName; }
    open() { return open(this.dbName); }
    }
    Contributing above template to refactor code so as to maintain multiple database connectivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions