Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing implementation of listTableColumns fail on using laravel-ide-helper #89

Closed
mdemori opened this issue Jun 19, 2021 · 2 comments
Closed

Comments

@mdemori
Copy link

mdemori commented Jun 19, 2021

Summary of problem or feature request

I try to use laravel-ide-helper but when i try to create the model ide-helpers I get and error
that error seem related to a query that is used to extract columns notes from db tables.

If I execute the query "manually" from Oracle SQLDeveloper, the query is perfectly valid but don't return any result because my columns don't have any comments.

Below the error message, where DEV_USERS is the real table name and REDACTED_ORACLE_SCHEMA_NAME is the oracle schema where the table is located.

Exception: An exception occurred while executing
'SELECT c.*,
(
SELECT d.comments
FROM all_col_comments d
WHERE d.TABLE_NAME = c.TABLE_NAME AND d.OWNER = c.OWNER
AND d.COLUMN_NAME = c.COLUMN_NAME
) AS comments
FROM all_tab_columns c
WHERE c.table_name = 'DEV_USERS' AND c.owner = 'REDACTED_ORACLE_SCHEMA_NAME'
ORDER BY c.column_id':

Argument 1 passed to Doctrine\DBAL\Connection::ensureForwardCompatibilityStatement() must be an instance of Doctrine\DBAL\Driver\ResultStatement, instance of Yajra\Pdo\Oci8\Statement given, called in /mnt/develop/www/acs/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php on line 1314
Could not analyze class App\Models\Article.

Trace:
#0 /mnt/develop/www/acs/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(159): Doctrine\DBAL\DBALException::wrapException()
#1 /mnt/develop/www/acs/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(2214): Doctrine\DBAL\DBALException::driverExceptionDuringQuery()
#2 /mnt/develop/www/acs/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1035): Doctrine\DBAL\Connection->handleExceptionDuringQuery()
#3 /mnt/develop/www/acs/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php(168): Doctrine\DBAL\Connection->fetchAllAssociative()
#4 /mnt/develop/www/acs/vendor/barryvdh/laravel-ide-helper/src/Console/ModelsCommand.php(432): Doctrine\DBAL\Schema\AbstractSchemaManager->listTableColumns()
#5 /mnt/develop/www/acs/vendor/barryvdh/laravel-ide-helper/src/Console/ModelsCommand.php(270): Barryvdh\LaravelIdeHelper\Console\ModelsCommand->getPropertiesFromTable()
#6 /mnt/develop/www/acs/vendor/barryvdh/laravel-ide-helper/src/Console/ModelsCommand.php(159): Barryvdh\LaravelIdeHelper\Console\ModelsCommand->generateDocs()
#7 /mnt/develop/www/acs/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Barryvdh\LaravelIdeHelper\Console\ModelsCommand->handle()
#8 /mnt/develop/www/acs/vendor/laravel/framework/src/Illuminate/Container/Util.php(37): Illuminate\Container\BoundMethod::Illuminate\Container{closure}()
#9 /mnt/develop/www/acs/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#10 /mnt/develop/www/acs/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()
#11 /mnt/develop/www/acs/vendor/laravel/framework/src/Illuminate/Container/Container.php(596): Illuminate\Container\BoundMethod::call()
#12 /mnt/develop/www/acs/vendor/laravel/framework/src/Illuminate/Console/Command.php(134): Illuminate\Container\Container->call()
#13 /mnt/develop/www/acs/vendor/symfony/console/Command/Command.php(256): Illuminate\Console\Command->execute()
#14 /mnt/develop/www/acs/vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Symfony\Component\Console\Command\Command->run()
#15 /mnt/develop/www/acs/vendor/symfony/console/Application.php(971): Illuminate\Console\Command->run()
#16 /mnt/develop/www/acs/vendor/symfony/console/Application.php(290): Symfony\Component\Console\Application->doRunCommand()
#17 /mnt/develop/www/acs/vendor/symfony/console/Application.php(166): Symfony\Component\Console\Application->doRun()
#18 /mnt/develop/www/acs/vendor/laravel/framework/src/Illuminate/Console/Application.php(93): Symfony\Component\Console\Application->run()
#19 /mnt/develop/www/acs/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\Console\Application->run()
#20 /mnt/develop/www/acs/artisan(35): Illuminate\Foundation\Console\Kernel->handle()
#21 {main}

At first sight I think that is a problem of laravel-ide-helper and I open this ticket to they github, but seem that the problem is related to a missing listTableColumns Here:

class Statement extends PDOStatement

This is the ticket and the reply with some hints to check the problem:
barryvdh/laravel-ide-helper#1227

There is a way to solve this problem? I really don't know how to handle it by myself.

System details

Versions:
Laravel Version: 7.30.4
PHP Version: 7.4.20
Oracle Laravel - yajra/laravel-oci8 - Version 7.1.1

@mdemori mdemori changed the title missing implementation of listTableColumns missing implementation of listTableColumns fail on using laravel-ide-helper Jun 19, 2021
@danielrona
Copy link
Contributor

This -> barryvdh/laravel-ide-helper#1227 (comment) should solve that.

@yajra yajra closed this as completed Jan 31, 2022
@yajra
Copy link
Owner

yajra commented Jan 31, 2022

updating project composer.json from "doctrine/dbal": "^2.5" to "doctrine/dbal": "^3.1" fixed issue for me

Tried and works for me. Thanks!

@github-actions github-actions bot locked and limited conversation to collaborators Oct 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants