File tree Expand file tree Collapse file tree 31 files changed +156
-150
lines changed Expand file tree Collapse file tree 31 files changed +156
-150
lines changed Original file line number Diff line number Diff line change 1
- import {
1
+ import type {
2
2
Agency ,
3
3
QueryOptions ,
4
4
SqlOrderBy ,
5
- SqlSelect ,
5
+ QueryResult ,
6
6
SqlWhere ,
7
7
} from '../../types/global_interfaces.ts' ;
8
8
import { openDb } from '../db.ts' ;
@@ -15,9 +15,9 @@ import {
15
15
/*
16
16
* Returns an array of all agencies that match the query parameters.
17
17
*/
18
- export function getAgencies (
18
+ export function getAgencies < Fields extends keyof Agency > (
19
19
query : SqlWhere = { } ,
20
- fields : SqlSelect = [ ] ,
20
+ fields : Fields [ ] = [ ] ,
21
21
orderBy : SqlOrderBy = [ ] ,
22
22
options : QueryOptions = { } ,
23
23
) {
@@ -31,5 +31,5 @@ export function getAgencies(
31
31
. prepare (
32
32
`${ selectClause } FROM ${ tableName } ${ whereClause } ${ orderByClause } ;` ,
33
33
)
34
- . all ( ) as Agency [ ] ;
34
+ . all ( ) as QueryResult < Agency , Fields > [ ] ;
35
35
}
Original file line number Diff line number Diff line change 1
- import {
1
+ import type {
2
2
Area ,
3
3
QueryOptions ,
4
4
SqlOrderBy ,
5
- SqlSelect ,
5
+ QueryResult ,
6
6
SqlWhere ,
7
7
} from '../../types/global_interfaces.ts' ;
8
8
import { openDb } from '../db.ts' ;
@@ -15,9 +15,9 @@ import {
15
15
/*
16
16
* Returns an array of all areas that match the query parameters.
17
17
*/
18
- export function getAreas (
18
+ export function getAreas < Fields extends keyof Area > (
19
19
query : SqlWhere = { } ,
20
- fields : SqlSelect = [ ] ,
20
+ fields : Fields [ ] = [ ] ,
21
21
orderBy : SqlOrderBy = [ ] ,
22
22
options : QueryOptions = { } ,
23
23
) {
@@ -31,5 +31,5 @@ export function getAreas(
31
31
. prepare (
32
32
`${ selectClause } FROM ${ tableName } ${ whereClause } ${ orderByClause } ;` ,
33
33
)
34
- . all ( ) as Area [ ] ;
34
+ . all ( ) as QueryResult < Area , Fields > [ ] ;
35
35
}
Original file line number Diff line number Diff line change 1
- import {
1
+ import type {
2
2
Attribution ,
3
3
QueryOptions ,
4
4
SqlOrderBy ,
5
- SqlSelect ,
5
+ QueryResult ,
6
6
SqlWhere ,
7
7
} from '../../types/global_interfaces.ts' ;
8
8
import { openDb } from '../db.ts' ;
@@ -15,9 +15,9 @@ import {
15
15
/*
16
16
* Returns an array of all attributions that match the query parameters.
17
17
*/
18
- export function getAttributions (
18
+ export function getAttributions < Fields extends keyof Attribution > (
19
19
query : SqlWhere = { } ,
20
- fields : SqlSelect = [ ] ,
20
+ fields : Fields [ ] = [ ] ,
21
21
orderBy : SqlOrderBy = [ ] ,
22
22
options : QueryOptions = { } ,
23
23
) {
@@ -31,5 +31,5 @@ export function getAttributions(
31
31
. prepare (
32
32
`${ selectClause } FROM ${ tableName } ${ whereClause } ${ orderByClause } ;` ,
33
33
)
34
- . all ( ) as Attribution [ ] ;
34
+ . all ( ) as QueryResult < Attribution , Fields > [ ] ;
35
35
}
Original file line number Diff line number Diff line change 1
- import {
1
+ import type {
2
2
BookingRule ,
3
3
QueryOptions ,
4
4
SqlOrderBy ,
5
- SqlSelect ,
5
+ QueryResult ,
6
6
SqlWhere ,
7
7
} from '../../types/global_interfaces.ts' ;
8
8
import { openDb } from '../db.ts' ;
@@ -15,9 +15,9 @@ import {
15
15
/*
16
16
* Returns an array of all booking rules that match the query parameters.
17
17
*/
18
- export function getBookingRules (
18
+ export function getBookingRules < Fields extends keyof BookingRule > (
19
19
query : SqlWhere = { } ,
20
- fields : SqlSelect = [ ] ,
20
+ fields : Fields [ ] = [ ] ,
21
21
orderBy : SqlOrderBy = [ ] ,
22
22
options : QueryOptions = { } ,
23
23
) {
@@ -31,5 +31,5 @@ export function getBookingRules(
31
31
. prepare (
32
32
`${ selectClause } FROM ${ tableName } ${ whereClause } ${ orderByClause } ;` ,
33
33
)
34
- . all ( ) as BookingRule [ ] ;
34
+ . all ( ) as QueryResult < BookingRule , Fields > [ ] ;
35
35
}
Original file line number Diff line number Diff line change 1
- import {
1
+ import type {
2
2
CalendarDate ,
3
3
QueryOptions ,
4
4
SqlOrderBy ,
5
- SqlSelect ,
5
+ QueryResult ,
6
6
SqlWhere ,
7
7
} from '../../types/global_interfaces.ts' ;
8
8
import { openDb } from '../db.ts' ;
@@ -15,9 +15,9 @@ import {
15
15
/*
16
16
* Returns an array of calendarDates that match the query parameters.
17
17
*/
18
- export function getCalendarDates (
18
+ export function getCalendarDates < Fields extends keyof CalendarDate > (
19
19
query : SqlWhere = { } ,
20
- fields : SqlSelect = [ ] ,
20
+ fields : Fields [ ] = [ ] ,
21
21
orderBy : SqlOrderBy = [ ] ,
22
22
options : QueryOptions = { } ,
23
23
) {
@@ -31,5 +31,5 @@ export function getCalendarDates(
31
31
. prepare (
32
32
`${ selectClause } FROM ${ tableName } ${ whereClause } ${ orderByClause } ;` ,
33
33
)
34
- . all ( ) as CalendarDate [ ] ;
34
+ . all ( ) as QueryResult < CalendarDate , Fields > [ ] ;
35
35
}
Original file line number Diff line number Diff line change 1
- import {
1
+ import type {
2
2
Calendar ,
3
3
QueryOptions ,
4
4
SqlOrderBy ,
5
- SqlSelect ,
5
+ QueryResult ,
6
6
SqlWhere ,
7
7
} from '../../types/global_interfaces.ts' ;
8
8
import { openDb } from '../db.ts' ;
@@ -16,9 +16,9 @@ import {
16
16
/*
17
17
* Returns an array of calendars that match the query parameters.
18
18
*/
19
- export function getCalendars (
19
+ export function getCalendars < Fields extends keyof Calendar > (
20
20
query : SqlWhere = { } ,
21
- fields : SqlSelect = [ ] ,
21
+ fields : Fields [ ] = [ ] ,
22
22
orderBy : SqlOrderBy = [ ] ,
23
23
options : QueryOptions = { } ,
24
24
) {
@@ -32,7 +32,7 @@ export function getCalendars(
32
32
. prepare (
33
33
`${ selectClause } FROM ${ tableName } ${ whereClause } ${ orderByClause } ;` ,
34
34
)
35
- . all ( ) as Calendar [ ] ;
35
+ . all ( ) as QueryResult < Calendar , Fields > [ ] ;
36
36
}
37
37
38
38
/*
Original file line number Diff line number Diff line change 1
- import {
1
+ import type {
2
2
FareAttribute ,
3
3
QueryOptions ,
4
4
SqlOrderBy ,
5
- SqlSelect ,
5
+ QueryResult ,
6
6
SqlWhere ,
7
7
} from '../../types/global_interfaces.ts' ;
8
8
import { openDb } from '../db.ts' ;
@@ -15,9 +15,9 @@ import {
15
15
/*
16
16
* Returns an array of all fare attributes that match the query parameters.
17
17
*/
18
- export function getFareAttributes (
18
+ export function getFareAttributes < Fields extends keyof FareAttribute > (
19
19
query : SqlWhere = { } ,
20
- fields : SqlSelect = [ ] ,
20
+ fields : Fields [ ] = [ ] ,
21
21
orderBy : SqlOrderBy = [ ] ,
22
22
options : QueryOptions = { } ,
23
23
) {
@@ -31,5 +31,5 @@ export function getFareAttributes(
31
31
. prepare (
32
32
`${ selectClause } FROM ${ tableName } ${ whereClause } ${ orderByClause } ;` ,
33
33
)
34
- . all ( ) as FareAttribute [ ] ;
34
+ . all ( ) as QueryResult < FareAttribute , Fields > [ ] ;
35
35
}
Original file line number Diff line number Diff line change 1
- import {
1
+ import type {
2
2
FareLegRule ,
3
3
QueryOptions ,
4
4
SqlOrderBy ,
5
- SqlSelect ,
5
+ QueryResult ,
6
6
SqlWhere ,
7
7
} from '../../types/global_interfaces.ts' ;
8
8
import { openDb } from '../db.ts' ;
@@ -15,9 +15,9 @@ import {
15
15
/*
16
16
* Returns an array of all fare leg rules that match the query parameters.
17
17
*/
18
- export function getFareLegRules (
18
+ export function getFareLegRules < Fields extends keyof FareLegRule > (
19
19
query : SqlWhere = { } ,
20
- fields : SqlSelect = [ ] ,
20
+ fields : Fields [ ] = [ ] ,
21
21
orderBy : SqlOrderBy = [ ] ,
22
22
options : QueryOptions = { } ,
23
23
) {
@@ -31,5 +31,5 @@ export function getFareLegRules(
31
31
. prepare (
32
32
`${ selectClause } FROM ${ tableName } ${ whereClause } ${ orderByClause } ;` ,
33
33
)
34
- . all ( ) as FareLegRule [ ] ;
34
+ . all ( ) as QueryResult < FareLegRule , Fields > [ ] ;
35
35
}
Original file line number Diff line number Diff line change 1
- import {
1
+ import type {
2
2
FareMedia ,
3
3
QueryOptions ,
4
4
SqlOrderBy ,
5
- SqlSelect ,
5
+ QueryResult ,
6
6
SqlWhere ,
7
7
} from '../../types/global_interfaces.ts' ;
8
8
import { openDb } from '../db.ts' ;
@@ -15,9 +15,9 @@ import {
15
15
/*
16
16
* Returns an array of all fare media that match the query parameters.
17
17
*/
18
- export function getFareMedia (
18
+ export function getFareMedia < Fields extends keyof FareMedia > (
19
19
query : SqlWhere = { } ,
20
- fields : SqlSelect = [ ] ,
20
+ fields : Fields [ ] = [ ] ,
21
21
orderBy : SqlOrderBy = [ ] ,
22
22
options : QueryOptions = { } ,
23
23
) {
@@ -31,5 +31,5 @@ export function getFareMedia(
31
31
. prepare (
32
32
`${ selectClause } FROM ${ tableName } ${ whereClause } ${ orderByClause } ;` ,
33
33
)
34
- . all ( ) as FareMedia [ ] ;
34
+ . all ( ) as QueryResult < FareMedia , Fields > [ ] ;
35
35
}
Original file line number Diff line number Diff line change 1
- import {
1
+ import type {
2
2
FareProduct ,
3
3
QueryOptions ,
4
4
SqlOrderBy ,
5
- SqlSelect ,
5
+ QueryResult ,
6
6
SqlWhere ,
7
7
} from '../../types/global_interfaces.ts' ;
8
8
import { openDb } from '../db.ts' ;
@@ -15,9 +15,9 @@ import {
15
15
/*
16
16
* Returns an array of all fare products that match the query parameters.
17
17
*/
18
- export function getFareProducts (
18
+ export function getFareProducts < Fields extends keyof FareProduct > (
19
19
query : SqlWhere = { } ,
20
- fields : SqlSelect = [ ] ,
20
+ fields : Fields [ ] = [ ] ,
21
21
orderBy : SqlOrderBy = [ ] ,
22
22
options : QueryOptions = { } ,
23
23
) {
@@ -31,5 +31,5 @@ export function getFareProducts(
31
31
. prepare (
32
32
`${ selectClause } FROM ${ tableName } ${ whereClause } ${ orderByClause } ;` ,
33
33
)
34
- . all ( ) as FareProduct [ ] ;
34
+ . all ( ) as QueryResult < FareProduct , Fields > [ ] ;
35
35
}
Original file line number Diff line number Diff line change 1
- import {
1
+ import type {
2
2
FareRule ,
3
3
QueryOptions ,
4
4
SqlOrderBy ,
5
- SqlSelect ,
5
+ QueryResult ,
6
6
SqlWhere ,
7
7
} from '../../types/global_interfaces.ts' ;
8
8
import { openDb } from '../db.ts' ;
@@ -15,9 +15,9 @@ import {
15
15
/*
16
16
* Returns an array of all fare rules that match the query parameters.
17
17
*/
18
- export function getFareRules (
18
+ export function getFareRules < Fields extends keyof FareRule > (
19
19
query : SqlWhere = { } ,
20
- fields : SqlSelect = [ ] ,
20
+ fields : Fields [ ] = [ ] ,
21
21
orderBy : SqlOrderBy = [ ] ,
22
22
options : QueryOptions = { } ,
23
23
) {
@@ -31,5 +31,5 @@ export function getFareRules(
31
31
. prepare (
32
32
`${ selectClause } FROM ${ tableName } ${ whereClause } ${ orderByClause } ;` ,
33
33
)
34
- . all ( ) as FareRule [ ] ;
34
+ . all ( ) as QueryResult < FareRule , Fields > [ ] ;
35
35
}
Original file line number Diff line number Diff line change 1
- import {
1
+ import type {
2
2
FareTransferRule ,
3
3
QueryOptions ,
4
4
SqlOrderBy ,
5
- SqlSelect ,
5
+ QueryResult ,
6
6
SqlWhere ,
7
7
} from '../../types/global_interfaces.ts' ;
8
8
import { openDb } from '../db.ts' ;
@@ -15,9 +15,9 @@ import {
15
15
/*
16
16
* Returns an array of all fare transfer rules that match the query parameters.
17
17
*/
18
- export function getFareTransferRules (
18
+ export function getFareTransferRules < Fields extends keyof FareTransferRule > (
19
19
query : SqlWhere = { } ,
20
- fields : SqlSelect = [ ] ,
20
+ fields : Fields [ ] = [ ] ,
21
21
orderBy : SqlOrderBy = [ ] ,
22
22
options : QueryOptions = { } ,
23
23
) {
@@ -31,5 +31,5 @@ export function getFareTransferRules(
31
31
. prepare (
32
32
`${ selectClause } FROM ${ tableName } ${ whereClause } ${ orderByClause } ;` ,
33
33
)
34
- . all ( ) as FareTransferRule [ ] ;
34
+ . all ( ) as QueryResult < FareTransferRule , Fields > [ ] ;
35
35
}
Original file line number Diff line number Diff line change 1
- import {
1
+ import type {
2
2
FeedInfo ,
3
3
QueryOptions ,
4
4
SqlOrderBy ,
5
- SqlSelect ,
5
+ QueryResult ,
6
6
SqlWhere ,
7
7
} from '../../types/global_interfaces.ts' ;
8
8
import { openDb } from '../db.ts' ;
@@ -15,9 +15,9 @@ import {
15
15
/*
16
16
* Returns an array of all feed info that match the query parameters.
17
17
*/
18
- export function getFeedInfo (
18
+ export function getFeedInfo < Fields extends keyof FeedInfo > (
19
19
query : SqlWhere = { } ,
20
- fields : SqlSelect = [ ] ,
20
+ fields : Fields [ ] = [ ] ,
21
21
orderBy : SqlOrderBy = [ ] ,
22
22
options : QueryOptions = { } ,
23
23
) {
@@ -31,5 +31,5 @@ export function getFeedInfo(
31
31
. prepare (
32
32
`${ selectClause } FROM ${ tableName } ${ whereClause } ${ orderByClause } ;` ,
33
33
)
34
- . all ( ) as FeedInfo [ ] ;
34
+ . all ( ) as QueryResult < FeedInfo , Fields > [ ] ;
35
35
}
You can’t perform that action at this time.
0 commit comments