Package gavo :: Package protocols :: Module adqlglue
[frames] | no frames]

Module adqlglue

source code

Code to bind the adql library to the data center software.

Classes
  TDContext
An object keeping track of the generation of a table definition for ADQL output.
  DaCHSFieldInfoGetter
  ADQLCore
A core taking an ADQL query from its query argument and returning the result of that query in a standard table.
Functions
 
makeFieldInfo(column, sqlName=None)
returns an adql.tree.FieldInfo object from a rscdef.Column.
source code
 
adqlTableRefToDaCHS(tableName)
returns a DaCHS-internal table name suitable for dc.tablemeta for an ADQL TableName node.
source code
 
morphADQL(query, metaProfile=None, tdsForUploads=[], maxrec=None, hardLimit=None)
returns an postgres query and an (empty) result table for the ADQL in query.
source code
 
query(querier, query, timeout=15, metaProfile=None, tdsForUploads=[], externalLimit=None, hardLimit=None)
returns a DataSet for query (a string containing ADQL).
source code
 
mapADQLErrors(excType, excValue, excTb) source code
 
localquery()
run the argument as an ADQL query.
source code
Variables
  __package__ = 'gavo.protocols'
Function Details

adqlTableRefToDaCHS(tableName)

source code 

returns a DaCHS-internal table name suitable for dc.tablemeta for an ADQL TableName node.

In particular, in DaCHS we don't support catalog, so that errors out immediately. Also, we don't support delimited table identifiers. Anything delimited not consisting exclusively of lower case letters must therefore fail immediately. When they're all lowercase, people engaged in gratuitous quoting. Then, just unquote and move on.

morphADQL(query, metaProfile=None, tdsForUploads=[], maxrec=None, hardLimit=None)

source code 

returns an postgres query and an (empty) result table for the ADQL in query.

For an explanation of maxrec and hardLimit, as well as the additional table.tableDef.overflowLimit attribute on the returned table, see _updateMatchLimits above; this will always be an integer.

query(querier, query, timeout=15, metaProfile=None, tdsForUploads=[], externalLimit=None, hardLimit=None)

source code 

returns a DataSet for query (a string containing ADQL).

This will set timeouts and other things for the connection in question. You should have one allocated especially for this query.