Repository navigation
HCK-18331: add maxTTL to collections - #72
Merged
Merged
Conversation
Add a maxTTL property (seconds) on collections. Forward-engineering and
the alter script generate CREATE COLLECTION ... WITH {"maxTTL": n} after
IF NOT EXISTS when the value is set and not 0. Reverse-engineering from an
instance reads maxExpiry of each collection.
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
serhii-filonenko
approved these changes
Oct 28, 2026
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.



## Content
Jira: HCK-18331 (parent HCK-18316)
Collections get a new Max TTL property (seconds), as described in the CREATE COLLECTION docs (WITH clause, Couchbase Server 7.6+, Enterprise Edition).
maxTTLnumeric property on the collection, min value-1. Always visible; the tooltip says it needs 7.6+ and Enterprise Edition. No filtering by version or edition: if the server does not support the value, it rejects the statement.CREATE COLLECTION ... [IF NOT EXISTS] WITH {"maxTTL": n}when the value is an integer different from 0. Empty or0(inherit from bucket) gives no WITH clause, so existing models generate the same script as before.maxExpiryof each collection fromgetAllScopes(), once per bucket.0is not kept in the model.Out of scope:
Technical details
getCollectionScriptgets amaxTTLparam, the clause is built ingetMaxTTLClause.clusterHelper.getCollectionsMaxExpiryMapandschemaHelper.addMaxTTLToDbCollectionData. IfgetAllScopes()fails, the error is logged and RE continues without maxTTL.oxlint(no new error), Prettier andnpm run package.-1for "never expire".Made with Cursor