Skip to content

Commit 9c0e7ed

Browse files
committed
export indexing types to another file
1 parent 11d0049 commit 9c0e7ed

File tree

2 files changed

+26
-23
lines changed

2 files changed

+26
-23
lines changed

libs/velo-external-db-types/src/index.ts

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import * as indexing from './indexing-types'
2+
13
export enum AdapterOperator { //in velo-external-db-core
24
eq = 'eq',
35
gt = 'gt',
@@ -152,12 +154,6 @@ export interface ISchemaProvider {
152154
translateDbTypes?(column: InputField | ResponseField | string): ResponseField | string
153155
}
154156

155-
export interface IIndexProvider {
156-
list(collectionName: string): Promise<DomainIndex[]>
157-
create(collectionName: string, index: DomainIndex): Promise<DomainIndex>
158-
remove(collectionName: string, indexName: string): Promise<void>
159-
}
160-
161157
export interface IBaseHttpError extends Error {
162158
status: number;
163159
}
@@ -178,7 +174,7 @@ export type ConnectionCleanUp = () => Promise<void> | void
178174
export type DbProviders<T> = {
179175
dataProvider: IDataProvider
180176
schemaProvider: ISchemaProvider
181-
indexProvider?: IIndexProvider
177+
indexProvider?: indexing.IIndexProvider
182178
databaseOperations: IDatabaseOperations
183179
connection: T
184180
cleanup: ConnectionCleanUp
@@ -255,19 +251,4 @@ export interface IImplementationResources {
255251
name: string
256252
}
257253

258-
259-
export interface DomainIndex {
260-
name: string
261-
columns: string[]
262-
isUnique: boolean
263-
caseInsensitive: boolean
264-
order : 'ASC' | 'DESC'
265-
status?: DomainIndexStatus
266-
error?: any
267-
}
268-
269-
export enum DomainIndexStatus {
270-
ACTIVE = 'ACTIVE',
271-
BUILDING = 'BUILDING',
272-
FAILED = 'FAILED'
273-
}
254+
export * from './indexing-types'
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
export interface IIndexProvider {
2+
list(collectionName: string): Promise<DomainIndex[]>
3+
create(collectionName: string, index: DomainIndex): Promise<DomainIndex>
4+
remove(collectionName: string, indexName: string): Promise<void>
5+
}
6+
7+
8+
export interface DomainIndex {
9+
name: string
10+
columns: string[]
11+
isUnique: boolean
12+
caseInsensitive: boolean
13+
order : 'ASC' | 'DESC'
14+
status?: DomainIndexStatus
15+
error?: any
16+
}
17+
18+
export enum DomainIndexStatus {
19+
ACTIVE = 'ACTIVE',
20+
BUILDING = 'BUILDING',
21+
FAILED = 'FAILED'
22+
}

0 commit comments

Comments
 (0)