On Thu, Jun 16, 2022 at 08:11:20PM +0000, Hamid Maadani wrote: > I have uploaded the latest code, which simplifies filters, projections > and accommodates multiple results. In this version: > > - Users can search by specifying search keys, OR writing more advanced > filters. If search_keys > are specified, value of 'filter' will be ignored if specified.
Perhaps best to fail if both are specified. The conflict may be missed by some users. > - Users can specify a return_key for a simplified projection. It would > default to "result" if not specified. Good. Don't know whether "result" is a probable common attribute, if not, perhaps simply require that exactly one of "return_key" and "projection" is set. Note that "return_key" could be a list of attributes in which case all are used, comma-separated if they occur in the same result object, and of course also if present in multiple objects. > - Users can set more complex projections. If a projection is set, > value of return_key will become irrelevant (the code handles that > automatically). Perhaps again fail on conflicting configuration information? > - If there are multiple results, a comma-separated list of strings will be > returned. Yes. > > You should also support the "domain" attribute to limit the keys sent to > the database to just email addresses with a domain part matching one of > the elements of that list. See db_common_parse_domain(), and its call sites in the LDAP, MySQL and PostgreSQL drivers. -- Viktor.