SqliteGraphRepository<T, U, EF>
Defined in: rxdb-plugin-graph/src/sqlite/SqliteGraphRepository.ts:29
SQLite 图实体仓库 实现基于 SQLite 递归 CTE 的图查询
Extends
Type Parameters
| Type Parameter | Default type |
|---|---|
T extends EntityType | - |
U extends EdgeFilterOptions | EdgeFilterOptionsFull |
EF | EdgeInfoFull |
Implements
IGraphRepository<T,U,EF>
Constructors
Constructor
new SqliteGraphRepository<T, U, EF>(adapter, EntityType): SqliteGraphRepository<T, U, EF>;
Defined in: rxdb-adapter-sqlite/dist/repository/SqliteRepositoryBase.d.ts:10
Parameters
| Parameter | Type |
|---|---|
adapter | RxDBAdapterSqlite |
EntityType | T |
Returns
SqliteGraphRepository<T, U, EF>
Inherited from
Properties
adapter
protected adapter: RxDBAdapterSqlite;
Defined in: rxdb-adapter-sqlite/dist/repository/SqliteRepositoryBase.d.ts:8
Inherited from
metadata
readonly metadata: EntityMetadata;
Defined in: rxdb-adapter-sqlite/dist/repository/SqliteRepositoryBase.d.ts:9
Inherited from
Methods
addEdge()
addEdge(
from,
to,
weight?,
properties?): Promise<void>;
Defined in: rxdb-plugin-graph/src/sqlite/SqliteGraphRepository.ts:226
添加边
Parameters
| Parameter | Type |
|---|---|
from | InstanceType<T> |
to | InstanceType<T> |
weight? | number |
properties? | Record<string, any> |
Returns
Promise<void>
Implementation of
addQueryCache()
addQueryCache(sqliteSuccessResult, forcedUpdate?): InstanceType<T>[];
Defined in: rxdb-adapter-sqlite/dist/repository/SqliteRepositoryBase.d.ts:17
添加缓存
Parameters
| Parameter | Type | Description |
|---|---|---|
sqliteSuccessResult | SqliteSuccessResult | - |
forcedUpdate? | boolean | 强制刷新,在数据有的情况下也会更新数据,在修改数据的情况下需要 |
Returns
InstanceType<T>[]
Inherited from
SqliteRepository.addQueryCache
count()
count(options): Promise<number>;
Defined in: rxdb-adapter-sqlite/dist/repository/SqliteRepository.d.ts:10
查询实体数量
Parameters
| Parameter | Type | Description |
|---|---|---|
options | EntityStaticType<T, "countOptions"> | 查询选项 |
Returns
Promise<number>
Implementation of
Inherited from
countNeighbors()
countNeighbors(options): Promise<number>;
Defined in: rxdb-plugin-graph/src/sqlite/SqliteGraphRepository.ts:114
查询邻居节点数量
Parameters
| Parameter | Type |
|---|---|
options | FindNeighborsOptions<T, any, U> |
Returns
Promise<number>
Implementation of
IGraphRepository.countNeighbors
create()
create(entity): Promise<InstanceType<T>>;
Defined in: rxdb-adapter-sqlite/dist/repository/SqliteRepository.d.ts:11
创建实体
Parameters
| Parameter | Type |
|---|---|
entity | InstanceType<T> |
Returns
Promise<InstanceType<T>>
Implementation of
Inherited from
find()
find(options): Promise<InstanceType<T>[]>;
Defined in: rxdb-adapter-sqlite/dist/repository/SqliteRepository.d.ts:9
查询多个实体
Parameters
| Parameter | Type | Description |
|---|---|---|
options | EntityStaticType<T, "findOptions"> | 查询选项 |
Returns
Promise<InstanceType<T>[]>
Implementation of
Inherited from
findByRowIds()
findByRowIds(rowIds): Promise<InstanceType<T>[]>;
Defined in: rxdb-adapter-sqlite/dist/repository/SqliteRepositoryBase.d.ts:11
Parameters
| Parameter | Type |
|---|---|
rowIds | bigint[] |
Returns
Promise<InstanceType<T>[]>
Inherited from
findNeighbors()
findNeighbors(options): Promise<NeighborResult<T, EF>[]>;
Defined in: rxdb-plugin-graph/src/sqlite/SqliteGraphRepository.ts:40
查询邻居节点
Parameters
| Parameter | Type |
|---|---|
options | FindNeighborsOptions<T, any, U> |
Returns
Promise<NeighborResult<T, EF>[]>
Implementation of
IGraphRepository.findNeighbors
findOne()
findOne(options): Promise<InstanceType<T> | undefined>;
Defined in: rxdb-adapter-sqlite/dist/repository/SqliteRepository.d.ts:8
Parameters
| Parameter | Type |
|---|---|
options | EntityStaticType<T, "findOneOptions"> |
Returns
Promise<InstanceType<T> | undefined>
Inherited from
findPaths()
findPaths(options): Promise<GraphPath<T>[]>;
Defined in: rxdb-plugin-graph/src/sqlite/SqliteGraphRepository.ts:125
查询两个节点之间的所有路径
Parameters
| Parameter | Type |
|---|---|
options | FindPathsOptions<T, any, U> |
Returns
Promise<GraphPath<T>[]>
Implementation of
get()
get(id): Promise<InstanceType<T>>;
Defined in: rxdb-adapter-sqlite/dist/repository/SqliteRepository.d.ts:7
Parameters
| Parameter | Type |
|---|---|
id | EntityStaticType<T, "idType"> |
Returns
Promise<InstanceType<T>>
Inherited from
remove()
remove(entity): Promise<InstanceType<T>>;
Defined in: rxdb-adapter-sqlite/dist/repository/SqliteRepository.d.ts:13
删除实体
Parameters
| Parameter | Type |
|---|---|
entity | InstanceType<T> |
Returns
Promise<InstanceType<T>>
Implementation of
Inherited from
removeEdge()
removeEdge(from, to): Promise<void>;
Defined in: rxdb-plugin-graph/src/sqlite/SqliteGraphRepository.ts:242
移除边
Parameters
| Parameter | Type |
|---|---|
from | InstanceType<T> |
to | InstanceType<T> |
Returns
Promise<void>
Implementation of
update()
update(entity, patch): Promise<InstanceType<T>>;
Defined in: rxdb-adapter-sqlite/dist/repository/SqliteRepository.d.ts:12
更新实体
Parameters
| Parameter | Type |
|---|---|
entity | InstanceType<T> |
patch | Partial<InstanceType<T>> |
Returns
Promise<InstanceType<T>>