@c4a/extract-sql 0.0.0-bootstrap.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/LICENSE +21 -0
- package/README.md +7 -0
- package/README.zh-CN.md +7 -0
- package/index.js +31334 -0
- package/package.json +25 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 context4ai
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# @c4a/extract-sql
|
|
2
|
+
|
|
3
|
+
Dialect-bound lightweight SQL evidence adapter for Context. It uses [`node-sql-parser`](https://github.com/taozhi8833998/node-sql-parser) for AST and visited-table analysis, but requires the caller to declare a dialect for every registered `.sql` file.
|
|
4
|
+
|
|
5
|
+
The first supported dialects are `mysql`, `postgresql`, and `sqlite`. There is no implicit MySQL or generic fallback. Missing, unknown, syntactically invalid, or unsupported statements make the file unsupported and prevent partial Evidence facts.
|
|
6
|
+
|
|
7
|
+
The catalog contains statement type/category/digest/locator, table/view/index read/write/DDL evidence, and path-convention migration candidates. SQL text and literal values are never serialized in Evidence. All facts use `lightweight-evidence` and denominator `none`; the package does not claim database ownership or online schema state.
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# @c4a/extract-sql
|
|
2
|
+
|
|
3
|
+
面向 Context 的显式方言 SQL 轻量 evidence adapter。它使用 [`node-sql-parser`](https://github.com/taozhi8833998/node-sql-parser) 生成 AST 和 visited-table 信息,但要求调用方为每个已登记 `.sql` 文件声明 dialect。
|
|
4
|
+
|
|
5
|
+
首批支持 `mysql`、`postgresql`、`sqlite`,不提供隐式 MySQL 或所谓 generic fallback。dialect 缺失、未知、语法失败或 statement 类型不支持时,整文件成为 `unsupported`,且不发布部分 Evidence facts。
|
|
6
|
+
|
|
7
|
+
catalog 包含 statement 类型/category/digest/locator、table/view/index 的 read/write/DDL evidence,以及基于路径约定的 migration candidate。SQL 正文和 literal value 不进入 Evidence。全部 facts 使用 `lightweight-evidence` 且 denominator 为 `none`;该包不声明数据 owner 或线上 schema 状态。
|