Closed laceysanderson closed 1 year ago
Code Climate has analyzed commit d03501a7 and detected 0 issues on this pull request.
The test coverage on the diff in this pull request is 100.0% (50% is the threshold).
This pull request will bring the total coverage in the repository to 20.5% (0.1% change).
View more on Code Climate.
This PR tests Tripal DBX table prefixing and was undertaken to address Issue #217.
It turns out that Tripal DBX table prefixing is not actually broken and this is more a misunderstanding and incorrect usage. As such, I have documented how Tripal DBX determines the table prefix to apply in Tripal Doc Issue 9.
To summarize, if the schema to use is not indicated (i.e. if you use
{tablename}
rather then{1:tablename}
) then Tripal DBX automatically assumes you want the Drupal database. This is needed since Drupal seems to unknowingly use Tripal DBX sometimes (why needs more exploration). In order to allow queries using{chadotable}
you need to add the class executing these queries to a Tripal DBX managed whitelist. This is done as follows:NOTE: I'm still confirming but it is likely this whitelist is specific to the current connection instance.
Additionally, I added automated testing to confirm this functionality and to ensure it continues to work.
I also added functionality to check through the inheritance chain to allow us to specify parent classes and added additional in class documentation to the TripalDbxConnection class.