Skip to content

Commit 0258f0f

Browse files
committed
chore: add types to query function
1 parent ce94890 commit 0258f0f

13 files changed

+30
-24
lines changed

src/lib/PostgresMeta.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ import PostgresMetaTable from './PostgresMetaTable'
1111
import PostgresMetaType from './PostgresMetaType'
1212
import PostgresMetaVersion from './PostgresMetaVersion'
1313
import { init } from './db'
14+
import { PostgresMetaResult } from './types'
1415

1516
export default class PostgresMeta {
16-
query: Function
17+
query: (sql: string) => Promise<PostgresMetaResult<any>>
1718
column: PostgresMetaColumn
1819
config: PostgresMetaConfig
1920
extension: PostgresMetaExtension

src/lib/PostgresMetaColumn.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import { columnsSql } from './sql'
55
import { PostgresMetaResult, PostgresColumn } from './types'
66

77
export default class PostgresMetaColumn {
8-
query: Function
8+
query: (sql: string) => Promise<PostgresMetaResult<any>>
99
metaTable: PostgresMetaTable
1010

11-
constructor(query: Function) {
11+
constructor(query: (sql: string) => Promise<PostgresMetaResult<any>>) {
1212
this.query = query
1313
this.metaTable = new PostgresMetaTable(query)
1414
}

src/lib/PostgresMetaConfig.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { configSql } from './sql'
22
import { PostgresMetaResult, PostgresConfig } from './types'
33

44
export default class PostgresMetaConfig {
5-
query: Function
5+
query: (sql: string) => Promise<PostgresMetaResult<any>>
66

7-
constructor(query: Function) {
7+
constructor(query: (sql: string) => Promise<PostgresMetaResult<any>>) {
88
this.query = query
99
}
1010

src/lib/PostgresMetaExtension.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { extensionsSql } from './sql'
33
import { PostgresMetaResult, PostgresExtension } from './types'
44

55
export default class PostgresMetaExtension {
6-
query: Function
6+
query: (sql: string) => Promise<PostgresMetaResult<any>>
77

8-
constructor(query: Function) {
8+
constructor(query: (sql: string) => Promise<PostgresMetaResult<any>>) {
99
this.query = query
1010
}
1111

src/lib/PostgresMetaFunction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import { functionsSql } from './sql'
44
import { PostgresMetaResult, PostgresFunction } from './types'
55

66
export default class PostgresMetaFunction {
7-
query: Function
7+
query: (sql: string) => Promise<PostgresMetaResult<any>>
88

9-
constructor(query: Function) {
9+
constructor(query: (sql: string) => Promise<PostgresMetaResult<any>>) {
1010
this.query = query
1111
}
1212

src/lib/PostgresMetaPolicy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import { policiesSql } from './sql'
44
import { PostgresMetaResult, PostgresPolicy } from './types'
55

66
export default class PostgresMetaPolicy {
7-
query: Function
7+
query: (sql: string) => Promise<PostgresMetaResult<any>>
88

9-
constructor(query: Function) {
9+
constructor(query: (sql: string) => Promise<PostgresMetaResult<any>>) {
1010
this.query = query
1111
}
1212

src/lib/PostgresMetaPublication.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { publicationsSql } from './sql'
33
import { PostgresMetaResult, PostgresPublication } from './types'
44

55
export default class PostgresMetaPublication {
6-
query: Function
6+
query: (sql: string) => Promise<PostgresMetaResult<any>>
77

8-
constructor(query: Function) {
8+
constructor(query: (sql: string) => Promise<PostgresMetaResult<any>>) {
99
this.query = query
1010
}
1111

src/lib/PostgresMetaRole.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import { grantsSql, rolesSql } from './sql'
55
import { PostgresMetaResult, PostgresRole } from './types'
66

77
export default class PostgresMetaRole {
8-
query: Function
8+
query: (sql: string) => Promise<PostgresMetaResult<any>>
99

10-
constructor(query: Function) {
10+
constructor(query: (sql: string) => Promise<PostgresMetaResult<any>>) {
1111
this.query = query
1212
}
1313

src/lib/PostgresMetaSchema.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import { schemasSql } from './sql'
44
import { PostgresMetaResult, PostgresSchema } from './types'
55

66
export default class PostgresMetaSchema {
7-
query: Function
7+
query: (sql: string) => Promise<PostgresMetaResult<any>>
88

9-
constructor(query: Function) {
9+
constructor(query: (sql: string) => Promise<PostgresMetaResult<any>>) {
1010
this.query = query
1111
}
1212

src/lib/PostgresMetaTable.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import {
1212
import { PostgresMetaResult, PostgresTable } from './types'
1313

1414
export default class PostgresMetaTable {
15-
query: Function
15+
query: (sql: string) => Promise<PostgresMetaResult<any>>
1616

17-
constructor(query: Function) {
17+
constructor(query: (sql: string) => Promise<PostgresMetaResult<any>>) {
1818
this.query = query
1919
}
2020

0 commit comments

Comments
 (0)