feat(parser-sql, introspect): Apply DROP DDL to schema and harden TLS defaults#147
Merged
Conversation
DROP TABLE / VIEW / TYPE / INDEX now mutate the in-progress schema
during parsing instead of being reported only as warnings, so migration
SQL like `CREATE TABLE users; DROP TABLE users;` produces an empty
final schema and downstream review/diff/lint operate on the actual
post-migration state. DROP TABLE additionally prunes inbound foreign
keys from remaining tables to keep the model self-consistent (FKs
explicitly pointing at a different schema's table are preserved). DROP
INDEX honours schema qualifiers in the PostgreSQL/SQLite syntax so a
`DROP INDEX public.idx` no longer collaterally removes same-named
indexes in other schemas; the MySQL `DROP INDEX name ON table` form
continues to scope to the qualified table.
`COMMENT ON {TABLE|COLUMN} ... IS NULL` is now treated as a comment
deletion, matching PostgreSQL semantics, so doc/lint/review no longer
keep stale comments after they have been cleared by a later statement.
Inline `COLUMN ... COMMENT 'text'` definitions in MySQL CREATE TABLE
statements are captured into the column model so MissingColumnComment
lint and the HTML viewer surface authored comments.
Remote PostgreSQL / MySQL / MariaDB introspection now defaults to `sslmode=verify-full` and `ssl-mode=verify-identity` respectively, so the server certificate chain and hostname must validate before credentials and schema metadata are exchanged. Encrypt-only modes (`sslmode=require`, `ssl-mode=required`) are still respected when set explicitly, which is the documented opt-out for self-signed clusters. Unix sockets and loopback-only TCP connections continue to bypass TLS enforcement. The user-facing docs (ARCHITECTURE, getting started, CLI reference) are updated to describe the verifying default and the explicit opt-out for self-signed clusters.
Code Metrics Report
Details | | main (bce4185) | #147 (62c46e8) | +/- |
|---------------------|----------------|----------------|-------|
- | Coverage | 94.4% | 94.4% | -0.1% |
| Files | 99 | 100 | +1 |
| Lines | 36516 | 36742 | +226 |
+ | Covered | 34503 | 34704 | +201 |
| Test Execution Time | 1m37s | 1m37s | 0s |Code coverage of files in pull request scope (87.2% → 87.6%)
Reported by octocov |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
relune-parser-sqlapplyDROP TABLE / VIEW / TYPE / INDEXandCOMMENT ... IS NULLto the in-progress schema and capture MySQL inline columnCOMMENTso migration-style SQL produces a faithful post-statement schema.relune-introspectto verifying TLS, while keepingsslmode=require/ssl-mode=requiredas an explicit opt-out for self-signed clusters.Changes
DROP TABLE / VIEW / TYPE / INDEXto the parsed schema during the ordered statement pass;DROP TABLEprunes dangling inbound foreign keys while preserving FKs that explicitly target a different schema, andDROP INDEX <schema>.<name>is scoped to its qualified schema instead of removing same-named indexes across other schemas.COMMENT ON {TABLE|COLUMN} ... IS NULLas a deletion so doc / lint / review no longer surface comments that have been cleared by a later statement.COLUMN ... COMMENT 'text'from MySQLCREATE TABLEinto the column model soMissingColumnCommentlint and the HTML viewer reflect authored comments.sslmode=verify-fulland remote MySQL / MariaDB connections tossl-mode=verify-identity, requiring server certificate chain and hostname validation before credentials are exchanged.sslmode=require/ssl-mode=requiredas the documented opt-out for self-signed clusters and keep Unix sockets and loopback TCP on the existing local-only path.ARCHITECTURE.md,docs/getting-started.md, anddocs/cli-reference.mdto describe the verifying default and the explicit encrypt-only opt-out.