gavo.protocols.adqlglue module

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

class gavo.protocols.adqlglue.ADQLCore(parent, **kwargs)[source]

Bases: gavo.svcs.core.Core, gavo.base.structure.RestrictionMixin

A core taking an ADQL query from its query argument and returning the result of that query in a standard table.

Since the columns returned depend on the query, the outputTable of an ADQL core must not be defined.

attrSeq = [<gavo.base.parsecontext.IdAttribute object>, <gavo.base.complexattrs.StructAttribute object>, <gavo.base.parsecontext.OriginalAttribute object>, <gavo.base.complexattrs.StructAttribute object>, <gavo.base.complexattrs.PropertyAttribute object>, <gavo.rscdef.common.RDAttribute object>]
completedCallbacks = []
getProperty(name, default=<Undefined>)
managedAttrs = {'id': <gavo.base.parsecontext.IdAttribute object>, 'inputTable': <gavo.base.complexattrs.StructAttribute object>, 'original': <gavo.base.parsecontext.OriginalAttribute object>, 'outputTable': <gavo.base.complexattrs.StructAttribute object>, 'properties': <gavo.base.complexattrs.PropertyAttribute object>, 'property': <gavo.base.complexattrs.PropertyAttribute object>, 'rd': <gavo.rscdef.common.RDAttribute object>}
name_ = 'adqlCore'
property rd
run(service, inputTable, queryMeta)[source]
setProperty(name, value)
class gavo.protocols.adqlglue.DaCHSFieldInfoGetter(accessProfile=None, tdsForUploads=[])[source]

Bases: gavo.adql.common.FieldInfoGetter

class gavo.protocols.adqlglue.TDContext[source]

Bases: object

An object keeping track of the generation of a table definition for ADQL output.


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.


run the argument as an ADQL query.

gavo.protocols.adqlglue.makeFieldInfo(column, sqlName=None)[source]

returns an adql.tree.FieldInfo object from a rscdef.Column.

gavo.protocols.adqlglue.mapADQLErrors(excType, excValue, excTb)[source]
gavo.protocols.adqlglue.morphADQL(query, metaProfile=None, tdsForUploads=[], maxrec=None, hardLimit=None)[source]

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.

gavo.protocols.adqlglue.query(adqlQuery, timeout=15, metaProfile=None, tdsForUploads=[], externalLimit=None, hardLimit=None)[source]

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

This is a legacy wrapper for runTAPQuery used by the ADQL web form. Don’t use it anywhere else.

gavo.protocols.adqlglue.runTAPQuery(query, timeout, connection, tdsForUploads, maxrec, autoClose=True)[source]

executes a TAP query and returns the result in a data instance.