Dynamic metadata is metadata extracted from a result of an SQL query.
Remember that dynamic metadata is generated dynamically at runtime only. As a result, its fields cannot be viewed or modified in metadata editor in CloverDX Designer.
To define the dynamic metadata open the Source tab and type in the following lines:
<Metadata id="YourMetadataId" connection="YourConnectionToDB" name="YourMetadataName" sqlQuery="YourQuery"/>
To read unknown database data types as strings,
If the attribute value is set to
false, the conversion from the unknown type fails.
You can add the
sqlOptimization="true" attribute to speed up metadata extraction process.
Specify a unique expression for
YourMetadataId (e.g. DynamicMetadata1)
and an ID of a previously created DB connection that should be used to connect to DB as
Type the query that will be used to extract metadata
from DB as
YourQuery (e.g. select * from myTable).
<Metadata connection="JDBC0" id="DynamicMetadata0" name="users" sqlQuery="SELECT * FROM users LIMIT 1"/>
In order to speed up the metadata extraction, add the clause
"and 1=0" to the query.
The former one should be added to a query with no
where condition and the latter clause should be added to the query which already contains
"where ..." expression.
This way, only metadata are extracted and no data will be read.
It is highly recommended you skip the