.. _f-magicsql: module ``sql.magic_sql`` ======================== .. inheritance-diagram:: pyensae.sql.magic_sql Short summary +++++++++++++ module ``pyensae.sql.magic_sql`` Defines SQL commands to play with `sqlite3 `_. See notebook :ref:`pyensaesqlmagicrst`. :githublink:`%|py|7` Classes +++++++ +----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | class | truncated documentation | +====================================================+=============================================================================================================================================+ | :class:`MagicSQL ` | Defines SQL commands to play with `sqlite3 `_ See notebook :ref:`pyensaesqlmagicrst`. ... | +----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ Functions +++++++++ +-------------------------------------------------------------------------+---------------------------------------------------------+ | function | truncated documentation | +=========================================================================+=========================================================+ | :func:`register_sql_magics ` | register magics function, can be called from a notebook | +-------------------------------------------------------------------------+---------------------------------------------------------+ Properties ++++++++++ +--------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+ | property | truncated documentation | +======================================================================================+===============================================================================================================+ | :meth:`Context ` | return the context or None | +--------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+ | :meth:`cross_validation_lock ` | A contextmanager for running a block with our cross validation lock set to True. At the end of the block, ... | +--------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+ Static Methods ++++++++++++++ +------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------+ | staticmethod | truncated documentation | +======================================================================================================+========================================================================+ | :meth:`SQL_add_function_parser ` | defines the way to parse the magic command ``%SQL_add_function`` | +------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------+ | :meth:`SQL_close_parser ` | defines the way to parse the magic command ``%SQL_close`` | +------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------+ | :meth:`SQL_connect_parser ` | defines the way to parse the magic command ``%SQL_connect`` | +------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------+ | :meth:`SQL_drop_table_parser ` | defines the way to parse the magic command ``%SQL_drop_table`` | +------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------+ | :meth:`SQL_import_df_parser ` | defines the way to parse the magic command ``%SQL_import_df`` | +------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------+ | :meth:`SQL_import_tsv_parser ` | defines the way to parse the magic command ``%SQL_import_tsv`` | +------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------+ | :meth:`SQL_parser ` | defines the way to parse the magic command ``%%SQL`` | +------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------+ | :meth:`SQL_refresh_completion_parser ` | defines the way to parse the magic command ``%SQL_refresh_completion`` | +------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------+ | :meth:`SQL_schema_parser ` | defines the way to parse the magic command ``%SQL_schema`` | +------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------+ | :meth:`SQL_tables_parser ` | defines the way to parse the magic command ``%SQL_tables`` | +------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------+ Methods +++++++ +----------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | method | truncated documentation | +========================================================================================+======================================================================================================================+ | :meth:`get_connection ` | returns the connection stored in the workspace | +----------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | :meth:`SQL ` | defines command ``%%SQL`` | +----------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | :meth:`SQL_add_function ` | defines ``%SQL_add_function`` which adds a function to the database | +----------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | :meth:`SQL_close ` | define ``SQL_close`` which closes a database | +----------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | :meth:`SQL_connect ` | define ``SQL_connect`` which connects to a SQL database, it stores the database object in variable DB by default ... | +----------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | :meth:`SQL_drop_table ` | defines ``%SQL_drop_table`` which drops a table from a database | +----------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | :meth:`SQL_import_df ` | defines ``%SQL_import_df`` which imports a dataframe into a database | +----------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | :meth:`SQL_import_tsv ` | defines ``%SQL_import_tsv`` whichs import a TSV file into a database | +----------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | :meth:`SQL_refresh_completion ` | defines ``%SQL_refresh_completion`` | +----------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | :meth:`SQL_schema ` | define ``SQL_schema`` | +----------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | :meth:`SQL_tables ` | define ``%SQL_tables`` whichs lists the tables in a database | +----------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ Documentation +++++++++++++ .. automodule:: pyensae.sql.magic_sql :members: :special-members: __init__ :show-inheritance: