Issue with RelationalDatabase and searching for a substring in a property.
With a Wolfram provided entityclass the search of a substring in a property works. Example:
Quiet@EntityList[
FilteredEntityClass["Aircraft",
EntityFunction[c,
StringMatchQ[c["Manufacturer"], ___ ~~ "Boei" ~~ ___]]]]
Now lets try with an entityclass created from an external database. Created a very simple table "Employees" with two fields: "employeeID" and "fullname", added five records.
This was done with both mySQL and Microsoft SQL
dc = <|
"Backend" -> "mysql",
"Name" -> name,
"Port" -> port,
"Host" ->, host,
"Username" -> username,
"Password" -> pwd
|>;
dr = DatabaseReference[dc];
rd = RelationalDatabase["Employees", dr];
store = EntityStore[rd];
EntityRegister[store]
(*Employees*)
Testing connectivity
EntityValue[Entity["Employees"], "Properties"]
(*{EntityProperty["Employees", "employee_ID"], EntityProperty["Employees", "full_name"]}*)
EntityValue[EntityList["Employees"], {"employee_ID", "full_name"}]
(*{{1, "Diego Maradona"}, {2, "John Doe"}, {3, "Jane Doe"}, {4,
"Diego Rivera"}}*)
EntityList[
FilteredEntityClass["Employees",
EntityFunction[c,
StringMatchQ[c["full_name"], ___ ~~ "Doe" ~~ ___]]]]
(*EntityValue: Generic Database error/*)
(*Failure["DatabaseFailure",
<|"MessageTemplate" :> "1305 FUNCTION database.REGEXP_LIKE does not exist",
"MessageParameters" :> Association[], "FailureCode" :> "InternalError",
"SQLString" :> "SELECT `Employees_T28`.`employee_ID` AS `employee_ID` \nFROM `Employees` AS \
`Employees_T28` \nWHERE REGEXP_LIKE(`Employees_T28`.full_name, %(param_1)s, %(REGEXP_LIKE_1)s) \
= 1", "SQLParameters" :> Association["param_1" -> "^.*Doe.*$", "REGEXP_LIKE_1" -> "cm"]|>]*)