Skip to content

Commit 758d53f

Browse files
committed
chore: pluralize meta objects
1 parent fcdf179 commit 758d53f

10 files changed

+39
-39
lines changed

src/lib/PostgresMeta.ts

+27-27
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
11
import { ClientConfig } from 'pg'
2-
import PostgresMetaColumn from './PostgresMetaColumn'
2+
import PostgresMetaColumns from './PostgresMetaColumns'
33
import PostgresMetaConfig from './PostgresMetaConfig'
4-
import PostgresMetaExtension from './PostgresMetaExtension'
5-
import PostgresMetaFunction from './PostgresMetaFunction'
6-
import PostgresMetaPolicy from './PostgresMetaPolicy'
7-
import PostgresMetaPublication from './PostgresMetaPublication'
8-
import PostgresMetaRole from './PostgresMetaRole'
9-
import PostgresMetaSchema from './PostgresMetaSchema'
10-
import PostgresMetaTable from './PostgresMetaTable'
11-
import PostgresMetaType from './PostgresMetaType'
4+
import PostgresMetaExtensions from './PostgresMetaExtensions'
5+
import PostgresMetaFunctions from './PostgresMetaFunctions'
6+
import PostgresMetaPolicies from './PostgresMetaPolicies'
7+
import PostgresMetaPublications from './PostgresMetaPublications'
8+
import PostgresMetaRoles from './PostgresMetaRoles'
9+
import PostgresMetaSchemas from './PostgresMetaSchemas'
10+
import PostgresMetaTables from './PostgresMetaTables'
11+
import PostgresMetaTypes from './PostgresMetaTypes'
1212
import PostgresMetaVersion from './PostgresMetaVersion'
1313
import { init } from './db'
1414
import { PostgresMetaResult } from './types'
1515

1616
export default class PostgresMeta {
1717
query: (sql: string) => Promise<PostgresMetaResult<any>>
18-
column: PostgresMetaColumn
18+
columns: PostgresMetaColumns
1919
config: PostgresMetaConfig
20-
extension: PostgresMetaExtension
21-
function: PostgresMetaFunction
22-
policy: PostgresMetaPolicy
23-
publication: PostgresMetaPublication
24-
role: PostgresMetaRole
25-
schema: PostgresMetaSchema
26-
table: PostgresMetaTable
27-
type: PostgresMetaType
20+
extensions: PostgresMetaExtensions
21+
functions: PostgresMetaFunctions
22+
policies: PostgresMetaPolicies
23+
publications: PostgresMetaPublications
24+
roles: PostgresMetaRoles
25+
schemas: PostgresMetaSchemas
26+
tables: PostgresMetaTables
27+
types: PostgresMetaTypes
2828
version: PostgresMetaVersion
2929

3030
constructor(config: ClientConfig) {
3131
this.query = init(config)
32-
this.column = new PostgresMetaColumn(this.query)
32+
this.columns = new PostgresMetaColumns(this.query)
3333
this.config = new PostgresMetaConfig(this.query)
34-
this.extension = new PostgresMetaExtension(this.query)
35-
this.function = new PostgresMetaFunction(this.query)
36-
this.policy = new PostgresMetaPolicy(this.query)
37-
this.publication = new PostgresMetaPublication(this.query)
38-
this.role = new PostgresMetaRole(this.query)
39-
this.schema = new PostgresMetaSchema(this.query)
40-
this.table = new PostgresMetaTable(this.query)
41-
this.type = new PostgresMetaType(this.query)
34+
this.extensions = new PostgresMetaExtensions(this.query)
35+
this.functions = new PostgresMetaFunctions(this.query)
36+
this.policies = new PostgresMetaPolicies(this.query)
37+
this.publications = new PostgresMetaPublications(this.query)
38+
this.roles = new PostgresMetaRoles(this.query)
39+
this.schemas = new PostgresMetaSchemas(this.query)
40+
this.tables = new PostgresMetaTables(this.query)
41+
this.types = new PostgresMetaTypes(this.query)
4242
this.version = new PostgresMetaVersion(this.query)
4343
}
4444
}

src/lib/PostgresMetaColumn.ts renamed to src/lib/PostgresMetaColumns.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import { ident, literal } from 'pg-format'
2-
import PostgresMetaTable from './PostgresMetaTable'
2+
import PostgresMetaTables from './PostgresMetaTables'
33
import { DEFAULT_SYSTEM_SCHEMAS } from './constants'
44
import { columnsSql } from './sql'
55
import { PostgresMetaResult, PostgresColumn } from './types'
66

7-
export default class PostgresMetaColumn {
7+
export default class PostgresMetaColumns {
88
query: (sql: string) => Promise<PostgresMetaResult<any>>
9-
metaTable: PostgresMetaTable
9+
metaTable: PostgresMetaTables
1010

1111
constructor(query: (sql: string) => Promise<PostgresMetaResult<any>>) {
1212
this.query = query
13-
this.metaTable = new PostgresMetaTable(query)
13+
this.metaTable = new PostgresMetaTables(query)
1414
}
1515

1616
async list({ includeSystemSchemas = false } = {}): Promise<PostgresMetaResult<PostgresColumn[]>> {

src/lib/PostgresMetaExtension.ts renamed to src/lib/PostgresMetaExtensions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ident, literal } from 'pg-format'
22
import { extensionsSql } from './sql'
33
import { PostgresMetaResult, PostgresExtension } from './types'
44

5-
export default class PostgresMetaExtension {
5+
export default class PostgresMetaExtensions {
66
query: (sql: string) => Promise<PostgresMetaResult<any>>
77

88
constructor(query: (sql: string) => Promise<PostgresMetaResult<any>>) {

src/lib/PostgresMetaFunction.ts renamed to src/lib/PostgresMetaFunctions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { DEFAULT_SYSTEM_SCHEMAS } from './constants'
33
import { functionsSql } from './sql'
44
import { PostgresMetaResult, PostgresFunction } from './types'
55

6-
export default class PostgresMetaFunction {
6+
export default class PostgresMetaFunctions {
77
query: (sql: string) => Promise<PostgresMetaResult<any>>
88

99
constructor(query: (sql: string) => Promise<PostgresMetaResult<any>>) {

src/lib/PostgresMetaPolicy.ts renamed to src/lib/PostgresMetaPolicies.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { DEFAULT_SYSTEM_SCHEMAS } from './constants'
33
import { policiesSql } from './sql'
44
import { PostgresMetaResult, PostgresPolicy } from './types'
55

6-
export default class PostgresMetaPolicy {
6+
export default class PostgresMetaPolicies {
77
query: (sql: string) => Promise<PostgresMetaResult<any>>
88

99
constructor(query: (sql: string) => Promise<PostgresMetaResult<any>>) {

src/lib/PostgresMetaPublication.ts renamed to src/lib/PostgresMetaPublications.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ident, literal } from 'pg-format'
22
import { publicationsSql } from './sql'
33
import { PostgresMetaResult, PostgresPublication } from './types'
44

5-
export default class PostgresMetaPublication {
5+
export default class PostgresMetaPublications {
66
query: (sql: string) => Promise<PostgresMetaResult<any>>
77

88
constructor(query: (sql: string) => Promise<PostgresMetaResult<any>>) {

src/lib/PostgresMetaRole.ts renamed to src/lib/PostgresMetaRoles.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { coalesceRowsToArray } from './helpers'
44
import { grantsSql, rolesSql } from './sql'
55
import { PostgresMetaResult, PostgresRole } from './types'
66

7-
export default class PostgresMetaRole {
7+
export default class PostgresMetaRoles {
88
query: (sql: string) => Promise<PostgresMetaResult<any>>
99

1010
constructor(query: (sql: string) => Promise<PostgresMetaResult<any>>) {

src/lib/PostgresMetaSchema.ts renamed to src/lib/PostgresMetaSchemas.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { DEFAULT_SYSTEM_SCHEMAS } from './constants'
33
import { schemasSql } from './sql'
44
import { PostgresMetaResult, PostgresSchema } from './types'
55

6-
export default class PostgresMetaSchema {
6+
export default class PostgresMetaSchemas {
77
query: (sql: string) => Promise<PostgresMetaResult<any>>
88

99
constructor(query: (sql: string) => Promise<PostgresMetaResult<any>>) {

src/lib/PostgresMetaTable.ts renamed to src/lib/PostgresMetaTables.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
} from './sql'
1212
import { PostgresMetaResult, PostgresTable } from './types'
1313

14-
export default class PostgresMetaTable {
14+
export default class PostgresMetaTables {
1515
query: (sql: string) => Promise<PostgresMetaResult<any>>
1616

1717
constructor(query: (sql: string) => Promise<PostgresMetaResult<any>>) {

src/lib/PostgresMetaType.ts renamed to src/lib/PostgresMetaTypes.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { DEFAULT_SYSTEM_SCHEMAS } from './constants'
33
import { typesSql } from './sql'
44
import { PostgresMetaResult, PostgresType } from './types'
55

6-
export default class PostgresMetaType {
6+
export default class PostgresMetaTypes {
77
query: (sql: string) => Promise<PostgresMetaResult<any>>
88

99
constructor(query: (sql: string) => Promise<PostgresMetaResult<any>>) {

0 commit comments

Comments
 (0)