@kubun/db-sqlocal 0.9.0 → 0.11.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.
Files changed (2) hide show
  1. package/lib/index.js +32 -1
  2. package/package.json +4 -4
package/lib/index.js CHANGED
@@ -1 +1,32 @@
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(),[]}}
1
+ import { AbstractSQLiteAdapter } from '@kubun/db-adapter';
2
+ import { SQLocalKysely } from 'sqlocal/kysely';
3
+ export class SQLocalAdapter extends AbstractSQLiteAdapter {
4
+ #sqlocal;
5
+ #searchWarned = false;
6
+ constructor(params){
7
+ super();
8
+ this.#sqlocal = new SQLocalKysely(params.database);
9
+ }
10
+ get dialect() {
11
+ return this.#sqlocal.dialect;
12
+ }
13
+ get sqlocal() {
14
+ return this.#sqlocal;
15
+ }
16
+ #warnOnce() {
17
+ if (!this.#searchWarned) {
18
+ console.warn('SQLocalAdapter: full-text search is not supported in browser environments');
19
+ this.#searchWarned = true;
20
+ }
21
+ }
22
+ async createSearchIndex(_db, _config) {
23
+ this.#warnOnce();
24
+ }
25
+ async dropSearchIndex(_db, _modelID) {}
26
+ async updateSearchEntry(_db, _modelID, _documentID, _fields, _fieldNames) {}
27
+ async removeSearchEntry(_db, _modelID, _documentID) {}
28
+ async searchIndex(_db, _params) {
29
+ this.#warnOnce();
30
+ return [];
31
+ }
32
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubun/db-sqlocal",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "license": "see LICENSE.md",
5
5
  "keywords": [],
6
6
  "type": "module",
@@ -16,14 +16,14 @@
16
16
  "sideEffects": false,
17
17
  "dependencies": {
18
18
  "sqlocal": "^0.18.0",
19
- "@kubun/db-adapter": "^0.9.0"
19
+ "@kubun/db-adapter": "^0.11.0"
20
20
  },
21
21
  "devDependencies": {
22
- "kysely": "^0.28.17"
22
+ "kysely": "^0.29.2"
23
23
  },
24
24
  "scripts": {
25
25
  "build:clean": "del lib",
26
- "build:js": "swc src -d ./lib --config-file ../../swc.json --strip-leading-paths",
26
+ "build:js": "swc src -d ./lib --config-file ../../node_modules/@kigu/dev/swc.json --strip-leading-paths",
27
27
  "build:types": "tsc --emitDeclarationOnly --skipLibCheck",
28
28
  "build:types:ci": "tsc --emitDeclarationOnly --declarationMap false --skipLibCheck",
29
29
  "build": "pnpm run build:clean && pnpm run build:js && pnpm run build:types",