-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
24SevenOffice
committed
Mar 12, 2018
1 parent
3dfa440
commit 3884473
Showing
23 changed files
with
923 additions
and
56 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import * as MsSql from 'mssql'; | ||
import { Query } from 'tfso-repository/lib/repository/db/query'; | ||
import { IRecordSet } from 'tfso-repository/lib/repository/db/recordset'; | ||
export declare enum IsolationLevel { | ||
ReadUncommitted = 0, | ||
ReadCommitted = 1, | ||
RepeatableRead = 2, | ||
Snapshot = 3, | ||
Serializable = 4, | ||
} | ||
export default class Connection { | ||
private _connectionString; | ||
private _connection; | ||
private _transaction; | ||
private _rolledback; | ||
constructor(connectionString: MsSql.config | PromiseLike<MsSql.config>); | ||
close(): Promise<void>; | ||
beginTransaction(isolationLevel?: IsolationLevel): Promise<void>; | ||
commitTransaction(): Promise<void>; | ||
rollbackTransaction(): Promise<void>; | ||
execute<U>(query: Query<U>): Promise<IRecordSet<U>>; | ||
execute<U>(work: (connection: MsSql.ConnectionPool) => IRecordSet<U> | PromiseLike<IRecordSet<U>>): Promise<IRecordSet<U>>; | ||
private getIsolationLevel(isolationLevel); | ||
private delay(ms); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import * as MsSql from 'mssql'; | ||
import { Query } from 'tfso-repository/lib/repository/db/query'; | ||
import { RecordSet } from 'tfso-repository/lib/repository/db/recordset'; | ||
export declare abstract class QueryRecordSet<TEntity> extends Query<TEntity> { | ||
private _connection; | ||
private _transaction; | ||
constructor(connection?: MsSql.ConnectionPool | MsSql.Transaction); | ||
connection: MsSql.Transaction | MsSql.ConnectionPool; | ||
protected readonly readLock: boolean; | ||
protected input(name: string, value: any): void; | ||
protected input(name: string, type: any, value: any): void; | ||
protected createRequest(connection?: MsSql.ConnectionPool): MsSql.Request; | ||
protected createRequest(transaction?: MsSql.Transaction): MsSql.Request; | ||
protected executeQuery(): Promise<RecordSet<TEntity>>; | ||
protected abstract transform(record: any): TEntity; | ||
} | ||
export default QueryRecordSet; | ||
export { RecordSet }; |
Oops, something went wrong.