Compare commits

...

4 Commits
master ... dev

5 changed files with 9 additions and 1 deletions

View File

@ -12,6 +12,7 @@ export interface IndexConfig {
type?: 'fulltext' | 'btree' | 'hash' | 'spatial'; type?: 'fulltext' | 'btree' | 'hash' | 'spatial';
parser?: 'ngram'; parser?: 'ngram';
tsConfig?: string | string[]; tsConfig?: string | string[];
chineseParser?: string;
} }
export interface Index<SH extends EntityShape> { export interface Index<SH extends EntityShape> {
name: string; name: string;

View File

@ -12,6 +12,7 @@ export interface BBWatcher<ED extends EntityDict & BaseEntityDict, T extends key
actionData: ActionData<ED, T> | (() => Promise<ActionData<ED, T>>); actionData: ActionData<ED, T> | (() => Promise<ActionData<ED, T>>);
singleton?: true; singleton?: true;
lazy?: true; lazy?: true;
exclusive?: true;
} }
export interface WBWatcher<ED extends EntityDict & BaseEntityDict, T extends keyof ED, Cxt extends AsyncContext<ED>> { export interface WBWatcher<ED extends EntityDict & BaseEntityDict, T extends keyof ED, Cxt extends AsyncContext<ED>> {
type?: 'base'; type?: 'base';
@ -23,6 +24,7 @@ export interface WBWatcher<ED extends EntityDict & BaseEntityDict, T extends key
forUpdate?: true; forUpdate?: true;
singleton?: true; singleton?: true;
lazy?: true; lazy?: true;
exclusive?: true;
} }
export interface WBFreeWatcher<ED extends EntityDict & BaseEntityDict, T extends keyof ED, Cxt extends AsyncContext<ED>> { export interface WBFreeWatcher<ED extends EntityDict & BaseEntityDict, T extends keyof ED, Cxt extends AsyncContext<ED>> {
type: 'free'; type: 'free';
@ -34,6 +36,7 @@ export interface WBFreeWatcher<ED extends EntityDict & BaseEntityDict, T extends
forUpdate?: true; forUpdate?: true;
singleton?: true; singleton?: true;
lazy?: true; lazy?: true;
exclusive?: true;
} }
export type Watcher<ED extends EntityDict & BaseEntityDict, T extends keyof ED, Cxt extends AsyncContext<ED>> = BBWatcher<ED, T> | WBWatcher<ED, T, Cxt> | WBFreeWatcher<ED, T, Cxt>; export type Watcher<ED extends EntityDict & BaseEntityDict, T extends keyof ED, Cxt extends AsyncContext<ED>> = BBWatcher<ED, T> | WBWatcher<ED, T, Cxt> | WBFreeWatcher<ED, T, Cxt>;
export {}; export {};

View File

@ -1,6 +1,6 @@
{ {
"name": "oak-domain", "name": "oak-domain",
"version": "5.1.34", "version": "5.1.35",
"author": { "author": {
"name": "XuChang" "name": "XuChang"
}, },

View File

@ -16,6 +16,7 @@ export interface IndexConfig {
type?: 'fulltext'|'btree'|'hash'|'spatial'; type?: 'fulltext'|'btree'|'hash'|'spatial';
parser?: 'ngram'; // MySQL使用paser作为分词器配置 parser?: 'ngram'; // MySQL使用paser作为分词器配置
tsConfig?: string | string[]; // Postgres中可以自己指定一个或者多个 tsConfig?: string | string[]; // Postgres中可以自己指定一个或者多个
chineseParser?: string; // Postgres中使用中文分词器时指定例如'zhparser'
} }
export interface Index<SH extends EntityShape> { export interface Index<SH extends EntityShape> {

View File

@ -15,6 +15,7 @@ export interface BBWatcher<ED extends EntityDict & BaseEntityDict, T extends key
actionData: ActionData<ED, T> | (() => Promise<ActionData<ED, T>>); actionData: ActionData<ED, T> | (() => Promise<ActionData<ED, T>>);
singleton?: true; // 置singleton意味着在集群环境中只有一个进程会去执行 singleton?: true; // 置singleton意味着在集群环境中只有一个进程会去执行
lazy?: true; // 置lazy意味着在启动时不会立即执行而是等到第一次调度时才执行 lazy?: true; // 置lazy意味着在启动时不会立即执行而是等到第一次调度时才执行
exclusive?: true; // 置exclusive意味着在同一实例中不会并发处理同一条数据而是抛出警告
}; };
export interface WBWatcher<ED extends EntityDict & BaseEntityDict, T extends keyof ED, Cxt extends AsyncContext<ED>> { export interface WBWatcher<ED extends EntityDict & BaseEntityDict, T extends keyof ED, Cxt extends AsyncContext<ED>> {
@ -27,6 +28,7 @@ export interface WBWatcher<ED extends EntityDict & BaseEntityDict, T extends key
forUpdate?: true; forUpdate?: true;
singleton?: true; // 置singleton意味着在集群环境中只有一个进程会去执行 singleton?: true; // 置singleton意味着在集群环境中只有一个进程会去执行
lazy?: true; // 置lazy意味着在启动时不会立即执行而是等到第一次调度时才执行 lazy?: true; // 置lazy意味着在启动时不会立即执行而是等到第一次调度时才执行
exclusive?: true; // 置exclusive意味着在同一实例中不会并发处理同一条数据而是抛出警告
}; };
export interface WBFreeWatcher<ED extends EntityDict & BaseEntityDict, T extends keyof ED, Cxt extends AsyncContext<ED>> { export interface WBFreeWatcher<ED extends EntityDict & BaseEntityDict, T extends keyof ED, Cxt extends AsyncContext<ED>> {
@ -39,6 +41,7 @@ export interface WBFreeWatcher<ED extends EntityDict & BaseEntityDict, T extends
forUpdate?: true; forUpdate?: true;
singleton?: true; // 置singleton意味着在集群环境中只有一个进程会去执行 singleton?: true; // 置singleton意味着在集群环境中只有一个进程会去执行
lazy?: true; // 置lazy意味着在启动时不会立即执行而是等到第一次调度时才执行 lazy?: true; // 置lazy意味着在启动时不会立即执行而是等到第一次调度时才执行
exclusive?: true; // 置exclusive意味着在同一实例中不会并发处理同一条数据而是抛出警告
}; };
export type Watcher<ED extends EntityDict & BaseEntityDict, T extends keyof ED, Cxt extends AsyncContext<ED>> = BBWatcher<ED, T> | WBWatcher<ED, T, Cxt> | WBFreeWatcher<ED, T, Cxt>; export type Watcher<ED extends EntityDict & BaseEntityDict, T extends keyof ED, Cxt extends AsyncContext<ED>> = BBWatcher<ED, T> | WBWatcher<ED, T, Cxt> | WBFreeWatcher<ED, T, Cxt>;