MSSQL: extension skeleton, permanent corpora and dependencies #319

Closed
opened 2026-11-10 08:19:23 +00:00 by david · 1 comment
Owner

Summary

Create the extensions/mssql/ skeleton mirroring extensions/postgres/, copy the spike corpora into permanent regression data, and add mssql to the root dependencies. No parser dependency.

Background

Stage 2 of the MSSQL extension (a pi extension with four tools: mssql_query, mssql_query_one, mssql_list_tables, mssql_table_schema). The Stage 1 spike ended in a STOP (#318), and docs/adr/0002-mssql-read-only-credentials-with-minimal-guard.md replaced the parser design: read-only credentials are the write control, a minimal dependency-free guard catches accidents, and a startup check warns when the login can write. Stage 2 is unblocked. Follow AGENTS.md: feature issue, branch feature/issue-<N>/<slug>, commits issue-<N>: <summary>, PR Closes #<N>. Write each test before its code. extensions/postgres/ is the layout to mirror (files: index.ts, env.ts, env.test.ts, index.test.ts, README.md, TypeScript, tests with node --test). Plan: extensions/mssql/docs/IMPLEMENTATION_PLAN.md tasks 2.1 and 2.2.

Depends on: none (the gate, #318, is resolved).

Documentation Required

Reference docs are vendored under these folders (on main); if absent on your branch, fetch the URLs.

Implementation Details

  • Create extensions/mssql/index.ts (stub default export), extensions/mssql/env.ts (stub), extensions/mssql/README.md (placeholder heading), and empty-but-valid test files env.test.ts, index.test.ts. The docs/ folder already exists.
  • Copy the spike corpora (corpus-reject, corpus-accept) into a permanent location such as extensions/mssql/test-data/ in the same {label, sql} shape. They are regression data for the minimal guard (#322), not a zero-false-accept gate. Leave the spike folder intact; it is a record.
  • Add mssql to the root package.json dependencies using the version vetted in spike/dependency-check.md (check version, licence and advisories again); update package-lock.json. Do not add node-sql-parser, antlr4 or any parser, and do not add Java to the build. Do not register the extension yet and do not touch the test script (later issues do).

Acceptance Criteria

  • extensions/mssql/ contains index.ts, env.ts, README.md, env.test.ts, index.test.ts.
  • Both corpora exist as permanent test data and load without error.
  • Root package.json lists mssql in dependencies; lockfile updated.
  • No parser package (node-sql-parser, antlr4) is added to dependencies.
  • The extension is not yet in pi.extensions.
  • npm ls mssql resolves with no errors.

Test Plan

Run npm install, then npm ls mssql and confirm no errors. Confirm package.json has no parser dependency. Run node --test extensions/mssql/*.test.ts and confirm the (empty) files load.

## Summary Create the `extensions/mssql/` skeleton mirroring `extensions/postgres/`, copy the spike corpora into permanent regression data, and add `mssql` to the root dependencies. **No parser dependency.** ## Background Stage 2 of the MSSQL extension (a pi extension with four tools: `mssql_query`, `mssql_query_one`, `mssql_list_tables`, `mssql_table_schema`). The Stage 1 spike ended in a STOP (#318), and `docs/adr/0002-mssql-read-only-credentials-with-minimal-guard.md` replaced the parser design: read-only credentials are the write control, a minimal dependency-free guard catches accidents, and a startup check warns when the login can write. Stage 2 is **unblocked**. Follow `AGENTS.md`: `feature` issue, branch `feature/issue-<N>/<slug>`, commits `issue-<N>: <summary>`, PR `Closes #<N>`. Write each test before its code. `extensions/postgres/` is the layout to mirror (files: `index.ts`, `env.ts`, `env.test.ts`, `index.test.ts`, `README.md`, TypeScript, tests with `node --test`). Plan: `extensions/mssql/docs/IMPLEMENTATION_PLAN.md` tasks 2.1 and 2.2. **Depends on:** none (the gate, #318, is resolved). ## Documentation Required Reference docs are vendored under these folders (on `main`); if absent on your branch, fetch the URLs. - `docs/reference/mssql/` — https://raw.githubusercontent.com/tediousjs/node-mssql/master/README.md : driver API reference (pool, request, stream). ## Implementation Details - Create `extensions/mssql/index.ts` (stub default export), `extensions/mssql/env.ts` (stub), `extensions/mssql/README.md` (placeholder heading), and empty-but-valid test files `env.test.ts`, `index.test.ts`. The `docs/` folder already exists. - Copy the spike corpora (`corpus-reject`, `corpus-accept`) into a permanent location such as `extensions/mssql/test-data/` in the same `{label, sql}` shape. They are regression data for the minimal guard (#322), not a zero-false-accept gate. Leave the spike folder intact; it is a record. - Add `mssql` to the root `package.json` `dependencies` using the version vetted in `spike/dependency-check.md` (check version, licence and advisories again); update `package-lock.json`. **Do not add `node-sql-parser`, `antlr4` or any parser, and do not add Java to the build.** Do not register the extension yet and do not touch the `test` script (later issues do). ## Acceptance Criteria - [ ] `extensions/mssql/` contains `index.ts`, `env.ts`, `README.md`, `env.test.ts`, `index.test.ts`. - [ ] Both corpora exist as permanent test data and load without error. - [ ] Root `package.json` lists `mssql` in `dependencies`; lockfile updated. - [ ] No parser package (`node-sql-parser`, `antlr4`) is added to `dependencies`. - [ ] The extension is not yet in `pi.extensions`. - [ ] `npm ls mssql` resolves with no errors. ## Test Plan Run `npm install`, then `npm ls mssql` and confirm no errors. Confirm `package.json` has no parser dependency. Run `node --test extensions/mssql/*.test.ts` and confirm the (empty) files load.
david closed this issue 2026-11-10 23:56:54 +00:00
Author
Owner

pi-loop opened and merged a pull request for this issue: #343

pi-loop opened and merged a pull request for this issue: https://git.excelera.net/david/pi-extensions-and-skills/pulls/343
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
david/pi-extensions-and-skills#319
No description provided.