-
Notifications
You must be signed in to change notification settings - Fork 158
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
allow to shorten long strings in sql logs #80
Comments
FWIW, I've just added an option to sqlparse to truncate long string literals (see andialbrecht/sqlparse@204b779). However, devserver still logs statements, that won't be parsed correctly by sqlparse to use this new option. Here's for example a statement from the log (added some line breaks for readability): UPDATE "django_session" SET "session_data" = OWExYWFiM2NjZDI0NTNlNDU3NDc0MTY2MTI3OTk3ODcyOWQ4NzY2ODqAAn1xAShVD2RqYW5nb19sYW5nd
WFnZVUCZGVVEl9hdXRoX3VzZXJfYmFja2VuZFUjZGxnaWNlcnQuYXV0aC5iYWNrZW5kcy5Nb2RlbEJhY2tlbm
RVDV9hdXRoX3VzZXJfaWRLFFUMb3JkZXJfc2VhcmNofXECKFUGc3RhdHVzSwFVBnJvd3NwcEsKdXUu,
"expire_date" = 2013-07-09 09:45:58.538040
WHERE "django_session"."session_key" = 5du9r23h5sl2kvqdlhumxsm7nu4r0qpo; Some quotes would be needed to make it valid SQL: UPDATE "django_session" SET "session_data" = 'OWExYWFiM2NjZDI0NTNlNDU3NDc0MTY2MTI3OTk3ODcyOWQ4NzY2ODqAAn1xAShVD2RqYW5nb19sYW5n
dWFnZVUCZGVVEl9hdXRoX3VzZXJfYmFja2VuZFUjZGxnaWNlcnQuYXV0aC5iYWNrZW5kcy5Nb2RlbEJhY2tlbm
RVDV9hdXRoX3VzZXJfaWRLFFUMb3JkZXJfc2VhcmNofXECKFUGc3RhdHVzSwFVBnJvd3NwcEsKdXUu',
"expire_date" = '2013-07-09 09:45:58.538040'
WHERE "django_session"."session_key" = '5du9r23h5sl2kvqdlhumxsm7nu4r0qpo'; With the corrected statement sqlparse would produce the following results:
Edit: Just noticed that this is related to #66 |
closing to get if off my plate on github |
when storing text blobs or larger sessions in the database,
the sql display gets pretty ugly due to a single string spanning so many lines
The text was updated successfully, but these errors were encountered: