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

error when storing build example in database #65

Open
mehrancodes opened this issue Nov 10, 2021 · 0 comments
Open

error when storing build example in database #65

mehrancodes opened this issue Nov 10, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@mehrancodes
Copy link

Describe the bug
the issue is that I have a query in my API where I had to use some manual queries and when the enlighten wants to create a build example in DatabaseExampleBuilder@addQuery on 95 this is what happening:

enlighten error

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set @totalDuration=0, ?, ?, ?, ?, ?, ?, ?)' at line 1 (SQL: insert into `enlighten_example_queries` (`sql`, `bindings`, `time`, `request_id`, `snippet_id`, `example_id`, `updated_at`, `created_at`) values (set @totalDuration=0, [], 0.26, 1050, ?, 896, 2021-11-10 14:41:15, 2021-11-10 14:41:15))

my query

DB::statement(DB::raw('set @totalDuration=0'));

I have tried to fix it on my local simply by putting the value of $queryExecuted->sql inside a double quote so the QUERY getting stored as plain text and it worked.

I would send a PR soon if you think this change doesn't break the system.

@mehrancodes mehrancodes added the bug Something isn't working label Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant