qal.tools package

Submodules

qal.tools.discover module

Created on Oct 30, 2013

@author: Nicklas Boerjesson

qal.tools.discover.discover_database_servers(_ip)[source]

Uses Nmap to scan the subnet of the specified IP-address for the following RDBMS: SQL Server, IBM DB2, MYSQL, Oracle and Postgres.

qal.tools.discover.discover_services(_ip, _ports, _verbose=False)[source]

Uses Nmap to scan the subnet of the specified IP-address for services on the specified ports

qal.tools.discover.get_python_versions(_style=None)[source]

Return the current version of python, styled in different ways: * major : 3 * minor : 3.4 * release : 3.4.4 * build : 3.4.4 build 1300

Parameters:_style – Style of the the result.
qal.tools.discover.import_error_to_help(_module, _err_obj, _pip_package, _apt_package, _win_package, _import_comment=None)[source]

Usable to create a helpful error message if a module is missing

qal.tools.discover.platform_to_int()[source]

Returns an integer depending on platform.

qal.tools.merge module

Created on Nov 3, 2013

@author: Nicklas Boerjesson

class qal.tools.merge.Merge(_xml_node=None)[source]

Bases: builtins.object

The merge class takes two datasets and merges them together.

apply_modifications(_shortcuts, _data_table)[source]
as_xml_node()[source]
clear_log()[source]
delete = None

If data that do not exist in the source should be deleted the destination.

destination = None

The destination dataset

destination_log_level = None

The log level to pass to the destination dataset

execute(_commit=True)[source]

Execute the merge and return the results.

Parameters:_commit – Actually save the result
Returns:The merged dataset, the destination log, deletes, inserts, updates
insert = None

If data that exists in the source should be inserted into the destination.

key_fields = None

A list of key field field indexes (in the destination dataset)

load_field_mappings_from_xml_node(_xml_node)[source]
load_from_xml_node(_xml_node)[source]
load_mappings_from_xml_node(_xml_node)[source]
load_settings_from_xml_node(_xml_node)[source]
mappings = None

A list of Mapping(qal.common.mapping) instances

post_execute_sql = None

An optional SQL that is exececute in the destination context, only applicable to RDBMS destinations

resources = None

A instance of a Resources object(see qal.common.resources)

set_max_identities_for_mappings(_shortcuts, _source_dataset, _destination_dataset)[source]

Loop through all mapping that uses identity

source = None

The source dataset

update = None

If rows that are different in the source should be updated in the destination

qal.tools.meta_queries module

Created on Oct 3, 2010

@author: Nicklas Boerjesson @note: This module contains functionality to retrieve metadata about databases and their objects. @todo: These SQL:s could be moved into an XML file(VerbCustom). The gain is yet somewhat marginal. They should not move in to the database due to versioning.

class qal.tools.meta_queries.Meta_Queries[source]

Bases: builtins.object

The meta queries class collects methods for gathering meta data about a database.

static oracle_all_sequences(_dal)[source]

Oracle specific: List all sequences in an Oracle database

Parameters:_dal – A connected instance of DatabaseAbstractionLayer (see qal.dal)
Returns:A list or sequence names
static table_info(_dal, _table_name)[source]

List columns in the specified table

Parameters:_table_name – The name of the table to list columns for
Returns:A list of column names
static table_list_by_database_name(_dal, _database_name)[source]

List tables in the specified database

Parameters:
  • _dal – A connected instance of DatabaseAbstractionLayer (see qal.dal)
  • _database_name – A database name
Returns:

A list of table names

static table_list_by_schema(_dal, _schema_name)[source]

List tables in the specified schema

Parameters:
  • _dal – A connected instance of DatabaseAbstractionLayer (see qal.dal)
  • _schema_name – A schema name
Returns:

A list of table names

Module contents