Hi, I'm new on Lucee. I defined a datasource into ...
# lucee
d
Hi, I'm new on Lucee. I defined a datasource into Application.cfc
_this_.datasource = 'my_db'
Is it possible to access to this value inside my code directly? I mean only the datasource name, not the datasorce configuration.
z
yep
<cfquery name="q_users" datasource="my_db">....sql...</cfquery>
but as it's the default datasource you can just write
<cfquery name="q_users">....sql...</cfquery>
👍 1
d
Thnx Zac
@zackster btw: the execution of examples did not work with firefox
r
It works, eventually. The Lucee 5 instance on trycf.com has been flaky lately.
e
in your Application.cfc you can define your data source as a variable with cfset. IE cfset application.db = "my_db"