Skip to content
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

Parseable optargs #1

Open
NotJustAnna opened this issue Mar 3, 2020 · 0 comments
Open

Parseable optargs #1

NotJustAnna opened this issue Mar 3, 2020 · 0 comments

Comments

@NotJustAnna
Copy link
Member

NotJustAnna commented Mar 3, 2020

What is this?

Make a list of optargs K/V allowed values, preferably in JSON.

Example:

{
    "optarg_enums": {
        "E_FORMAT": ["raw", "native"],
        "E_DURABILITY": ["hard", "soft"],
        "E_CONFLICT": ["error", "replace", "update"],
        "E_READ_MODE": ["single", "majority", "outdated"],
        "E_IDENTIFIER_FORMAT": ["name", "uuid"],
        "E_BOUND": ["open", "closed"],
        "E_STATUS": [
            "ready_for_outdated_reads",
            "ready_for_reads",
            "ready_for_writes",
            "all_replicas_ready"
        ],
        "E_EMERGENCY_REPAIR": [
            "unsafe_rollback",
            "unsafe_rollback_or_erase"
        ],
        "E_RESULT_FORMAT": [
            "text",
            "json",
            "jsonp",
            "binary",
            "auto"
        ],
        "E_HTTP_METHOD": [
            "GET", "POST", "PUT", "PATCH", "DELETE", "HEAD"
        ],
        "E_AUTH_TYPE": ["basic", "digest"],
        "E_GEO_SYSTEM": ["WGS84", "unit_sphere"],
        "E_UNIT": ["m", "km", "mi", "nm", "ft"]
    },
    "global_optargs": {
        "use_outdated": "T_BOOL",
        "time_format": "E_FORMAT",
        "profile": "T_BOOL",
        "durability": "E_DURABILITY",
        "group_format": "E_FORMAT",
        "noreply": "T_BOOL",
        "db": "T_DB",
        "array_limit": "T_NUM",
        "binary_format": "E_FORMAT",
        "min_batch_rows": "T_NUM",
        "max_batch_rows": "T_NUM",
        "max_batch_bytes": "T_NUM",
        "max_batch_seconds": "T_NUM",
        "first_batch_scaledown_factor": "T_NUM"
    }
}

Source of knowledge

https://github.com/rethinkdb/rethinkdb/blob/next/src/rdb_protocol/optargs.cc

Things to keep in mind

According to srh:

You can actually use term optargs in the global optargs (and they apply to any term that uses them). Which IMO is unfortunate, but that's life.

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

No branches or pull requests

1 participant