message: Added initial transactions support
diff: @@ -5,7 +5,7 @@ import { FilterBase, DataProviderFactory, DataProvider, ColumnValueProvider, Dat
  import { DataApi, DataApiResponse } from './DataApi';
  -import { Pool, QueryResult } from 'pg';
  +import { Pool, QueryResult, Client } from 'pg';
  import { ActualSQLServerDataProvider, SQLConnectionProvider, SQLCommand, SQLQueryResult } from './SQLDatabaseShared';
  @@ -15,24 +15,54 @@ export class PostgresDataProvider implements DataProviderFactory {
  constructor(private pool: Pool) {
  }
  + provideFor<T extends Entity<any>>(name: string, factory: () => T): DataProvider {
  + return new ActualSQLServerDataProvider(factory, name, new PostgresBridgeToSQLConnection(this.pool), factory);
  + }
  + async doInTransaction(what: (dp: DataProviderFactory) => Promise<void>) {
  + let client = await this.pool.connect();
  + let dp = new PostgresDataTransaction(client);
  + try {
  + await client.query('BEGIN');
  + await what(dp);
  + await client.query('COMMIT');
  + }
  + catch (err) {
  + await client.query('ROLLBACK');
  + throw err;
  + }
  + finally {
  + await client.release();
  + }
  + }
  +}
  +
  +class PostgresDataTransaction implements DataProviderFactory {
  +
  +
  + constructor(private source: PostgresCommandSource) {
  +
  + }
  provideFor<T extends Entity<any>>(name: string, factory: () => T): DataProvider {
  - return new ActualSQLServerDataProvider(factory, name, new PostgresBridgeToSQLConnection(this.pool), factory);
  + return new ActualSQLServerDataProvider(factory, name, new PostgresBridgeToSQLConnection(this.source), factory);
  }
  +}
  +interface PostgresCommandSource {
  + query(queryText: string, values?: any[]): Promise<QueryResult>;
  }
  class PostgresBridgeToSQLConnection implements SQLConnectionProvider {
  - constructor(private pool: Pool) {
  + constructor(private source: PostgresCommandSource) {
  }
  createCommand(): SQLCommand {
  - return new PostgrestBridgeToSQLCommand(this.pool);
  + return new PostgrestBridgeToSQLCommand(this.source);
  }
  }
  class PostgrestBridgeToSQLCommand implements SQLCommand {
  - constructor(private pool: Pool) {
  + constructor(private source: PostgresCommandSource) {
  }
  values: any[] = [];
  @@ -41,7 +71,7 @@ class PostgrestBridgeToSQLCommand implements SQLCommand {
  return '$' + this.values.length;
  }
  query(sql: string): Promise<SQLQueryResult> {
  - return this.pool.query(sql, this.values).then(r => new PostgressBridgeToSQLQueryResult(r));
  + return this.source.query(sql, this.values).then(r => new PostgressBridgeToSQLQueryResult(r));
  }
  }
  class PostgressBridgeToSQLQueryResult implements SQLQueryResult {
  