@toiroakr/lines-db 0.9.1 → 0.10.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/CHANGELOG.md +23 -0
- package/bin/cli.mjs +8694 -0
- package/dist/{index.d.ts → index.d.mts} +19 -20
- package/dist/index.d.mts.map +1 -0
- package/dist/{index.js → index.mjs} +16 -26
- package/dist/index.mjs.map +1 -0
- package/package.json +21 -23
- package/src/cli.ts +134 -163
- package/src/database.test.ts +10 -39
- package/src/database.ts +17 -64
- package/src/directory-scanner.test.ts +1 -3
- package/src/directory-scanner.ts +1 -3
- package/src/index.ts +1 -5
- package/src/jsonl-reader.test.ts +1 -3
- package/src/jsonl-reader.ts +1 -4
- package/src/schema-loader.test.ts +4 -12
- package/src/schema-loader.ts +1 -3
- package/src/schema.ts +5 -5
- package/src/type-generator.ts +4 -11
- package/src/types.ts +1 -4
- package/tsconfig.json +1 -0
- package/tsdown.config.ts +9 -5
- package/bin/cli.js +0 -1766
- package/dist/index.cjs +0 -1499
- package/dist/index.d.cts +0 -605
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @toiroakr/lines-db
|
|
2
2
|
|
|
3
|
+
## 0.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 332b239: Drop CJS build and replace tsx with amaro
|
|
8
|
+
|
|
9
|
+
- ESM-only build. Node.js 22.12+ (VSCode 1.118+) required.
|
|
10
|
+
- Replace `tsx` runtime dependency with `amaro` for TypeScript schema file loading.
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- c42865e: Replace commander with politty for the CLI framework. Bundle zod and politty into the CLI binary so they are no longer installed as runtime dependencies for library users.
|
|
15
|
+
|
|
16
|
+
## 0.9.2
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- 9982a21: Update runtime dependencies (`commander` to v14.0.3, `@standard-schema/spec` to v1.1.0, `tsx` to v4.21.0) and refresh devDependencies/tooling (migrate from ESLint/Prettier to Oxlint/Oxfmt, TypeScript v6).
|
|
21
|
+
|
|
3
22
|
## 0.9.1
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -21,6 +40,7 @@
|
|
|
21
40
|
- c408b92: feat: display per-table validation results for directory validation
|
|
22
41
|
|
|
23
42
|
The `validate` command now shows individual results per table when validating a directory, including record counts for successful tables (e.g., `✓ users (3 records)`).
|
|
43
|
+
|
|
24
44
|
- Added `TableValidationResult` type and `tableResults` field to `ValidationResult`
|
|
25
45
|
- Each table result includes `tableName`, `valid`, `rowCount`, `errors`, and `warnings`
|
|
26
46
|
|
|
@@ -37,6 +57,7 @@
|
|
|
37
57
|
- 4597383: feat: support .mts and .cts schema file extensions
|
|
38
58
|
|
|
39
59
|
Schema files are now auto-detected with the following priority: `.schema.ts` > `.schema.mts` > `.schema.cts`. Mixed extensions within a single project are supported.
|
|
60
|
+
|
|
40
61
|
- Added `--output` option to `generate` command for specifying the output file path (e.g., `--output ./data/db.mts`)
|
|
41
62
|
- Import paths are correctly rewritten: `.ts`→`.js`, `.mts`→`.mjs`, `.cts`→`.cjs`
|
|
42
63
|
- New exported utilities: `findSchemaFile`, `isSchemaFile`, `extractTableNameFromSchemaFile`, `rewriteExtensionForImport`, `SCHEMA_EXTENSIONS`
|
|
@@ -78,6 +99,7 @@
|
|
|
78
99
|
- b281dc8: Fix constraint validation in validator to properly detect primary key and unique index violations
|
|
79
100
|
|
|
80
101
|
Previously, the validator was not creating indexes from schema metadata and was missing the default primaryKey behavior, causing constraint violations to go undetected. This fix ensures:
|
|
102
|
+
|
|
81
103
|
- Indexes (both unique and non-unique) are now properly created from schema metadata in the validation database
|
|
82
104
|
- Primary key defaults to 'id' column when not explicitly specified, matching database.ts behavior
|
|
83
105
|
- Constraint violations are properly detected by inserting rows into an in-memory database and catching SQLite exceptions
|
|
@@ -118,6 +140,7 @@
|
|
|
118
140
|
- 49089e1: fix: skip validation with warning instead of error when schema file is not found
|
|
119
141
|
|
|
120
142
|
When validating a directory containing JSONL files, if a schema file is missing for some tables, the validator will now:
|
|
143
|
+
|
|
121
144
|
- Skip validation for those files with a warning message instead of throwing an error
|
|
122
145
|
- Display warnings in yellow in the CLI output
|
|
123
146
|
- Continue validation for other files that have schema files
|