Skip to content

Commit 8d74625

Browse files
committed
export indexing types to another file
1 parent a2a135c commit 8d74625

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',
@@ -153,12 +155,6 @@ export interface ISchemaProvider {
153155
translateDbTypes?(column: InputField | ResponseField | string): ResponseField | string
154156
}
155157

156-
export interface IIndexProvider {
157-
list(collectionName: string): Promise<DomainIndex[]>
158-
create(collectionName: string, index: DomainIndex): Promise<DomainIndex>
159-
remove(collectionName: string, indexName: string): Promise<void>
160-
}
161-
162158
export interface IBaseHttpError extends Error {
163159
status: number;
164160
}
@@ -179,7 +175,7 @@ export type ConnectionCleanUp = () => Promise<void> | void
179175
export type DbProviders<T> = {
180176
dataProvider: IDataProvider
181177
schemaProvider: ISchemaProvider
182-
indexProvider?: IIndexProvider
178+
indexProvider?: indexing.IIndexProvider
183179
databaseOperations: IDatabaseOperations
184180
connection: T
185181
cleanup: ConnectionCleanUp
@@ -256,19 +252,4 @@ export interface IImplementationResources {
256252
name: string
257253
}
258254

259-
260-
export interface DomainIndex {
261-
name: string
262-
columns: string[]
263-
isUnique: boolean
264-
caseInsensitive: boolean
265-
order : 'ASC' | 'DESC'
266-
status?: DomainIndexStatus
267-
error?: any
268-
}
269-
270-
export enum DomainIndexStatus {
271-
ACTIVE = 'ACTIVE',
272-
BUILDING = 'BUILDING',
273-
FAILED = 'FAILED'
274-
}
255+
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)