0.0.3 • Published 3 years ago

@westarcloud/db v0.0.3

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

westar-components

westar 组件搜索相关代码

run

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

init

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

method

await db.upsertAllModules()

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

await db.upsertOneModule(jsonFileUri)

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

await db.deleteOneModule(route)

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

await db.getModuleData(route)

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

await db.find(querys: Queries)