You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Immediately after connecting to DB using \Config\Database::connect('group_name'), the connID of DB cannot be obtained. You will be able to see the connID after executing some SQL. I found it when using Postgre.
CodeIgniter 4 version
4.0.4
Affected module(s)
CodeIgniter\Database\Postgre
Expected behavior, and steps to reproduce if appropriate
Execute \Config\Database::connect('group_name') to get the public connID of the returned object.
Context
OS: Windows 10 2004 64bit
Web server is [php spark server]
PHP version 7.4.9 x86_64 Thread Safe
The text was updated successfully, but these errors were encountered:
lf-uraku-yuki
added
the
bug
Verified issues on the current code behavior or pull requests that will fix them
label
Sep 4, 2020
This is intentional. It's made that's way to avoid unnecessary database connection. You may have database class loaded globally and an immediate connection is not always needed as we may not use the database at all for some pages. Therefore the connection takes place only when the first query is called.
If you want to connect immediately - before you run any query, just call the initialize() method.
Describe the bug
Immediately after connecting to DB using \Config\Database::connect('group_name'), the connID of DB cannot be obtained. You will be able to see the connID after executing some SQL. I found it when using Postgre.
CodeIgniter 4 version
4.0.4
Affected module(s)
CodeIgniter\Database\Postgre
Expected behavior, and steps to reproduce if appropriate
Execute \Config\Database::connect('group_name') to get the public connID of the returned object.
Context
The text was updated successfully, but these errors were encountered: