fix: refuse an input whose table would fall in the reserved _filesql_ namespace - #306
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThe package now reserves table names beginning with ChangesReserved table names
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@source_registry.go`:
- Around line 176-180: Update validateTableName to normalize tableName and
compare it case-insensitively with sourceTablePrefix, matching SQLite LIKE
behavior while preserving the existing reserved-name error. Add a case-variant
regression case to TestReservedTableNameIsRefused.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: cccd43fc-94f3-43f0-8551-16f56d4eb2c0
📒 Files selected for processing (8)
CHANGELOG.mdREADME.mdach.goerrors.gosource_registry.gosource_registry_test.gostream_processor.gowire.go
Code Metrics Report
Details | | main (27bc6fe) | #306 (d100907) | +/- |
|---------------------|----------------|----------------|-------|
- | Coverage | 90.3% | 90.3% | -0.1% |
| Files | 64 | 64 | 0 |
| Lines | 10520 | 10535 | +15 |
+ | Covered | 9507 | 9519 | +12 |
| Test Execution Time | 14s | 14s | 0s |Code coverage of files in pull request scope (79.0% → 79.0%)
Reported by octocov |
v0.43.0 began hiding
_filesql_tables fromDumpDatabaseand from the table listings this package returns, so the metadata table it writes does not show up as a user table. It did not stop a caller's input from landing in that namespace: a file named_filesql_report.csvstill loaded, and the resulting table answered queries while being absent from every listing and from any dump — its rows were silently left out of an export, which is worse than the load failing.A prefix is only reserved if nothing else can occupy it, so an input whose table name would begin with
_filesql_is now refused withErrReservedTableName, naming the table and the prefix. SQLite answers the same way for its ownsqlite_prefix, and the rule follows that precedent. It covers every way a name is chosen: a path, a reader's explicit table name, an Excel sheet, and an ACH or Fedwire base name. A name that merely resembles the prefix, such asfilesql_report, is unaffected — the check is a prefix match, not the LIKE pattern used for hiding.This also makes the rule sqly relies on true: it can filter the prefix out of its own
.tableslisting knowing that no user table can be hidden by the filter.Summary by CodeRabbit
New Features
_filesql_.ErrReservedTableNameto identify rejected table-name inputs.filesql_report, remain valid.Documentation
Bug Fixes