Public Member Functions | |
def | __init__ |
def | bulkInsert |
def | deleteRows |
def | dropTable |
def | existRow |
def | insertOneRow |
def | tableExists |
Private Attributes | |
__schema |
def python::DBImpl::DBImpl::__init__ | ( | self, | |
schema | |||
) |
def python::DBImpl::DBImpl::bulkInsert | ( | self, | |
tableName, | |||
tabrowDefDict, | |||
bulkinput | |||
) |
Bulk insert bulkinput=[{}]
Definition at line 41 of file DBImpl.py.
00042 : 00043 """Bulk insert bulkinput=[{}] 00044 """ 00045 try: 00046 dataEditor=self.__schema.tableHandle(tableName).dataEditor() 00047 insertdata=coral.AttributeList() 00048 for (columnname,columntype) in tabrowDefDict.items(): 00049 insertdata.extend(columnname,columntype) 00050 00051 bulkOperation=dataEditor.bulkInsert(insertdata,len(bulkinput)) 00052 for valuedict in bulkinput: 00053 for (columnname,columnvalue) in valuedict.items(): 00054 insertdata[columnname].setData(columnvalue) 00055 bulkOperation.processNextIteration() 00056 bulkOperation.flush() 00057 del bulkOperation 00058 except Exception, e: raise Exception, str(e)
def python::DBImpl::DBImpl::deleteRows | ( | self, | |
tableName, | |||
condition, | |||
conditionbindDict | |||
) |
Delete row(s)
def python::DBImpl::DBImpl::dropTable | ( | self, | |
tableName | |||
) |
def python::DBImpl::DBImpl::existRow | ( | self, | |
tableName, | |||
condition, | |||
conditionbindDict | |||
) |
Return true if one row fulfills the selection criteria
Definition at line 11 of file DBImpl.py.
00012 : 00013 """Return true if one row fulfills the selection criteria 00014 """ 00015 try: 00016 tableHandle = self.__schema.tableHandle(tableName) 00017 query = tableHandle.newQuery() 00018 query.setCondition(condition,conditionbindDict) 00019 cursor = query.execute() 00020 result=False 00021 while ( cursor.next() ): 00022 result=True 00023 cursor.close() 00024 del query 00025 return result 00026 except Exception, e: raise Exception, str(e)
def python::DBImpl::DBImpl::insertOneRow | ( | self, | |
tableName, | |||
tabrowDefDict, | |||
tabrowValueDict | |||
) |
Insert row
Definition at line 27 of file DBImpl.py.
00028 : 00029 """Insert row 00030 """ 00031 try: 00032 tableHandle = self.__schema.tableHandle(tableName) 00033 editor = tableHandle.dataEditor() 00034 inputData = coral.AttributeList() 00035 for name,type in tabrowDefDict.items(): 00036 # print name, type 00037 inputData.extend( name, type ) 00038 inputData[name].setData(tabrowValueDict[name]) 00039 editor.insertRow( inputData ) 00040 except Exception, e: raise Exception, str(e)
def python::DBImpl::DBImpl::tableExists | ( | self, | |
tableName | |||
) |
python::DBImpl::DBImpl::__schema [private] |