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
I specified a "clickhouse" connection for one of my models using the laravel clickhouse db driver. Now whenever I run the model:typer command, it results in the following error in the output:
BadMethodCallExceptionMethodPhpClickHouseLaravel\Connection::getDoctrineDriver does not exist.
at vendor/laravel/framework/src/Illuminate/Macroable/Traits/Macroable.php:112108▕ */
109▕ publicfunction__call($method, $parameters)
110▕ {
111▕ if (! static::hasMacro($method)) {
➜ 112▕ thrownewBadMethodCallException(sprintf(
113▕ 'Method %s::%s does not exist.', static::class, $method114▕ ));
115▕ }
116▕
i BadMethodCall: Did you mean PhpClickHouseLaravel\Connection::getDoctrineColumn() ?
�[2m+41 vendor frames �[22m
42 artisan:35Illuminate\Foundation\Console\Kernel::handle()
It seems pretty obvious that the underlying model:show command relies on getDoctrineDriver(), which might not exist for all database drivers.
The Solution
It seems like try-catching for this scenario is not viable, considering the highly generic type of the BadMethodCallException, where catching it might result in unintentionally hiding errors with a different cause.
The first solution that comes to mind would be to implement a feature to ignore certain models (or models with a certain connection type). This should be very straightforward given that the GetModels action already supports exclusion of certain models (the parameters are simply not utilized currently).
Model exclusion could be implemented as either config or command option. Do you happen to have any preference for either approach or would you suggest and entirely different solution to begin with?
It seems pretty obvious that the underlying model:show command relies on getDoctrineDriver(), which might not exist for all database drivers.
...
This might be more of a model:show laravel command issue as they support which drivers can be used with it. This being a custom driver im not entirely sure. I would be curious if there are any issues out on the framework for this type is issue with unsupported drivers.
My initial thought would be to filter only models with supported drivers as we need Laravel to do its thing before we can try to convert it
What happened?
The Problem
I specified a "clickhouse" connection for one of my models using the laravel clickhouse db driver. Now whenever I run the
model:typer
command, it results in the following error in the output:It seems pretty obvious that the underlying
model:show
command relies ongetDoctrineDriver()
, which might not exist for all database drivers.The Solution
It seems like try-catching for this scenario is not viable, considering the highly generic type of the
BadMethodCallException
, where catching it might result in unintentionally hiding errors with a different cause.The first solution that comes to mind would be to implement a feature to ignore certain models (or models with a certain connection type). This should be very straightforward given that the
GetModels
action already supports exclusion of certain models (the parameters are simply not utilized currently).Model exclusion could be implemented as either config or command option. Do you happen to have any preference for either approach or would you suggest and entirely different solution to begin with?
Expected Behavior
Model types are generated as normal.
Steps To Reproduce
protected $connection = 'clickhouse'
model:typer
commandThe text was updated successfully, but these errors were encountered: