I've been doing some simple queries and so far things work. However, I would like to do a join between two objects. Does LDAP support joins like SQL does? How would an example join look like in a query? Do I have to execute multiple queries instead?
问题:
回答1:
The UnboundID Directory Server and the commercial edition of the LDAP SDK supports the JoinRequestControl
, which provides functionality very much like a SQL join. Other than that, there is no support for a standardized JOIN in the LDAP specifications.
回答2:
The equivalent functionality you're looking for in LDAP is achieved using the Deref control. It is not called a JOIN.
https://tools.ietf.org/html/draft-masarati-ldap-deref-00
As noted here https://www.ietf.org/mail-archive/web/ldapext/current/msg02210.html it is implemented in at least OpenLDAP and 389DS so it is already multi-vendor, with multi-implementation interoperability.
回答3:
Posting this as an answer, despite having accepted Terry's one, just for future references.
After doing some more research on the topic, I came across this excellent article explaining why LDAP could not and should not be used for joins and why LDAP is not relational like a proper RDBMS.