alasql

transaction on indexeddb and alasql


I've tried to use transactions with an indexeddb. I've got the following error :

l.engines[l.databases[l.useid].engineid].begin is not a function

Do I miss something or is transaction not supported for indexeddb ? Here is my code :

public static executeTransaction(query: string) {
    const queriesAttach = [
      'ATTACH INDEXEDDB DATABASE ' + SCHEMA_NAME,
      'USE ' + SCHEMA_NAME
    ];


    return new Observable((subscriber) => {
      alasql.promise(queriesAttach)
        .then(() => alasql.promise('BEGIN TRANSACTION'))
        .then(() => alasql.promise(query))
        .then(() => alasql.promise('END TRANSACTION'))
        .then((res) => subscriber.next(res))
        .catch((error) => console.error(error));
    });
  }


Solution

  • An issue as been created there => https://github.com/AlaSQL/alasql/issues/1969