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

Telescope breaks when attempt quote the bindings from an PDO_ODBC connection #1065

Closed
juanparati opened this issue May 27, 2021 · 5 comments
Closed
Labels

Comments

@juanparati
Copy link
Contributor

  • Telescope Version: 4.4
  • Laravel Version: ^8.0
  • PHP Version: 8.0
  • Database Driver & Version: PDO_ODBC with unixODBC

Description:

The following error is raised by Telescope when a query is recorded:

PDOException with message 'SQLSTATE[IM001]: Driver does not support this function: driver does not support quoting'

The reason is that telescope uses $event->connection->getPdo()->quote($binding) in order to binding the quotes, however according to PHP documentation PDO::quote is not supported by PDO_ODBC.

Steps To Reproduce:

  1. Setup a ODBC source in Laravel (You can install the package a Laravel ODBC package).
  2. Activate Telescope.
  3. Run a query against the ODBC connection.

Notes

A possible solution to this problem it could be verify if PDO driver is different than ODBC, and use an alternative method of quoting the bindings.

It's possible to check the driver using:

DB::connection('odbc')
  ->getPdo()
  ->getAttribute(PDO::ATTR_DRIVER_NAME);
@driesvints
Copy link
Member

PDO_ODBC is not supported by Laravel, sorry.

@driesvints
Copy link
Member

Sorry, I'm mistaken. It is supported: https://laravel.com/docs/8.x/database#mssql-configuration

@driesvints driesvints reopened this May 27, 2021
@driesvints
Copy link
Member

Can you send in a PR for that?

@driesvints driesvints added the bug label May 27, 2021
@juanparati
Copy link
Contributor Author

I will do it.

@driesvints
Copy link
Member

Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants