ExportXMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • C Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      In the Rust Driver, read_concern fields (example) are represented using the ReadConcern type, which has a single field level of type ReadConcernLevel.

      ReadConcernLevel contains the expected values (Local, Majority, etc.) as unit variants, but also contains a Custom(String) variant with the following documentation:

      > Specify a custom read concern level. This is present to provide forwards compatibility with any future read concerns which may be added to new versions of MongoDB.

      There are a number of ways we could go about representing read_concern fields in the C API:

      • Implement ReadConcernT or provide functions to set the read concern level directly on read_concern fields.
      • Regarding ReadConcernLevel:
        • Use mongoac_string_view_t (i.e. Custom under the hood) exclusively. A simple and flexible API, but lacks the compile-time guarantees that the read concern levels are valid.
        • Use enumerators for each unit variant (e.g. MONGOAC_READ_CONCERN_LEVEL_LOCAL) with no support for custom read concern level. A simple API with stronger guarantees, but lacks the forwards-compatibility advantages of Custom.
        • Use enumerators for each unit variant and support custom read concern level. All the advantages of the alternatives above, but complicates the API.

            Assignee:
            Unassigned
            Reporter:
            Connor MacDonald
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: