A reader sent me a question and wanted to know why something wasn't working. In the ColdBox config we have the following setting. Then in your model you have 2 ways that you can access this datasource object both of which work off of the alias. The alias is the left side of the assignment in our settings here so in our case mysite is the datasource alias. We can wire up the property using wirebox and the correct dsl coldbox:datasource:alias The easier way is to use the ColdBox Model Integration features and use the shortcut. Then in your code you can access the name in a query by using getName()

What happend in the case of our reader is he might of got the wrong idea about alias. In his code he had the following datasource setting. And when he was trying to wire up the datasource object he was using the following which will end up throwing a dsn is not defined error when you trying accessing the object.

So moral of the story is the alias is what you assign the structure to, in the case of our reader it will be dsn.