palm-sync
    Preparing search index...

    Interface DatabaseStorageInterface

    interface DatabaseStorageInterface {
        createUser(requestedUserName: string): Promise<void>;
        databaseExists(requestedUserName: string, dbName: string): Promise<boolean>;
        getAllDatabases(
            requestedUserName: string,
        ): Promise<(RawPdbDatabase | RawPrcDatabase)[]>;
        getComputerId(): number;
        getDatabasesFromInstallList(
            requestedUserName: string,
        ): Promise<
            { databases: (RawPdbDatabase | RawPrcDatabase)[]; filenames: string[] },
        >;
        readDatabase(
            requestedUserName: string,
            dbName: string,
        ): Promise<RawPdbDatabase | RawPrcDatabase>;
        removeDatabaseFromInstallList(
            requestedUserName: string,
            db: RawPdbDatabase | RawPrcDatabase,
            filename: string,
        ): Promise<void>;
        userExists(requestedUserName: string): Promise<boolean>;
        writeDatabase(
            requestedUserName: string,
            db: RawPdbDatabase | RawPrcDatabase,
        ): Promise<void>;
    }
    Index

    Methods

    • Creates the file system structure to hold database data for the username provided, may also create identification files regarding the specific PDA used.

      Parameters

      • requestedUserName: string

        the username of the PDA

      Returns Promise<void>

    • Returns true if there is a database in the filesystem which matches the supplied database name for the supplied user.

      Parameters

      • requestedUserName: string
      • dbName: string

        the name of the database to retrieve

      Returns Promise<boolean>

    • Returns an array of databases which were previously backed-up for the supplied user.

      Parameters

      • requestedUserName: string

      Returns Promise<(RawPdbDatabase | RawPrcDatabase)[]>

    • Returns an array of databases which should be installed in the PDA for the supplied user.

      Parameters

      • requestedUserName: string

      Returns Promise<{ databases: (RawPdbDatabase | RawPrcDatabase)[]; filenames: string[] }>

    • Read/retrieve a database from the filesystem which was previously written using the writeDatabaseToStorage() or any other method for the supplied user.

      Parameters

      • requestedUserName: string
      • dbName: string

        the name of the database to retrieve

      Returns Promise<RawPdbDatabase | RawPrcDatabase>

    • Removes the provided database from the install list for that user, should be called after installation of said database is done.

      Parameters

      • requestedUserName: string
      • db: RawPdbDatabase | RawPrcDatabase

        the database to be removed

      • filename: string

        the precise filename of the database archive

      Returns Promise<void>

    • Returns true if the requestedUserName was used in the createUsernameInStorage() function in the past and may have data in this computer.

      Parameters

      • requestedUserName: string

        the username of the PDA

      Returns Promise<boolean>

    • Writes the database in the filesystem for persistance for the supplied user.

      Parameters

      • requestedUserName: string
      • db: RawPdbDatabase | RawPrcDatabase

        the database to be written

      Returns Promise<void>