@rljson/io-sqlite 0.0.11 → 0.0.17

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.
@@ -0,0 +1,40 @@
1
+ import { JsonValueType } from '@rljson/json';
2
+ import { ColumnCfg, TableCfg, TableKey } from '@rljson/rljson';
3
+ export declare class SqlStatements {
4
+ private _map;
5
+ /**
6
+ * Converts a JSON value type to an SQLite data type.
7
+ * @param dataType - The JSON value type to convert.
8
+ * @returns - The corresponding SQLite data type.
9
+ */
10
+ jsonToSqlType(dataType: JsonValueType): string;
11
+ get tableKey(): string;
12
+ get tableKeys(): string;
13
+ rowCount(tableKey: string): string;
14
+ allData(tableKey: string, namedColumns?: string): string;
15
+ get tableCfg(): string;
16
+ get tableCfgs(): string;
17
+ get currentTableCfg(): string;
18
+ get currentTableCfgs(): string;
19
+ get articleExists(): string;
20
+ get catalogExists(): string;
21
+ contentType(): string;
22
+ insertTableCfg(): string;
23
+ tableExists(): string;
24
+ get tableType(): string;
25
+ columnKeys(tableKey: string): string;
26
+ createFullTable(tableKey: string, columnsDefinition: string, foreignKeys: string): string;
27
+ dropTable(tableKey: string): string;
28
+ createTempTable(tableKey: string): string;
29
+ dropTempTable(tableKey: string): string;
30
+ fillTable(tableKey: string, commonColumns: string): string;
31
+ deleteFromTable(tableKey: string, winNumber: string): string;
32
+ addColumn(tableKey: string, columnName: string, columnType: string): string;
33
+ selection(tableKey: string, columns: string, whereClause: string): string;
34
+ articleSetsRefs(winNumber: string): string;
35
+ currentCount(tableKey: string): string;
36
+ createTable(tableCfg: TableCfg): string;
37
+ alterTable(tableKey: TableKey, addedColumns: ColumnCfg[]): string[];
38
+ get createTableCfgsTable(): string;
39
+ get tableTypeCheck(): string;
40
+ }
@@ -1,7 +1,26 @@
1
- // @license
2
- // Copyright (c) 2025 Rljson
3
- //
4
- // Use of this source code is governed by terms that can be
5
- // found in the LICENSE file in the root of this package.
6
-
7
- export const example = () => {};
1
+ // @license
2
+ // Copyright (c) 2025 Rljson
3
+ //
4
+ // Use of this source code is governed by terms that can be
5
+ // found in the LICENSE file in the root of this package.
6
+
7
+ import { IoSqlite } from './io-sqlite.ts';
8
+
9
+ export const example = () => {
10
+ // Print methods
11
+ const l = console.log;
12
+ const h1 = (text: string) => l(`${text}`);
13
+ const h2 = (text: string) => l(` ${text.split('\n')}`);
14
+ const p = (text: string) => l(` ${text}`);
15
+
16
+ // Example
17
+ h1('IoSql.example');
18
+ h2('Returns an instance of the io-sqlite.');
19
+ const example = IoSqlite.example();
20
+ p(JSON.stringify(example, null, 2));
21
+ };
22
+
23
+ /*
24
+ // Run via "npx vite-node src/example.ts"
25
+ example();
26
+ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rljson/io-sqlite",
3
- "version": "0.0.11",
3
+ "version": "0.0.17",
4
4
  "description": "IoSql rljson files",
5
5
  "homepage": "https://github.com/rljson/io-sqlite",
6
6
  "bugs": "https://github.com/rljson/io-sqlite/issues",
@@ -19,51 +19,45 @@
19
19
  "dist"
20
20
  ],
21
21
  "type": "module",
22
- "scripts": {
23
- "build": "echo 'Please add esbuild to create builds'",
24
- "test": "pnpm installConformanceTests && pnpx vitest run --coverage && pnpm run lint",
25
- "prebuild": "npm run test",
26
- "prepublishOnly": "npm run build",
27
- "lint": "pnpx eslint",
28
- "updateGoldens": "cross-env UPDATE_GOLDENS=true pnpm test",
29
- "installConformanceTests": "node scripts/install-conformance-tests.js"
30
- },
31
22
  "devDependencies": {
32
23
  "@types/better-sqlite3": "^7.6.13",
33
- "@types/node": "^22.15.19",
34
- "@typescript-eslint/eslint-plugin": "^8.32.1",
35
- "@typescript-eslint/parser": "^8.32.1",
36
- "@vitest/coverage-v8": "^3.1.4",
37
- "cross-env": "^7.0.3",
38
- "eslint": "^9.27.0",
39
- "eslint-plugin-jsdoc": "^50.6.17",
40
- "eslint-plugin-tsdoc": "^0.4.0",
41
- "globals": "^16.1.0",
42
- "jsdoc": "^4.0.4",
43
- "read-pkg": "^9.0.1",
44
- "typescript": "~5.8.3",
45
- "typescript-eslint": "^8.32.1",
46
- "vite": "^6.3.5",
47
- "vite-node": "^3.1.4",
24
+ "@types/node": "^24.10.1",
25
+ "@types/sql.js": "^1.4.9",
26
+ "@typescript-eslint/eslint-plugin": "^8.48.0",
27
+ "@typescript-eslint/parser": "^8.48.0",
28
+ "@vitest/coverage-v8": "^4.0.13",
29
+ "cross-env": "^10.1.0",
30
+ "eslint": "^9.39.1",
31
+ "eslint-plugin-jsdoc": "^61.4.1",
32
+ "eslint-plugin-tsdoc": "^0.5.0",
33
+ "globals": "^16.5.0",
34
+ "jsdoc": "^4.0.5",
35
+ "read-pkg": "^10.0.0",
36
+ "typescript": "~5.9.3",
37
+ "typescript-eslint": "^8.48.0",
38
+ "vite": "^7.2.4",
39
+ "vite-node": "^5.2.0",
48
40
  "vite-plugin-dts": "^4.5.4",
41
+ "vite-plugin-node-polyfills": "^0.24.0",
49
42
  "vite-tsconfig-paths": "^5.1.4",
50
- "vitest": "^3.1.4",
43
+ "vitest": "^4.0.13",
51
44
  "vitest-dom": "^0.1.1"
52
45
  },
53
46
  "dependencies": {
54
- "@rljson/hash": "^0.0.16",
55
- "@rljson/io": "^0.0.38",
47
+ "@rljson/hash": "^0.0.17",
48
+ "@rljson/io": "^0.0.59",
56
49
  "@rljson/is-ready": "^0.0.17",
57
- "@rljson/json": "^0.0.21",
58
- "@rljson/rljson": "^0.0.51",
59
- "better-sqlite3": "^11.10.0"
50
+ "@rljson/json": "^0.0.23",
51
+ "@rljson/rljson": "^0.0.71",
52
+ "path-browserify": "^1.0.1",
53
+ "sql.js": "^1.13.0"
60
54
  },
61
- "pnpm": {
62
- "onlyBuiltDependencies": [
63
- "better-sqlite3",
64
- "esbuild"
65
- ],
66
- "overrides": {}
67
- },
68
- "packageManager": "pnpm@10.11.0"
69
- }
55
+ "scripts": {
56
+ "build": "pnpm vite build && tsc && node scripts/copy-readme-to-dist.js && node scripts/copy-file.js src/example.ts dist/src",
57
+ "test": "pnpm installConformanceTests && pnpm vitest --coverage --no-file-parallelism --run && pnpm run lint",
58
+ "prebuild": "pnpm run test",
59
+ "lint": "pnpm eslint",
60
+ "updateGoldens": "cross-env UPDATE_GOLDENS=true pnpm test",
61
+ "installConformanceTests": "node scripts/install-conformance-tests.js"
62
+ }
63
+ }