Return to v2.0 docs

dataSource()


Model Configuration Miscellaneous Functions void model


Use this method to override the data source connection information for this model.

Name Type Required Default Description
datasource string Yes The data source name to connect to.
username string No The username for the data source.
password string No The password for the data source.
// In models/User.cfc.
config() {
// Tell Wheels to use the data source named `users_source` instead of the default one whenever this model makes SQL calls.
dataSource("users_source");
}

Related Functions

Miscellaneous Functions