To retreive a parameter's value from the database, we are using:
dao.get_config("remote_token") # string or None dao.get_config("ssl_verify", "1") != "0" # bool
As we saw with NXDRIVE-1490, we also have:
dao.get_config("ssl_verify", default=True)
Which is not intuitive: asking for a boolean as the default value is suggesting but the database stores only integers returned as strings.
So the prevent such errors/misuses, we should introduce specific getters:
dao.get_int("param", default=0) dao.get_bool("param", default=False)
We keep dao.get_config() to retreive other values.
And so for setters:
dao.store_int("param", 42) dao.store_bool("param", True)
We keep dao.update_config() to store other values.
- is related to
-
NXDRIVE-1490 Fix certificate handling
-
- Resolved
-