<cfdbinfo>
Lets you retrieve information about a data source, including details about the database, tables, queries, procedures, foreign keys, indexes, and version information about the database, driver, and JDBC.
This tag supports only JDBC drivers, and does not support ODBC-based drivers, including the Microsoft Access driver.
This tag cannot have a body.
This tag is also supported within <cfscript>
<cfdbinfo
datasource=object
name=string
type=string
procedure=string
dbname=string
password=string
pattern=string
table=string
username=string
Filter=string
>
| Attribute | Description |
|---|---|
|
datasource
object, optional
|
edit
Datasource to use to connect to the database. |
|
name
string, required
|
edit
Name to use to refer to the result. Alias: variable |
|
type
string, required
|
edit
Type of information to get:
|
|
dbname
string, optional
|
edit
Name of the database Alias: dbnames |
|
password
string, optional
|
edit
Password to connect to the database. |
|
username
string, optional
|
edit
User name to connect to the database. |
Database Names
type="dbNames" - Get database name and type
| Attribute | Description |
|---|---|
|
pattern
string, optional
|
edit
Specifies a sql filter, i.e |
Table Information
type="tables" - Get information about all tables
| Attribute | Description |
|---|---|
|
pattern
string, optional
|
edit
Specifies a sql filter, i.e |
|
Filter
string, optional
|
edit
Filter for
Note: Each Database implementation has it's own supported types Introduced: Lucee 6.0.0.76 Alias: tabletype Introduced: 6.0.0.73 |
Column Information
type="columns" - Get column info with FK/PK relationships
| Attribute | Description |
|---|---|
|
table
string, optional
|
edit
Name of the table from which you retrieve information. Patterns are also supported, i.e.
Not used for |
Column Info (Fast)
type="columns_minimal" - Get column info without FK/PK (much faster)
| Attribute | Description |
|---|---|
|
table
string, optional
|
edit
Name of the table from which you retrieve information. Patterns are also supported, i.e.
Not used for |
Version Information
type="version" - Get database version info
| Attribute | Description |
|---|
Stored Procedures
type="procedures" - Get information about all procedures
| Attribute | Description |
|---|---|
|
pattern
string, optional
|
edit
Specifies a sql filter, i.e |
Procedure Columns
type="procedure_columns" - Get column info for a procedure
| Attribute | Description |
|---|---|
|
procedure
string, optional
|
edit
Name of the procedure from which you retrieve information. |
Foreign Keys
type="foreignKeys" - Get foreign key information
| Attribute | Description |
|---|---|
|
table
string, optional
|
edit
Name of the table from which you retrieve information. Patterns are also supported, i.e.
Not used for |
Index Information
type="index" - Get index information
| Attribute | Description |
|---|---|
|
table
string, optional
|
edit
Name of the table from which you retrieve information. Patterns are also supported, i.e.
Not used for |
Database Users
type="users" - List database users
| Attribute | Description |
|---|
Vendor Terms
type="terms" - Get vendor preferred terminology
| Attribute | Description |
|---|
Usage Notes
editPerformance tips
- Using
type="columns_minimal"is dramatically faster thantype="columns" - With
type="table"usingfilter="table"is also much faster
Examples
editCFDBINFO Syntax
<cfdbinfo type="columns" name="db_info" datasource="lucee" dbname="tester" table="test">
See also
- Queries
- <cfquery>
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)