.. _f-databasecore: module ``sql.database_core`` ============================ .. inheritance-diagram:: pyensae.sql.database_core Short summary +++++++++++++ module ``pyensae.sql.database_core`` :class:`Database` :githublink:`%|py|6` Classes +++++++ +----------------------------------------------------------------+-------------------------------------------+ | class | truncated documentation | +================================================================+===========================================+ | :class:`DatabaseCore ` | Core methods for class :class:`Database`. | +----------------------------------------------------------------+-------------------------------------------+ Static Methods ++++++++++++++ +-----------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ | staticmethod | truncated documentation | +=====================================================================================================+=======================================================================+ | :py:meth:`_special_function_init_ ` | | +-----------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ | :meth:`idaytodate ` | Date conversion. Static method to insert in a SQL query. | +-----------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ | :meth:`isectoday ` | Date conversion. Static method to insert in a SQL query. | +-----------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ | :meth:`itimestamp ` | Date conversion. Static method to insert in a SQL query. | +-----------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ | :meth:`regex_match ` | Applies a regular expression. Static method to insert in a SQL query. | +-----------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ | :meth:`string_to_date ` | Date conversion. Static method to insert in a SQL query. | +-----------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ Methods +++++++ +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | method | truncated documentation | +========================================================================================================+========================================================================================================================+ | :py:meth:`__init__ ` | Creates a database object. | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_analyse ` | Analyses the request does it contains cross product. | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_insert_sql ` | Builds the sql for an insert request. | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`add_function ` | Adds a function which can be used as any other SQL function (strim, ...). | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`attach_database ` | Attaches another database. | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`close ` | Closes the database. | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`commit ` | Calls this function after any insert request. | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`connect ` | Opens a connection to the database. | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`create_index ` | Creates an index on a table using some columns. | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`create_table ` | Creates a table. | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`execute ` | Opens a cursor with a query and return it to the user. | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`execute_script ` | Opens a cursor and run a script. | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`execute_view ` | Opens a cursor with a query and returns the result into a list. | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`get_attached_database_list ` | Returns all the attached database (avoid the temporary ones and the main one). | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`get_column_type ` | Returns the column type of a table. | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`get_file ` | Gets database file. | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`get_index_list ` | Returns the list of indexes. | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`get_index_on_table ` | Returns the list of indexes on a specific table. | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`get_sql_columns ` | Returns the columns name for a SQL request. | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`get_table_columns ` | See :meth:`get_table_columns_list`. Example (`dictionary == False`): | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`get_table_columns_list ` | Returns all the columns for a table. | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`get_table_list ` | Returns the list of tables. | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`get_table_nb_lines ` | Returns the number of lines in a table (or number of observations). | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`get_table_nfirst_lines ` | Returns the *n* first lines. | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`has_index ` | Says if the index belongs to the database. | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`has_table ` | Says if the table belongs to the database. | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`insert ` | Inserts into a table. | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`is_connected ` | Says if the database is connected. | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`isMemory ` | Tells if the Database takes place in memory (``:memory:``). | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`isMSSQL ` | Says if the syntax is MS SQL Server. | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`len ` | Returns the number of lines of table ``table``. | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`remove_table ` | Removes a table. | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`SetBufferInsert ` | This function offers the possibility to postpone the insertion, they will be processed all at the time during when ... | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`update ` | Updates some values ``WHERE key=value``. | +--------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ Documentation +++++++++++++ .. automodule:: pyensae.sql.database_core :members: :special-members: __init__ :show-inheritance: