-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[couchbase] Add support for scopes and collections. #4805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ion). This changeset explicitly configures the service memory quotas to their documented limits by default. This ensures that if a service is enabled, it does not consume more memory than absolutely needed. This is important because some services (like analytics) try to grab memory available which is good for production but of limited use in a testcontainers setting. A new API is also added which allows to customize the memory quota for each service should the test case require more than the minimum (which for most services is 256MB anyways).
This changeset allows to specify scopes and collections to be automatically created, which is available with Couchbase Server 7.0 and later. The BucketDefinition is expanded to take a ScopeDefinition which itself can be configured with CollectionDefinitions. During startup, after the bucket is created, the scopes and collections are stored on the server. Note that as a nice "bonus", similar to a primary index being automatically created on a bucket by default (can be turned off), this change also automatically adds a primary index for each collection created, as long as the query service is also enabled. If the server does not support it, a descriptive error message is shown. Further Reviewer notes: - The primary index creation and keyspace checks have been refactored into their own methods since they are now called from two places: once for the bucket only and once for bucket, scope and collection triple. - A test case has been added to verify using custom scopes and collections. To make this work, the enterprise image has been bumped to 7.0 from 6.6. The community image is left at 6.6 - we could bump it too, but this gives us a little more test coverage on server versions (pre and post collection support) for free.
This change needs to be rebased after the service quota change is merged, since I built it on top to avoid having to rework it quite a bit. |
Since this only works since version 7.0, do you think you could make use of |
yes, that's doable - I'll add that |
This changeset allows to specify scopes and collections to be automatically
created, which is available with Couchbase Server 7.0 and later.