Repository navigation
feat: add first end-to-end find slice - #43
Merged
Merged
Conversation
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
Implements the first end-to-end find vertical slice as one dependency-ordered sprint:
Archive::table_rows.find_first,OwnedField, andOwnedRow, materializing only the first matched row and terminating the stream immediately.pgdumpx find <FILE> <SCHEMA.TABLE> <COLUMN> <VALUE>CLI adapter using the library production path.Dependency chain: #14 → #15 → #16. No Issue #17+ API or enforcement work is included.
Closes #14
Closes #15
Closes #16
Public API and CLI
Library
Archive::table_rows(schema, table) -> TableRowReader<'_, R>TableRowReader::{columns, column_index, next_row, find_first}Row<'_>remains the normal lending scan APIOwnedField::{Null, Bytes(Vec<u8>)}andOwnedRoware used only when a match must outlive reusable parser storageCLI
0, one normalized COPY text record on stdout1, no stdout/stderr2, diagnostic on stderr\N) from an empty field\\, tab, LF, and CR are emitted as canonical COPY escapes; other non-printable/non-ASCII bytes use three-digit octal escapes such as\377Red → Green → Refactor
Issue #14
Red
Acceptance tests were added before production code for:
Archive::table_rowsThe clean Red run passed formatting and failed compilation only because
TableRowReader,Archive::table_rows, andTableNotFoundwere not implemented.Green
EntryDataReaderwithCopyRowReaderinTableRowReaderRefactor
Issue #15
Red
Acceptance tests were added first for:
OwnedRowlifetime beyond the reader/archive scopeOk(None)The clean Red run passed formatting and failed compilation only because
OwnedField/OwnedRowandfind_firstwere absent.Green
find_firstevaluates borrowed rows in orderRefactor
Issue #16
Red
README/README.ja and 11 CLI integration tests defined the command grammar, stdout normalization, statuses, errors, UTF-8 boundary, non-UTF-8 row handling, and official none/gzip end-to-end behavior before implementation.
The clean Red run passed formatting, Clippy, and Rust 1.85.0 checking; only the new CLI tests failed because the pre-existing
main()returned success without performing work.Green
The CLI now delegates the complete data path to:
It does not reimplement archive parsing, selected-entry validation, decompression, COPY parsing, or filtering.
Refactor
Official PostgreSQL 18.4 evidence
Both committed archive 1.16 fixtures are exercised through production paths:
pg18-none-copy-basic.dumppg18-gzip-copy-basic.dumpEvidence includes:
table_rowsresultsBufReadread-aheadEarly termination evidence
find_firstreturns the first match while more than 100,000 archive bytes remain unreadQuality gates
Final clean head:
c53ef6ef564ebc84596ec0ec06a5a9352201be72All required gates passed on the PR merge ref:
Final test inventory includes:
No test failures, Clippy warnings, rustdoc warnings, or MSRV failures remain.
Acceptance self-review
Issue #14
Row<'_>lending semantics remain intactIssue #15
Ok(None)resultOwnedRowScanLimitsor final publicLimitsAPI was introducedIssue #16
Safety
unsafewas added; the library remains#![forbid(unsafe_code)]Intentionally deferred
This PR does not implement or pre-design:
LimitsScanLimitsenforcement