0.0.1 • Published 3 years ago

@westarcloud/store v0.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

@westarcloud/store

westar 组件数据存储相关代码

run

  1. Run npm i command
  2. Setup database settings inside ormconfig.json file
  3. Run npm start command

init

import { Component } from "@westarcloud/store";
import type { Queries, Query } from "@westarcloud/store";
const store = new Component(/* westar/module path*/);

method

await store.upsertAllModules()

找到模块目录下所有的 westar-config.json 文件,并读取配置,然后把配置同步到数据库中

await store.upsertOneModule(jsonFileUri)

同步数据库中单个模块的配置数据

await store.deleteOneModule(route)

删除数据库中单个模块的配置数据

await store.getModuleData(route)

获取某个模块在数据库中的数据

await store.find(querys: Queries)