forked from catherinedevlin/ipython-sql
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improves postgres compatibility + more granular feedback config (#798)
* improved support for postgres * fix * test updates * update changelog * typo * deletes old comment * adds a generic way to access the magic instance, the feedback config can hide the resultset footer * shorter displaylimit footer * feedback config controls displaying switching connections and current connection * update changelog * fix version * test fix * documentation updates * cleanup * moves data frame persist logic to connection, and creates method to handle sqlalchemy errors * fix * `--persist/--persist-replace` perform `ROLLBACK` automatically when needed * changelog * testing error when using --persist/--persist-replace with dbapi connections * testing --persist uses error handling method * adds some missing comments * fix * clean up __init__.py * adds missing docstrings * feedback doc update
- Loading branch information
1 parent
31fa726
commit ab891e1
Showing
17 changed files
with
505 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,7 @@ | ||
from sql.magic import RenderMagic, SqlMagic, load_ipython_extension | ||
from sql.connection import PLOOMBER_DOCS_LINK_STR | ||
from sql.magic import load_ipython_extension | ||
|
||
__version__ = "0.9.2dev" | ||
|
||
__version__ = "0.10.0dev" | ||
|
||
__all__ = [ | ||
"RenderMagic", | ||
"SqlMagic", | ||
"load_ipython_extension", | ||
"PLOOMBER_DOCS_LINK_STR", | ||
] | ||
|
||
__all__ = ["load_ipython_extension"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
"""Get/set the current SqlMagic instance.""" | ||
|
||
__sql_magic = None | ||
|
||
|
||
def _get_sql_magic(): | ||
"""Returns the current SqlMagic instance.""" | ||
if __sql_magic is None: | ||
raise RuntimeError("%sql has not been loaded yet. Run %load_ext sql") | ||
|
||
return __sql_magic | ||
|
||
|
||
def _set_sql_magic(sql_magic): | ||
"""Sets the current SqlMagic instance.""" | ||
global __sql_magic | ||
__sql_magic = sql_magic | ||
|
||
|
||
def _config_feedback_all(): | ||
"""Returns True if the current feedback level is >=2""" | ||
return _get_sql_magic().feedback >= 2 | ||
|
||
|
||
def _config_feedback_normal_or_more(): | ||
"""Returns True if the current feedback level is >=1""" | ||
return _get_sql_magic().feedback >= 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.