본문으로 건너뛰기

추상 클래스: BaseIndex<TKey>

정의 위치: packages/db/src/indexes/base-index.ts:91

모든 인덱스 유형이 확장하는 기본 추상 클래스입니다

확장 대상

타입 매개변수

TKey

TKey extends string | number = string | number

구현

생성자

생성자

new BaseIndex<TKey>(
id,
expression,
name?,
options?): BaseIndex<TKey>;

정의 위치: packages/db/src/indexes/base-index.ts:110

매개변수

id

number

expression

BasicExpression

name?

string

options?

any

반환값

BaseIndex&lt;TKey>

속성

compareOptions

protected compareOptions: CompareOptions;

정의 위치: packages/db/src/indexes/base-index.ts:102


expression

readonly expression: BasicExpression;

정의 위치: packages/db/src/indexes/base-index.ts:96


hasCustomComparator

protected hasCustomComparator: boolean = false;

정의 위치: packages/db/src/indexes/base-index.ts:108

사용자 제공 비교 함수로 생성될 때 서브클래스에서 설정되며, 이 비교 함수의 정렬 순서는 WHERE 평가기의 관계 연산자와 일치하지 않을 수 있습니다.


id

readonly id: number;

정의 위치: packages/db/src/indexes/base-index.ts:94


lastUpdated

protected lastUpdated: Date;

정의 위치: packages/db/src/indexes/base-index.ts:101


lookupCount

protected lookupCount: number = 0;

정의 위치: packages/db/src/indexes/base-index.ts:99


name?

readonly optional name: string;

정의 위치: packages/db/src/indexes/base-index.ts:95


supportedOperations

abstract readonly supportedOperations: Set<"eq" | "gt" | "gte" | "lt" | "lte" | "in" | "like" | "ilike">;

정의 위치: packages/db/src/indexes/base-index.ts:97


totalLookupTime

protected totalLookupTime: number = 0;

정의 위치: packages/db/src/indexes/base-index.ts:100

접근자

indexedKeysSet

가져오기 시그니처

get abstract indexedKeysSet(): Set<TKey>;

정의 위치: packages/db/src/indexes/base-index.ts:155

반환값

Set&lt;TKey>

구현

IndexInterface.indexedKeysSet


keyCount

가져오기 시그니처

get abstract keyCount(): number;

정의 위치: packages/db/src/indexes/base-index.ts:148

반환값

number

구현

IndexInterface.keyCount


orderedEntriesArray

가져오기 시그니처

get abstract orderedEntriesArray(): [any, Set<TKey>][];

정의 위치: packages/db/src/indexes/base-index.ts:153

반환값

[any, Set&lt;TKey>][]

구현

IndexInterface.orderedEntriesArray


orderedEntriesArrayReversed

가져오기 시그니처

get abstract orderedEntriesArrayReversed(): [any, Set<TKey>][];

정의 위치: packages/db/src/indexes/base-index.ts:154

반환값

[any, Set&lt;TKey>][]

구현

IndexInterface.orderedEntriesArrayReversed


supportsRangeOptimization

가져오기 시그니처

get supportsRangeOptimization(): boolean;

정의 위치: packages/db/src/indexes/base-index.ts:163

이 인덱스의 범위 조회(gt/gte/lt/lte)가 일치하는 모든 키를 반환한다고 신뢰할 수 있는지 여부입니다. 범위 순회는 인덱스 순서에 의존하므로, 사용자 지정 비교 함수를 사용하는 인덱스에서는 안전하지 않습니다. 사용자 지정 비교 함수의 순서가 WHERE 평가기의 관계 연산자와 일치하지 않을 수 있기 때문입니다. 호출자는 이 경우 false 전체 스캔으로 대체해야 합니다.

반환값

boolean

구현

IndexInterface.supportsRangeOptimization


valueMapData

가져오기 시그니처

get abstract valueMapData(): Map<any, Set<TKey>>;

정의 위치: packages/db/src/indexes/base-index.ts:156

반환값

Map&lt;any, Set&lt;TKey>>

구현

IndexInterface.valueMapData

메서드

add()

abstract add(key, item): void;

정의 위치: packages/db/src/indexes/base-index.ts:124

매개변수

key

TKey

item

any

반환값

void

구현

IndexInterface.add


build()

abstract build(entries): void;

정의 위치: packages/db/src/indexes/base-index.ts:127

매개변수

entries

Iterable&lt;[TKey, any]>

반환값

void

구현

IndexInterface.build


clear()

abstract clear(): void;

정의 위치: packages/db/src/indexes/base-index.ts:128

반환값

void

구현

IndexInterface.clear


equalityLookup()

abstract equalityLookup(value): Set<TKey>;

정의 위치: packages/db/src/indexes/base-index.ts:149

매개변수

value

any

반환값

Set&lt;TKey>

구현

IndexInterface.equalityLookup


evaluateIndexExpression()

protected evaluateIndexExpression(item): any;

정의 위치: packages/db/src/indexes/base-index.ts:214

매개변수

item

any

반환값

any


getStats()

getStats(): IndexStats;

정의 위치: packages/db/src/indexes/base-index.ts:202

반환값

IndexStats

구현

IndexInterface.getStats


inArrayLookup()

abstract inArrayLookup(values): Set<TKey>;

정의 위치: packages/db/src/indexes/base-index.ts:150

매개변수

values

any[]

반환값

Set&lt;TKey>

구현

IndexInterface.inArrayLookup


initialize()

abstract protected initialize(options?): void;

정의 위치: packages/db/src/indexes/base-index.ts:212

매개변수

options?

any

반환값

void


lookup()

abstract lookup(operation, value): Set<TKey>;

정의 위치: packages/db/src/indexes/base-index.ts:129

매개변수

operation

"eq" | "gt" | "gte" | "lt" | "lte" | "in" | "like" | "ilike"

value

any

반환값

Set&lt;TKey>

구현

IndexInterface.lookup


matchesCompareOptions()

matchesCompareOptions(compareOptions): boolean;

정의 위치: packages/db/src/indexes/base-index.ts:179

비교 옵션이 인덱스의 비교 옵션과 일치하는지 확인합니다. 인덱스는 방향이 다르면 반전할 수 있으므로 방향은 무시됩니다.

매개변수

compareOptions

CompareOptions

반환값

boolean

구현

IndexInterface.matchesCompareOptions


matchesDirection()

matchesDirection(direction): boolean;

정의 위치: packages/db/src/indexes/base-index.ts:198

인덱스가 제공된 방향과 일치하는지 확인합니다.

매개변수

direction

OrderByDirection

반환값

boolean

구현

IndexInterface.matchesDirection


matchesField()

matchesField(fieldPath): boolean;

정의 위치: packages/db/src/indexes/base-index.ts:167

매개변수

fieldPath

string[]

반환값

boolean

구현

IndexInterface.matchesField


rangeQuery()

abstract rangeQuery(options): Set<TKey>;

정의 위치: packages/db/src/indexes/base-index.ts:151

매개변수

options

BTreeRangeQueryOptions

반환값

Set&lt;TKey>

구현

IndexInterface.rangeQuery


rangeQueryReversed()

abstract rangeQueryReversed(options): Set<TKey>;

정의 위치: packages/db/src/indexes/base-index.ts:152

매개변수

options

BTreeRangeQueryOptions

반환값

Set&lt;TKey>

구현

IndexInterface.rangeQueryReversed


remove()

abstract remove(key, item): void;

정의 위치: packages/db/src/indexes/base-index.ts:125

매개변수

key

TKey

item

any

반환값

void

구현

IndexInterface.remove


supports()

supports(operation): boolean;

정의 위치: packages/db/src/indexes/base-index.ts:159

매개변수

operation

"eq" | "gt" | "gte" | "lt" | "lte" | "in" | "like" | "ilike"

반환값

boolean

구현

IndexInterface.supports


take()

abstract take(
n,
from,
filterFn?): TKey[];

정의 위치: packages/db/src/indexes/base-index.ts:130

매개변수

n

number

from

TKey

filterFn?

(key) => boolean

반환값

TKey[]

구현

IndexInterface.take


takeFromStart()

abstract takeFromStart(n, filterFn?): TKey[];

정의 위치: packages/db/src/indexes/base-index.ts:135

매개변수

n

number

filterFn?

(key) => boolean

반환값

TKey[]

구현

IndexInterface.takeFromStart


takeReversed()

abstract takeReversed(
n,
from,
filterFn?): TKey[];

정의 위치: packages/db/src/indexes/base-index.ts:139

매개변수

n

number

from

TKey

filterFn?

(key) => boolean

반환값

TKey[]

구현

IndexInterface.takeReversed


takeReversedFromEnd()

abstract takeReversedFromEnd(n, filterFn?): TKey[];

정의 위치: packages/db/src/indexes/base-index.ts:144

매개변수

n

number

filterFn?

(key) => boolean

반환값

TKey[]

구현

IndexInterface.takeReversedFromEnd


trackLookup()

protected trackLookup(startTime): void;

정의 위치: packages/db/src/indexes/base-index.ts:220

매개변수

startTime

number

반환값

void


update()

abstract update(
key,
oldItem,
newItem): void;

정의 위치: packages/db/src/indexes/base-index.ts:126

매개변수

key

TKey

oldItem

any

newItem

any

반환값

void

구현

IndexInterface.update


updateTimestamp()

protected updateTimestamp(): void;

정의 위치: packages/db/src/indexes/base-index.ts:226

반환값

void