Quick Question The following is in in a cfc of a o...
# box-products
l
Quick Question The following is in in a cfc of a older site of our. property name='dsn' inject='coldboxdatasourcetiger';
b
@laslo7 That injection DSL hasn't been supported in a long time
Are you on a very old version of Coldbox?
l
Yeah
b
All it did was inject a CFC if I recall with basic getters to access the info about the datasource
it doesn't actually do anything with your cfqueries, etc
l
OK that what I thought.
b
But yeah, it just maps to the config in your coldbox.cfc
l
the version of of CB is coldbox-4.2.0+00002-201603311151
b
in COldBox 4 or so we just replaced that entirely with basic coldbox settings
So you just move the same data to the
settings
struct and inject it as a basic struct like
coldbox:setting:myDSN
☝🏾 1
l
Good toknow
We have 2 apps that will be get the update treatment this summer
👍 1
b
Honestly, the dsn settings IMO are only useful if you actually name the datasource differently between dev/prod/and stage
if your app uses the same DSN name everywhere, it's sort of moot
Datasource config originally held stuff like username, password, type, etc in case people wanted to have like super dynamic cfqueryes
But in reality, all I ever see people use it for is just the name of the DSN
And if it's the same everywhere, it's sort of just a setting for the sake of a setting
Especially if you just name the setting the same as the datasource name!
💯 1
l
I see that
b
It would only be truly useful if you have a setting called "primaryDSN" or whatever and you swap it around at runtime and then the real name is abstracted
l
Thanks for the insight
👍 1
b
I always laugh when I see
Copy code
datasource.mySecificDSNName='mySecificDSNName'