Welcome Guest, Not a member yet? Register   Sign In
Model - read/write connections
#3

Yes. I found the isWriteType() in the \CodeIgniter\Database\Query class and also has one @todo in the \CodeIgniter\Database\BaseConnection::getConnection().

My thought is that the BaseConnection is not the place to decide if is a write or read connection because it uses a Database group. And the connection type should be based by group, because are required optimizations in the database according to the type. The failover is ok there.

So I came to the conclusion that Model would be the best place to decide which group to use. If someone wants to read/write outside the Model, just use the necessary group.

No?
Reply


Messages In This Thread
Model - read/write connections - by natanfelles - 10-24-2018, 07:15 AM
RE: Model - read/write connections - by kilishan - 10-24-2018, 07:50 AM
RE: Model - read/write connections - by natanfelles - 10-24-2018, 09:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB