lagash-dbaccess
dbaccess abstractions for node
Usage:
-
Before any usage, call
RepositoryBase.connect(connection)
with an instance of the db connection. -
To execute queries to the database, extend the RepositoryBase class and use its methods.
Example:
;
To execute queries inside a transaction
; await repo.beginTransaction; ;if entities.length > 0 repo.commitTransaction;
To execute queries from different repositories within the same transaction
;; await repo1.beginTransaction;repo1.joinOtherRepositoryToCurrentTransactionrepo2;;if entities.length > 0 repo1.commitTransaction; // or repo2.commitTransaction()