dbinfo

Returns database metadata as a query — the function form of the cfdbinfo tag. Pass the same attributes the tag accepts (type, datasource, filter, columns, etc.), either as positional arguments or a single attributes struct; attributeCollection is expanded with explicit keys winning. Supported types include tables, columns, procedures, datasources and version. The result is delivered to the named variable just like the tag.

dbinfo(name, attributes) → returns query

This function requires RustCFML.  Not supported on Lucee, Adobe ColdFusion, etc.

Argument Reference

name string
Required

Name of the variable to receive the metadata query.

attributes struct
Required

Struct of cfdbinfo attributes: type (tables|columns|procedures|datasources|version|foreignkeys), datasource, filter, columns, and other tag attributes.

Examples
Sample code invoking the dbinfo function

Get the table metadata for the default datasource.

dbinfo(name="tables", type="tables");
writeDump(tables);

Read the database product version.

dbinfo(name="version", type="version");
writeDump(version);

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub