useful info for craft\db #294
Unanswered
narration-sd
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Here's a description of what happens and what to do, from Slack posting. Would be nice if could be edited into coming doc...
a little tip for the unwary: if you're connecting to an external database such as mssql, don't use craft\db\Connection (or craft\db\Exception). You'll miss getting proper messages for a failed connection, even just server down.
I had the driver and connection fully working, save for server down, and thought it was a driver issue. But actually it's Craft's db code, and its handling if it doesn't recognize the database/driver type -- says simply unsupported connection type, and mentions the driver.
The real messages from the dblib driver are nicely enough detailed -- using yii\db\Connection (subclassed), and yii\db\Exception.
Beta Was this translation helpful? Give feedback.
All reactions