Skip to content

feat: adapt TimeLimit schema to query-lib Attribute and Index VOs - #124

Open
abnegate wants to merge 7 commits into
mainfrom
feat-query-lib
Open

feat: adapt TimeLimit schema to query-lib Attribute and Index VOs#124
abnegate wants to merge 7 commits into
mainfrom
feat-query-lib

Conversation

@abnegate

@abnegate abnegate commented Aug 21, 2026

Copy link
Copy Markdown
Member

Required by appwrite/appwrite#11649 and appwrite-labs/cloud#5410 (utopia-php/abuse: dev-feat-query-lib as 2.0.0). Depends on utopia-php/database#823.

Why this approach

Query-lib createCollection() takes a Collection value object only. The TimeLimit adapter now calls new Collection(id:, attributes:, indexes:) built from typed factories (Attribute::string(), Index::unique(), …) with ColumnType / IndexType.

Column set is unchanged: key / time / count, unique (key, time) plus time.

Composer pins utopia-php/database to dev-feat-query-lib as 7.0.0 (808f90bf) with caret ranges (^ not *).

Verified

  • Linter, CodeQL, Tests (8.5), Benchmarks — SUCCESS on the previous head
  • Pint on the Collection wrap

Not verified

  • CI on ae8399d after the Collection-only wrap
  • Appwrite TablesDB tests (tests/Abuse/Appwrite/TablesDBTest.php) — need APPWRITE_* CI secrets
  • Released utopia-php/database tag — still dev-feat-query-lib until database#823 merges

@greptile-apps

greptile-apps Bot commented Aug 21, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adapts the database-backed time-limit schema to the query-lib collection, attribute, and index value objects while preserving the existing record and index structure.

  • Raises the supported PHP floor to 8.5 across Composer, CI, and Docker configuration.
  • Selects the query-lib database development branch and updates its dependency graph.
  • Replaces document-based schema definitions with typed Collection, Attribute, and Index objects.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/Abuse/Adapters/TimeLimit/Database.php Replaces legacy document schema declarations with typed query-lib value objects while retaining the key, time, count, uniqueness, and cleanup-index contracts.
composer.json Aligns the root PHP floor with the selected database branch and adds the query-lib dependency and VCS repositories.
composer.lock Locks the query-lib database branch and its updated transitive dependency graph with a PHP 8.5 platform requirement.
.github/workflows/tests.yml Removes PHP 8.4 from the test matrix so CI matches the package runtime requirement.
docker-compose.yml Changes the default test image selection from PHP 8.4 to the existing PHP 8.5 Dockerfile.
Dockerfile.php-8.4 Removes the unsupported PHP 8.4 test image.

Reviews (9): Last reviewed commit: "(chore): allow utopia-php/query 0.5" | Re-trigger Greptile

Comment thread composer.json
utopia-php/database feat-query-lib (and Appwrite/Cloud) require PHP >=8.5. Advertising >=8.4.1 made Composer reject the graph for 8.4 consumers while CI only passed 8.4 via ignore-platform-reqs.
@abnegate

Copy link
Copy Markdown
Member Author

@greptile-apps review

Schema setup with a known column or index type now uses
Attribute::string() / Index::key() instead of the generic
constructors plus ColumnType / IndexType.
Asterisk wildcards on utopia-php packages are replaced with
equivalent caret constraints so Composer ranges stay consistent.
Keep composer.json and composer.lock in sync so `composer validate`
passes, and pin utopia-php/database to the current query-lib HEAD.
@abnegate

Copy link
Copy Markdown
Member Author

@greptileai review

@abnegate

Copy link
Copy Markdown
Member Author

@greptile-apps review

Force re-review of HEAD 99414ff. Description updated for factories and caret lock refresh.

Database::createCollection no longer accepts a string id.
Database feat-query-lib now requires query ^0.5 after nested joins.
@abnegate

Copy link
Copy Markdown
Member Author

@greptile-apps review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant