DIRACGrid/DIRAC — pull request #669 by graciani (2012-04-13 22:53:00+00:00)
Title: New for v6r4: MySQL

With new high level public methods:

buildCondition( self, condDict = None, older = None, newer = None,
timeStamp = None, orderAttribute = None, limit = False ):

Build SQL condition statement from provided condDict and other extra check on
a specified time stamp.
The conditions dictionary specifies for each attribute one or a List of possible values

For compatibility with current usage it uses Exceptions to exit in case of
invalid arguments

insertFields( self, tableName, inFields = None, inValues = None, conn = None ):

Insert a new row in "tableName" assigning the values "inValues" to the
fields "inFields".
String type values will be appropriately escaped.

updateFields( self, tableName, updateFields = None, updateValues = None,
condDict = None,
limit = False, conn = None,
older = None, newer = None,
timeStamp = None, orderAttribute = None ):

Update "updateFields" from "tableName" with "updateValues".
N records can match the condition condDict
return S_OK( tuple(Field,Value) )
if limit is not False, the given limit is set

deleteEntries( self, tableName,
condDict = None,
limit = False, conn = None,
older = None, newer = None,
timeStamp = None, orderAttribute = None ):

Delete rows from "tableName" with condDict
N records can match the condition
if limit is not False, the given limit is set

getFields( self, tableName, outFields = None,
condDict = None,
limit = False, conn = None,
older = None, newer = None,
timeStamp = None, orderAttribute = None ):

Select "outFields" from "tableName" with condDict
N records can match the condition
return S_OK( tuple(Field,Value) )
if outFields == None all fields in "tableName" are returned
if limit is not False, the given limit is set

getCounters( self, table, attrList, condDict = None, older = None,
newer = None, timeStamp = None, connection = False ):

Count the number of records on each distinct combination of AttrList, selected
with condition defined by condDict and time stamps

getDistinctAttributeValues( self, table, attribute, condDict = None, older = None,
newer = None, timeStamp = None, connection = False ):

Get distinct values of a table attribute under specified conditions