-
Notifications
You must be signed in to change notification settings - Fork 344
Open
Description
DB::select() used to return Database_Query_Builder_Select class without connection before,
but now it returns with connection.
And the connection is created by \Database_Connection::instance() method.
\Database_Connection::instance() is defined as
public static function instance($name = null, array $config = null, $writable = true)
so the connection is always master one.
Actually I can use readonly instances in some ways like below.
-
pass arguments to the execute method
DB::select()->...->execute('default') -
set the static $_connection field of Model_Crud
protected static $_connection = 'default';
but I think it should use readonly instances, when it is select query.
so I suggest to change the DB::select() method like below
public static function select($args = null) {
return \Database_Connection::instance(null, null, false)->select(func_get_args());
}
any idea ??
thanks.
Metadata
Metadata
Assignees
Labels
No labels