Cannot access to the db property of the instance SQLiteSessionStorage

Cannot access to the db property of the instance SQLiteSessionStorage

WilliamFr
Shopify Partner
1 0 0

I am learning the Shopify app development, but I got a problem when I followed the training course with NodeJS (https://shopify.dev/apps/getting-started/build-app-example/backend)

 

When we want to instanciate the  class SQLiteSessionStorage like that :

 

const dbFile = join(process.cwd(), "database.sqlite");
const sessionDb = new SQLiteSessionStorage(dbFile);
// Initialize SQLite DB
QRCodesDB.db = sessionDb.db;
QRCodesDB.init();

 

 An error is raised because the attribute `.db` of `SQLiteSessionStorage` is private :

 

export declare class SQLiteSessionStorage implements SessionStorage {
    private filename;
    private options;
    private db;
    private ready;
    constructor(filename: string, opts?: Partial<SQLiteSessionStorageOptions>);
    storeSession(session: Session): Promise<boolean>;
    loadSession(id: string): Promise<Session | undefined>;
    deleteSession(id: string): Promise<boolean>;
    deleteSessions(ids: string[]): Promise<boolean>;
    findSessionsByShop(shop: string): Promise<Session[]>;
    private hasSessionTable;
    private init;
    private query;
    private databaseRowToSession;
}

 

 

I don't know how to resolve this issue. Can someone help me ? 

I create an issue in GitHub on the couse repository (https://github.com/Shopify/shopify-app-examples/issues/136)

 

Maybe it's a mistake from me, but I am blocked ... 

 

Thank you very much in advance !

 

Respectfully,

William 🙂 

Replies 0 (0)