pounard / goat-query

Goat SQL query builder built over a PHP to SQL and SQL to PHP type converter
GNU General Public License v2.0
2 stars 0 forks source link

Implement lazy in runner #55

Closed pounard closed 3 years ago

pounard commented 3 years ago

When services are requested from the Symfony dependency injection container, Runner is most often the required dependency. This forces the Driver to connect, then create the runner giving it the connection.

In most cases, it's not a problem, you'll need this connection anyway, but in the console context, it's wrong, because the Runner can be spawed to be injected to some console commands, if the connection fail, it prevent the user from user the console since it'll raise exceptions, and prevent the console from registering commands.

pounard commented 3 years ago

Done https://github.com/pounard/goat-query/commit/8a600130bed942998508bab842af881cea8bf435

Now we have to deal with platform, which sometime gets early initialized when calling dialect specific functions that don't need the connection.

Further, platform only need the connection for the escaper, find a way to decouple those two.

pounard commented 3 years ago

Fixed !