EmbeddedSQLEntityClass
EmbeddedSQLEntityClass[string,props]
represents a verbatim SQL query to be interpreted as an entity class with properties given by props.
EmbeddedSQLEntityClass[template,props,args]
represents an SQL query string template with arguments provided by args.
Details
- EmbeddedSQLEntityClass is used to embed literal SQL queries within a larger symbolic query. It is generally interpreted as an entity class–like object.
- In EmbeddedSQLEntityClass[template,props,…], props are the string names of the properties. In general, EntityProperties[EmbeddedSQLEntityClass[template,{prop1,prop2,…},…]] will have properties of the form EntityProperty[EmbeddedSQLEntityClass[…],propi]. A mismatch between the columns in the query and the name or number of properties in the second argument will result in a runtime error.
- In the form EmbeddedSQLEntityClass[template,props,args], args can either be a list or an association with string keys. If it is a list, the template slots in template are taken to be positional. If args is an association, the slots in template are taken to be named. The syntax for template is the same as the one used in StringTemplate.
- In EmbeddedSQLEntityClass[template,props,args], the values in args can take the following forms:
-
n,"string",DateObject[…],… literal values a+b,Sin[x],… compilable expressions x["prop"] properties bound to a surrounding EntityFunction EntityValue[…],EntityClass[…],… full symbolic queries
Examples
open allclose allBasic Examples (1)
Register a RelationalDatabase-backed EntityStore:
EmbeddedSQLEntityClass can be used to evaluate any SQL query:
Scope (1)
EmbeddedSQLEntityClass can be used anywhere an entity class is supported:
Possible Issues (3)
EmbeddedSQLEntityClass will not work if there are no registered RelationalDatabase-backed entity stores:
When multiple RelationalDatabase-backed entity stores are registered, it might be impossible to determine which one to run the query on:
If there is a mismatch between the name or number of properties and columns in the SQL string, a runtime error will be produced:
Text
Wolfram Research (2020), EmbeddedSQLEntityClass, Wolfram Language function, https://reference.wolfram.com/language/ref/EmbeddedSQLEntityClass.html.
CMS
Wolfram Language. 2020. "EmbeddedSQLEntityClass." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/EmbeddedSQLEntityClass.html.
APA
Wolfram Language. (2020). EmbeddedSQLEntityClass. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/EmbeddedSQLEntityClass.html