hediet / ts-typed-sql

A fully typed sql builder. Not maintained anymore, use it for your inspiration.
https://hediet.github.io/ts-typed-sql/
54 stars 4 forks source link

Allow setting transaction isolation level #4

Closed phiresky closed 7 years ago

phiresky commented 7 years ago

Reference: https://www.postgresql.org/docs/9.1/static/transaction-iso.html

hediet commented 7 years ago

You mean by using [SET TRANSACTION](using https://www.postgresql.org/docs/9.1/static/sql-set-transaction.html)?

phiresky commented 7 years ago

Yeah like

BEGIN;
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
SELECT bla;

COMMIT;

2017-06-04 22:14 GMT+02:00 Henning Dieterichs notifications@github.com:

You mean by using SET TRANSACTION?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

phiresky commented 7 years ago

no actually like this

START TRANSACTION ISOLATION LEVEL SERIALIZABLE

2017-06-04 22:18 GMT+02:00 phire skyde phireskyde@gmail.com:

Yeah like

BEGIN;
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
SELECT bla;

COMMIT;

2017-06-04 22:14 GMT+02:00 Henning Dieterichs notifications@github.com:

You mean by using SET TRANSACTION?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

hediet commented 7 years ago

Now, transaction has two overloadings:

dbCon.transaction({ isolationLevel: IsolationLevel.Serializable }, async q => { ... });
dbCon.transaction(async q => { ... });