Django Debug Toolbar panel for SQLAlchemy.
Project description
Django Debug Toolbar panel for SQLAlchemy.
Free software: MIT license
GitHub: https://github.com/miki725/django-debug-toolbar-alchemy
Overview
This package completely mimics default Django Debug Toolbar SQL panel (internally its actually subclassed) but instead of displaying queries done via Django ORM, SQLAlchemy generated queries are displayed. Rest of the functionality is the same.
Installing
First install:
$ pip install django-debug-toolbar-alchemy
Then in your settings:
# settings.py DEBUG_TOOLBAR_PANELS = [ # other panels 'debug_toolbar_alchemy.panels.sql.SQLPanel', # other panels ]
In order to support multiple DB databases, alias getter callable must be specified in settings:
# settings.py DEBUG_TOOLBAR_CONFIG = { 'ALCHEMY_DB_ALIASES': '<dot patht to alias getter>', }
Alias getter must return a dictionary of aliases as keys and SQLAlchemy engines as values. If your application uses global session, you can get the engine from session instances:
from myapp.db import session, session_slave def alchemy_dbs(): return { 'default': session.bind, 'slave': session_slave.bind, }
History
0.1.5 (2018-09-04)
Fixed when multiparams are name synonyms in UPDATE statements.
Added support for similar queries added in debug toolbar base SQLPanel.
0.1.4 (2018-09-04)
Added template to be included in dist package.
0.1.3 (2018-09-03)
Added a way to run SELECT and EXPLAIN to queries in debug toolbar. Tested in sqlite, postgresql and oracle.
0.1.2 (2018-08-30)
Fix bug by attaching SQLAlchemy events at most once. Otherwise in some cases when multiple threads are used, event handlers deque would be mutated while other SQLAlchemy events are running since event handling is not thread-safe in SQA.
0.1.1 (2018-07-13)
Fix bug which did not correctly track plain string clauses.
0.1.0 (2017-10-04)
First release on PyPI.
Credits
Development Lead
Miroslav Shubernetskiy - https://github.com/miki725
Contributors
None yet. Why not be the first?
License
The MIT License (MIT) Copyright (c) 2017, Miroslav Shubernetskiy Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django-debug-toolbar-alchemy-0.1.5.tar.gz
.
File metadata
- Download URL: django-debug-toolbar-alchemy-0.1.5.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab289d1d5105a2008e10baca1bfc93314d613cd142d016d83a44306de1fbb7ce |
|
MD5 | 1be3e606992cc3103e04d4f72d8295d3 |
|
BLAKE2b-256 | b7928140a13e1e2bcad291887cfbb4bd7e86b96ef5f772e14c93c944ecec904b |
File details
Details for the file django_debug_toolbar_alchemy-0.1.5-py2.py3-none-any.whl
.
File metadata
- Download URL: django_debug_toolbar_alchemy-0.1.5-py2.py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70bfd9ae67d68a25b213e21014a01869f84f9edfad0dcfc43bf2511891972cc0 |
|
MD5 | c41dcef35f77ffd6fadfd4099f51cab4 |
|
BLAKE2b-256 | 487dad7c9fd5665639af01d1927c85c16dff42a05bff412a5275ca32aa8b7b40 |