|
1 |
| -declare module sqlquery { |
2 |
| - export class Query { |
3 |
| - constructor(dialect: string); |
4 |
| - constructor(options: { |
5 |
| - dialect: string; |
6 |
| - }); |
7 |
| - static Text(type: string): TextQuery; |
| 1 | +declare module "sqlquery" { |
| 2 | + module sqlquery { |
| 3 | + export class Query { |
| 4 | + constructor(dialect: string); |
| 5 | + constructor(options: { |
| 6 | + dialect: string; |
| 7 | + }); |
| 8 | + static Text(type: string): TextQuery; |
8 | 9 |
|
9 |
| - static Comparators: string[]; |
10 |
| - static between(a: number, b: number): Comparator; |
11 |
| - static not_between(a: number, b: number): Comparator; |
12 |
| - static like(expression: string): Comparator; |
13 |
| - static eq(value: any): Comparator; |
14 |
| - static ne(value: any): Comparator; |
15 |
| - static gt(value: any): Comparator; |
16 |
| - static gte(value: any): Comparator; |
17 |
| - static lt(value: any): Comparator; |
18 |
| - static lte(value: any): Comparator; |
| 10 | + static Comparators: string[]; |
| 11 | + static between(a: number, b: number): Comparator; |
| 12 | + static not_between(a: number, b: number): Comparator; |
| 13 | + static like(expression: string): Comparator; |
| 14 | + static eq(value: any): Comparator; |
| 15 | + static ne(value: any): Comparator; |
| 16 | + static gt(value: any): Comparator; |
| 17 | + static gte(value: any): Comparator; |
| 18 | + static lt(value: any): Comparator; |
| 19 | + static lte(value: any): Comparator; |
19 | 20 |
|
20 |
| - escapeId(id: string): string; |
21 |
| - escapeId(id: string, table: string): string; |
22 |
| - escapeVal(value: any): string; |
23 |
| - select(): SelectQuery; |
24 |
| - insert(): InsertQuery; |
25 |
| - update(): UpdateQuery; |
26 |
| - remove(): RemoveQuery; |
27 |
| - } |
| 21 | + escapeId(id: string): string; |
| 22 | + escapeId(id: string, table: string): string; |
| 23 | + escapeVal(value: any): string; |
| 24 | + select(): SelectQuery; |
| 25 | + insert(): InsertQuery; |
| 26 | + update(): UpdateQuery; |
| 27 | + remove(): RemoveQuery; |
| 28 | + } |
28 | 29 |
|
29 |
| - export interface Comparator { |
30 |
| - sql_comparator(): string; |
31 |
| - from?: any; |
32 |
| - to?: any; |
33 |
| - expr?: string; |
34 |
| - value?: any; |
35 |
| - } |
| 30 | + export interface Comparator { |
| 31 | + sql_comparator(): string; |
| 32 | + from?: any; |
| 33 | + to?: any; |
| 34 | + expr?: string; |
| 35 | + value?: any; |
| 36 | + } |
36 | 37 |
|
37 |
| - export interface TextQuery { |
38 |
| - data: any; |
39 |
| - type: string; |
40 |
| - } |
| 38 | + export interface TextQuery { |
| 39 | + data: any; |
| 40 | + type: string; |
| 41 | + } |
41 | 42 |
|
42 |
| - export interface SelectQuery { |
43 |
| - select(fields: string): SelectQuery; |
44 |
| - calculateFoundRows: SelectQuery; |
45 |
| - as(alias: string): SelectQuery; |
46 |
| - fun(fun: string, column: string, alias: string): SelectQuery; |
47 |
| - from(table: string, from_id: string, to_id: string): SelectQuery; |
48 |
| - from(table: string, from_id: string, to_table: string, to_id: string): SelectQuery; |
49 |
| - where(...args: any[]): SelectQuery; |
50 |
| - whereExists(table: string, table_link: string, link: string, conditions: { [column: string]: any }): SelectQuery; |
51 |
| - groupBy(...columns: string[]): SelectQuery; |
52 |
| - offset(offset: number): SelectQuery; |
53 |
| - limit(limit: number): SelectQuery; |
54 |
| - order(column: string, direction: string): SelectQuery; |
55 |
| - build(): string; |
56 |
| - } |
| 43 | + export interface SelectQuery { |
| 44 | + select(fields: string): SelectQuery; |
| 45 | + calculateFoundRows: SelectQuery; |
| 46 | + as(alias: string): SelectQuery; |
| 47 | + fun(fun: string, column: string, alias: string): SelectQuery; |
| 48 | + from(table: string, from_id: string, to_id: string): SelectQuery; |
| 49 | + from(table: string, from_id: string, to_table: string, to_id: string): SelectQuery; |
| 50 | + where(...args: any[]): SelectQuery; |
| 51 | + whereExists(table: string, table_link: string, link: string, conditions: { [column: string]: any }): SelectQuery; |
| 52 | + groupBy(...columns: string[]): SelectQuery; |
| 53 | + offset(offset: number): SelectQuery; |
| 54 | + limit(limit: number): SelectQuery; |
| 55 | + order(column: string, direction: string): SelectQuery; |
| 56 | + build(): string; |
| 57 | + } |
57 | 58 |
|
58 |
| - export interface InsertQuery { |
59 |
| - into(table: string): InsertQuery; |
60 |
| - set(values: { [key: string]: any }[]): InsertQuery; |
61 |
| - build(): string; |
62 |
| - } |
| 59 | + export interface InsertQuery { |
| 60 | + into(table: string): InsertQuery; |
| 61 | + set(values: { [key: string]: any }[]): InsertQuery; |
| 62 | + build(): string; |
| 63 | + } |
63 | 64 |
|
64 |
| - export interface UpdateQuery { |
65 |
| - into(table: string): UpdateQuery; |
66 |
| - set(values: { [column: string]: any }): UpdateQuery; |
67 |
| - where(...conditions: { [column: string]: any }[]): UpdateQuery; |
68 |
| - build(): string; |
69 |
| - } |
| 65 | + export interface UpdateQuery { |
| 66 | + into(table: string): UpdateQuery; |
| 67 | + set(values: { [column: string]: any }): UpdateQuery; |
| 68 | + where(...conditions: { [column: string]: any }[]): UpdateQuery; |
| 69 | + build(): string; |
| 70 | + } |
70 | 71 |
|
71 |
| - export interface RemoveQuery { |
72 |
| - from(table: string): RemoveQuery; |
73 |
| - where(...conditions: { [column: string]: any }[]): RemoveQuery; |
74 |
| - build(): string; |
| 72 | + export interface RemoveQuery { |
| 73 | + from(table: string): RemoveQuery; |
| 74 | + where(...conditions: { [column: string]: any }[]): RemoveQuery; |
| 75 | + build(): string; |
| 76 | + } |
75 | 77 | }
|
| 78 | + export = sqlquery; |
76 | 79 | }
|
0 commit comments