getLastEntryNumber_(workspaceId) {
    return new Promise((resolve, reject) => {
      this.db.serialize(() => {
        // Ensure user is in the database, otherwise add it.
        this.db.all(
          `SELECT * from users
            WHERE (EXISTS (SELECT 1 from users WHERE workspaceId == ?));`,
          [workspaceId],
          (err, entries) => {
            if (err) {
              console.error(err.message);
              reject('Failed to get last entry number.');
            } else if (entries.length == 0) {
              this.db.run(
                `INSERT INTO users(workspaceId, lastEntryNumber)
                VALUES(?, -1)`,
                [workspaceId],
              );
            }
          },
        );

        this.db.each(
          `SELECT lastEntryNumber from users WHERE workspaceId = ?;`,
          [workspaceId],
          (err, result) => {
            if (err) {
              console.error(err.message);
              reject('Failed to get last entry number.');
            } else {
              resolve(result.lastEntryNumber);
            }
          },
        );
      });
    });
  }
Get the lastEntryNumber for a given user.
@param {!string} workspaceId The workspaceId of the user.
@returns {!Promise} Promise object with the the numeric ID assigned to an
entry by the user.
@private