server_capabilities.hpp 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // v2.15.0 - the feature names this server reports in GetServerInfo.
  2. //
  3. // A client gates a feature on its NAME, never on a version number, so a
  4. // backported or patched server can say exactly what it supports. Rules:
  5. // - a name is never removed while the feature exists, and never reused;
  6. // - a feature whose meaning changes gets a NEW name (the old one goes when the
  7. // old meaning goes);
  8. // - the client keeps the same names in client.hpp (Client::Capability) - add a
  9. // name to both in the same change.
  10. // Features from before 2.15.0 are listed so the answer is complete; a client
  11. // talking to a pre-2.15.0 server gets UNIMPLEMENTED and must assume none of the
  12. // names introduced in 2.15.0 or later.
  13. #pragma once
  14. #include <array>
  15. #include <string_view>
  16. namespace smartbotic::database {
  17. inline constexpr std::array<std::string_view, 25> kServerCapabilities = {
  18. "projects", // 2.3.0 <project>:<collection> namespaces
  19. "access_policy", // 2.7.0 row/column security
  20. "query_projection", // 2.7.1 FindRequest.projection
  21. "file_ttl", // 2.8.0 file expiry, SetFileTtl
  22. "document_ttl_update", // 2.8.0 ttl_seconds on Update/PatchDocument
  23. "secondary_indexes", // 2.9.0 CreateIndex/DropIndex/ListIndexes
  24. "index_values", // 2.10.0 GetIndexValues
  25. "relations", // 2.11.0 referential integrity, DescribeDelete
  26. "unique_indexes", // 2.11.0 enforced unique constraints
  27. "error_detail", // 2.12.0 sbdb-error-detail-bin trailer, in-band codes
  28. "patch_if_version", // 2.12.0 PatchDocumentRequest.expected_version
  29. "increment", // 2.12.0 PatchDocumentRequest.increments_json
  30. "composite_unique", // 2.12.0 multi-field unique constraints
  31. "batch_delete_ids", // 2.12.0 BatchDeleteResponse.deleted_ids
  32. "event_actor", // 2.12.0 actor on DatabaseEvent / Delete
  33. "vector_readback", // 2.13.0 include_vector on Get/Find
  34. "export_collection", // 2.13.0 ExportCollection stream
  35. "write_size_guard", // 2.13.1 document_too_large refusals
  36. "filtered_similarity", // 2.14.0 SimilaritySearchRequest.filters
  37. "server_info", // 2.15.0 GetServerInfo itself
  38. "client_version_header", // 2.15.0 the server reads sbdb-client-version
  39. "collection_schema", // 2.16.0 Set/Get/SuggestCollectionSchema, schema_violation
  40. "encryption_at_rest", // 2.17.0 encrypted collections encrypt, VerifyEncryption, encrypted_field
  41. "typed_range_filters", // 2.18.0 GT/GTE/LT/LTE match number~number and string~string only
  42. "document_expires_at", // 2.19.0 _expires_at filterable; reserved in write bodies
  43. };
  44. } // namespace smartbotic::database