Welcome to the documentation of the Query Abstraction Layer(QAL) package.

QAL is designed to be a general library of data, data mining and database management functions.



Abstraction of connectivity


The dal-module provides an API that strives to follow and be similar to the DBAPI2.0 specification. It does this by wrapping and simplifying use of the needed libraries.

Currently, it supports:

  • Postgresql through py-postgresql
  • MySQL through PyMySQL
  • Microsoft SQL Server through pyodbc
  • IBM DB/2 through pyodbc
  • Oracle through pyodbc

Abstraction of the SQL language.


The sql-module contains an object structure that mimics a subset of the structure of the SQL language. This object structure can be translated into an backend-specific SQL statement, which means that it can generate SQL that is adapted to the SQL-backend of the server.

XML schema, XML parsing and generation.


The sql_xml module can generate an XML Schema (SQL.xsd) file directly from the object structure of the sql module. Following that schema, it can export or import that structure as XML files.

This means that queries (the structure) can be saved and loaded between files and databases. Using its xml_file_to_sql function, they can even be called as functions with parameters.

Indices and tables