refactor: drop compound databaseId:tableId resourceId#176
Conversation
The CSV/JSON sources and destinations took a single composite
"databaseId:tableId" string and split it on ':' internally. The Appwrite
source did the same trick on `rootResourceId` to scope a transfer to a
specific collection within a database. That mixed two identifiers in
one slot, broke queryability for callers, and forced consumers to
recompose the colon-form at the boundary.
This change replaces the compound with explicit fields:
- CSV/JSON Source/Destination constructors now take `string $databaseId,
string $tableId` directly. No more `explode(':', $resourceId)`.
- Target/Source/Destination/Transfer::run gain a new optional
`$rootResourceChildId` parameter that, for database roots, scopes the
transfer to a specific table/collection inside the root database.
`$rootResourceId` keeps its existing semantics — it always matches
`$rootResourceType` (a top-level resource).
- Sources/Appwrite no longer inspects `rootResourceId` for ':' or
splits it; it reads `$this->rootResourceChildId` when the caller wants
per-collection filtering.
Tests updated to call the new constructor signatures.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR replaces the implicit
Confidence Score: 5/5All changed code paths are backward-compatible additions or straightforward string-parsing removals; no logic was dropped that wasn't replaced by equivalent, cleaner code. The refactor is mechanically consistent across every layer of the pipeline: abstract signature, concrete overrides, forwarding calls, and tests all align. The previous abstract-signature mismatch flagged in an earlier review is confirmed fixed. No pre-existing colon-split edge case was dropped without replacement, and the $rootResourceChildId default of '' keeps all existing callers working without change. No files require special attention. Important Files Changed
Reviews (3): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile |
The abstract Target::run() omitted $rootResourceType, so its 4th positional parameter was $rootResourceChildId while both concrete overrides (Source::run, Destination::run) take $rootResourceType there. Callers typed against Target passing four positional args would silently route the child ID into the resource type. All three signatures now match exactly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Summary
string \$databaseId, string \$tableIddirectly. The colon-splitting on\$resourceIdis gone.Target::run/Source::run/Destination::run/Transfer::rungain a new optional\$rootResourceChildIdparameter. For database roots, this scopes the transfer to a specific table within the root database.\$rootResourceIdkeeps its existing semantics (always matches\$rootResourceType).Test plan
composer lintpasses locallycomposer check(PHPStan level 3) passes locallyLinked
🤖 Generated with Claude Code