@kubun/db-sqlocal 0.3.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { AbstractSQLiteAdapter, type Adapter } from '@kubun/db-adapter';
2
- import type { Dialect } from 'kysely';
1
+ import { AbstractSQLiteAdapter, type Adapter, type SearchHit, type SearchIndexConfig, type SearchQuery } from '@kubun/db-adapter';
2
+ import type { Dialect, Kysely } from 'kysely';
3
3
  import { SQLocalKysely } from 'sqlocal/kysely';
4
4
  export type AdapterParams = {
5
5
  database: string;
@@ -9,5 +9,9 @@ export declare class SQLocalAdapter extends AbstractSQLiteAdapter implements Ada
9
9
  constructor(params: AdapterParams);
10
10
  get dialect(): Dialect;
11
11
  get sqlocal(): SQLocalKysely;
12
+ createSearchIndex(_db: Kysely<unknown>, _config: SearchIndexConfig): Promise<void>;
13
+ dropSearchIndex(_db: Kysely<unknown>, _modelID: string): Promise<void>;
14
+ updateSearchEntry(_db: Kysely<unknown>, _modelID: string, _documentID: string, _fields: Record<string, string>, _fieldNames: Array<string>): Promise<void>;
15
+ removeSearchEntry(_db: Kysely<unknown>, _modelID: string, _documentID: string): Promise<void>;
16
+ searchIndex(_db: Kysely<unknown>, _params: SearchQuery): Promise<Array<SearchHit>>;
12
17
  }
13
- //# sourceMappingURL=index.d.ts.map
package/lib/index.js CHANGED
@@ -1,15 +1 @@
1
- import { AbstractSQLiteAdapter } from '@kubun/db-adapter';
2
- import { SQLocalKysely } from 'sqlocal/kysely';
3
- export class SQLocalAdapter extends AbstractSQLiteAdapter {
4
- #sqlocal;
5
- constructor(params){
6
- super();
7
- this.#sqlocal = new SQLocalKysely(params.database);
8
- }
9
- get dialect() {
10
- return this.#sqlocal.dialect;
11
- }
12
- get sqlocal() {
13
- return this.#sqlocal;
14
- }
15
- }
1
+ import{AbstractSQLiteAdapter as e}from"@kubun/db-adapter";import{SQLocalKysely as r}from"sqlocal/kysely";export class SQLocalAdapter extends e{#e;#r=!1;constructor(e){super(),this.#e=new r(e.database)}get dialect(){return this.#e.dialect}get sqlocal(){return this.#e}#a(){this.#r||(console.warn("SQLocalAdapter: full-text search is not supported in browser environments"),this.#r=!0)}async createSearchIndex(e,r){this.#a()}async dropSearchIndex(e,r){}async updateSearchEntry(e,r,a,s,n){}async removeSearchEntry(e,r,a){}async searchIndex(e,r){return this.#a(),[]}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubun/db-sqlocal",
3
- "version": "0.3.1",
3
+ "version": "0.5.0",
4
4
  "license": "see LICENSE.md",
5
5
  "keywords": [],
6
6
  "type": "module",
@@ -15,11 +15,11 @@
15
15
  ],
16
16
  "sideEffects": false,
17
17
  "dependencies": {
18
- "sqlocal": "^0.14.0",
19
- "@kubun/db-adapter": "^0.3.2"
18
+ "sqlocal": "^0.17.0",
19
+ "@kubun/db-adapter": "^0.5.0"
20
20
  },
21
21
  "devDependencies": {
22
- "kysely": "^0.28.2"
22
+ "kysely": "^0.28.11"
23
23
  },
24
24
  "scripts": {
25
25
  "build:clean": "del lib",
@@ -28,7 +28,7 @@
28
28
  "build:types:ci": "tsc --emitDeclarationOnly --declarationMap false",
29
29
  "build": "pnpm run build:clean && pnpm run build:js && pnpm run build:types",
30
30
  "test:types": "tsc --noEmit",
31
- "test:unit": "node --experimental-vm-modules ../../node_modules/jest/bin/jest.js",
31
+ "test:unit": "vitest run",
32
32
  "test": "pnpm run test:types && pnpm run test:unit"
33
33
  }
34
34
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,KAAK,OAAO,EAAE,MAAM,mBAAmB,CAAA;AACvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAE9C,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,qBAAa,cAAe,SAAQ,qBAAsB,YAAW,OAAO;;gBAG9D,MAAM,EAAE,aAAa;IAKjC,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,OAAO,IAAI,aAAa,CAE3B;CACF"}