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

Verbose: max length #820

Open
Paultje52 opened this issue Jun 1, 2022 · 2 comments
Open

Verbose: max length #820

Paultje52 opened this issue Jun 1, 2022 · 2 comments

Comments

@Paultje52
Copy link

Hello,
I'm trying to use the "verbose" option to debug my code, however I'm running into a problem: the verbose option has a max length. When I want to debug large queries, I get this: UPDATE dataSETvalue='{"excelRead":{"Blad1":["Serial",'/*+13627 bytes*/ WHERE key = 'page-TNjmvagO3E' LIMIT 1.

Is there a way to disable that /*+13627 bytes*/ so I can read the whole SQL query? Thanks for your help in advance!

@Paultje52
Copy link
Author

Any update on my issue?

@Prinzhorn
Copy link
Contributor

Prinzhorn commented Jul 16, 2022

You can compile a custom version and set SQLITE_TRACE_SIZE_LIMIT and SQLITE_LIMIT_LENGTH to whatever size you need.

See:

https://www.sqlite.org/c3ref/expanded_sql.html
https://github.com/WiseLibs/better-sqlite3/blob/master/docs/compilation.md

char* expanded = sqlite3_expanded_sql(handle);

The sqlite3_expanded_sql() interface returns NULL if insufficient memory is available to hold the result, or if the result would exceed the the maximum string length determined by the SQLITE_LIMIT_LENGTH.
The SQLITE_TRACE_SIZE_LIMIT compile-time option limits the size of bound parameter expansions. The SQLITE_OMIT_TRACE compile-time option causes sqlite3_expanded_sql() to always return NULL.

I don't see these options being increased in the future for the default better-sqlite3.

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

No branches or pull requests

3 participants