mirror of
https://github.com/hcengineering/platform.git
synced 2026-10-01 05:55:09 +02:00
UBERF-8508: Get rid of Mongo in storage adapter (#6989)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
@@ -14,16 +14,15 @@
|
||||
//
|
||||
|
||||
import {
|
||||
type LowLevelStorage,
|
||||
type Class,
|
||||
type Doc,
|
||||
type DocumentQuery,
|
||||
type DocumentUpdate,
|
||||
type Domain,
|
||||
type FieldIndexConfig,
|
||||
type FindOptions,
|
||||
type FindResult,
|
||||
type Hierarchy,
|
||||
type LowLevelStorage,
|
||||
type MeasureContext,
|
||||
type ModelDb,
|
||||
type Ref,
|
||||
@@ -56,40 +55,6 @@ export interface DomainHelper {
|
||||
) => Promise<void>
|
||||
}
|
||||
|
||||
export interface RawDBAdapterStream<T extends Doc> {
|
||||
next: () => Promise<T[]>
|
||||
close: () => Promise<void>
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface RawDBAdapter {
|
||||
find: <T extends Doc>(
|
||||
ctx: MeasureContext,
|
||||
workspace: WorkspaceId,
|
||||
domain: Domain,
|
||||
query: DocumentQuery<T>,
|
||||
options?: Omit<FindOptions<T>, 'projection' | 'lookup' | 'total'>
|
||||
) => Promise<FindResult<T>>
|
||||
findStream: <T extends Doc>(
|
||||
ctx: MeasureContext,
|
||||
workspace: WorkspaceId,
|
||||
domain: Domain,
|
||||
query: DocumentQuery<T>,
|
||||
options?: Omit<FindOptions<T>, 'projection' | 'lookup' | 'total'>
|
||||
) => Promise<RawDBAdapterStream<T>>
|
||||
upload: <T extends Doc>(ctx: MeasureContext, workspace: WorkspaceId, domain: Domain, docs: T[]) => Promise<void>
|
||||
update: <T extends Doc>(
|
||||
ctx: MeasureContext,
|
||||
workspace: WorkspaceId,
|
||||
domain: Domain,
|
||||
docs: Map<Ref<T>, DocumentUpdate<T>>
|
||||
) => Promise<void>
|
||||
clean: <T extends Doc>(ctx: MeasureContext, workspace: WorkspaceId, domain: Domain, docs: Ref<T>[]) => Promise<void>
|
||||
close: () => Promise<void>
|
||||
}
|
||||
|
||||
export type DbAdapterHandler = (
|
||||
domain: Domain,
|
||||
event: 'add' | 'update' | 'delete' | 'read',
|
||||
@@ -102,7 +67,7 @@ export type DbAdapterHandler = (
|
||||
export interface DbAdapter extends LowLevelStorage {
|
||||
init?: (domains?: string[], excludeDomains?: string[]) => Promise<void>
|
||||
|
||||
helper: () => DomainHelperOperations
|
||||
helper?: () => DomainHelperOperations
|
||||
|
||||
close: () => Promise<void>
|
||||
findAll: <T extends Doc>(
|
||||
|
||||
Reference in New Issue
Block a user