-
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
Showing
2 changed files
with
77 additions
and
18 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,21 +1,54 @@ | ||
import {IQueryResult} from './result'; | ||
import {IConnectionParams} from './params'; | ||
|
||
export interface IPreparedStatement { | ||
name: string | ||
sql: string | ||
values: any[] | ||
} | ||
|
||
export interface IQueryOptions { | ||
|
||
} | ||
|
||
/** | ||
* Client-side connection options. | ||
*/ | ||
export interface IConnectionOptions { | ||
|
||
/** | ||
* Number of milliseconds before timing out query with error. | ||
*/ | ||
queryTimeout?: number; | ||
} | ||
|
||
export class Connection { | ||
constructor(options: IConnectionOptions) { | ||
|
||
} | ||
|
||
async connect(cn: IConnectionParams): Promise<void> { | ||
|
||
} | ||
|
||
/** | ||
* Executes Query. | ||
* Executes Sql. | ||
*/ | ||
async query(query: string, values?: any[], options?: IQueryOptions): Promise<IQueryResult[]> { | ||
async query(sql: string, values?: any[]): Promise<IQueryResult[]> { | ||
return []; | ||
} | ||
|
||
async prepare(ps: IPreparedStatement): Promise<IQueryResult> { | ||
return {command: '', fields: [], rows: []}; | ||
} | ||
|
||
/** | ||
* Releases connection back to the pool. | ||
* Releases the connection: | ||
* | ||
* - physically, if it was created directly. | ||
* - back into the pool, if it came from one. | ||
*/ | ||
release(options: any) { | ||
release() { | ||
|
||
} | ||
} |
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