8000 chore: minor changes · DavraYoung/postgres-meta@7cdfd93 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7cdfd93

Browse files
committed
chore: minor changes
1 parent 9ca63bc commit 7cdfd93

File tree

2 files changed

+32
-30
lines changed

2 files changed

+32
-30
lines changed

src/lib/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import PostgresMeta from './PostgresMeta'
22
export { PostgresMeta }
33
export {
4+
PostgresMetaOk,
5+
PostgresMetaErr,
46
PostgresMetaResult,
57
PostgresColumn,
68
PostgresConfig,
@@ -13,8 +15,8 @@ export {
1315
PostgresRelationship,
1416
PostgresRole,
1517
PostgresSchema,
16-
PostgresSchemaCreate,
17-
PostgresSchemaUpdate,
1818
PostgresTable,
19-
PostgresType
19+
PostgresTrigger,
20+
PostgresType,
21+
PostgresVersion,
2022
} from './types'

src/lib/types.ts

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { Static, Type } from '@sinclair/typebox'
22

3-
interface PostgresMetaOk<T> {
3+
export interface PostgresMetaOk<T> {
44
data: T
55
error: null
66
}
77

8-
interface PostgresMetaErr {
8+
export interface PostgresMetaErr {
99
data: null
1010
error: {
1111
message: string
@@ -150,31 +150,6 @@ export const postgresPublicationSchema = Type.Object({
150150
})
151151
export type PostgresPublication = Static<typeof postgresPublicationSchema>
152152

153-
export const postgresTriggerSchema = Type.Object({
154-
id: Type.Integer(),
155-
enabled_mode: Type.Union([
156-
Type.Literal('ORIGIN'),
157-
Type.Literal('REPLICA'),
158-
Type.Literal('ALWAYS'),
159-
Type.Literal('DISABLED'),
160-
]),
161-
name: Type.String(),
162-
table: Type.String(),
163-
schema: Type.String(),
164-
condition: Type.Union([Type.String(), Type.Null()]),
165-
orientation: Type.Union([Type.Literal('ROW'), Type.Literal('STATEMENT')]),
166-
activation: Type.Union([
167-
Type.Literal('BEFORE'),
168-
Type.Literal('AFTER'),
169-
Type.Literal('INSTEAD OF'),
170-
]),
171-
events: Type.Array(Type.String()),
172-
function_schema: Type.String(),
173-
function_name: Type.String(),
174-
function_args: Type.Array(Type.String()),
175-
})
176-
export type PostgresTrigger = Static<typeof postgresTriggerSchema>
177-
178153
export const postgresRelationshipSchema = Type.Object({
179154
id: Type.Integer(),
180155
constraint_name: Type.String(),
@@ -250,6 +225,31 @@ export const postgresTableSchema = Type.Object({
250225
})
251226
export type PostgresTable = Static<typeof postgresTableSchema>
252227

228+
export const postgresTriggerSchema = Type.Object({
229+
id: Type.Integer(),
230+
enabled_mode: Type.Union([
231+
Type.Literal('ORIGIN'),
232+
Type.Literal('REPLICA'),
233+
Type.Literal('ALWAYS'),
234+
Type.Literal('DISABLED'),
235+
]),
236+
name: Type.String(),
237+
table: Type.String(),
238+
schema: Type.String(),
239+
condition: Type.Union([Type.String(), Type.Null()]),
240+
orientation: Type.Union([Type.Literal('ROW'), Type.Literal('STATEMENT')]),
241+
activation: Type.Union([
242+
Type.Literal('BEFORE'),
243+
Type.Literal('AFTER'),
244+
Type.Literal('INSTEAD OF'),
245+
]),
246+
events: Type.Array(Type.String()),
247+
function_schema: Type.String(),
248+
function_name: Type.String(),
249+
function_args: Type.Array(Type.String()),
250+
})
251+
export type PostgresTrigger = Static<typeof postgresTriggerSchema>
252+
253253
export const postgresTypeSchema = Type.Object({
254254
id: Type.Integer(),
255255
name: Type.String(),

0 commit comments

Comments
 (0)
0