Classes | Functions | Variables
pyclearsilver.odb Namespace Reference

Classes

class  _ODB_BigString
 
class  _ODB_Blob
 
class  _ODB_CreatedStamp
 
class  _ODB_CreatedStampMS
 
class  _ODB_DateTime
 
class  _ODB_Enumeration
 
class  _ODB_FixedString
 
class  _ODB_GUID
 
class  _ODB_IncInteger
 
class  _ODB_Integer
 
class  _ODB_ModifiedStamp
 
class  _ODB_Object
 
class  _ODB_Real
 
class  _ODB_TimeStamp
 
class  _ODB_VarString
 
class  _ReflectTable
 
More...
 
class  Connection
 
class  Cursor
 
class  Database
 
class  eDuplicateKey
 
class  eInternalError
 
class  eInvalidData
 
class  eInvalidJoinSpec
 
class  eInvalidMatchSpec
 
class  eNoMatchingRows
 
class  eNonUniqueMatchSpec
 
class  eNoSuchColumn
 
class  eUnsavedObjectLost
 
class  odb_Exception
 
class  ODB_FixedPoint
 
class  Replication_DeletedTable
 
class  Replication_KeyValueTable
 
class  Replication_LogRow
 
class  Replication_LogTable
 
class  ReplicationLog
 
More...
 
class  Row
 
class  Table
 Table. More...
 

Functions

def __del__ (self)
 --— utility stuff -------------------------------— More...
 
def __deleteRow (self, a_row, cursor=None)
 
def __delitem__ (self, key, data)
 
def __getattr__ (self,key)
 -— class emulation -----------------------------— More...
 
def __getitem__ (self, tblname)
 
def __insertRow (self, a_row_obj, cursor=None, replace=0)
 
def __len__ (self)
 
def __packVColumn (self)
 #warn(self) val2 = self.getDB().decode(val) warn("val2", repr(val2)) self.__vcoldata = marshal.loads(val2) More...
 
def __repr__ (self)
 
def __setattr__ (self, key, val)
 
def __setitem__ (self, key, data)
 
def __updateRowList (self, a_row_list, cursor=None)
 
def _getRaw (self, key, convert=1)
 -— dict emulation ------------------------------— More...
 
def beginTransaction (self, cursor=None)
 
def changedList (self)
 changedList() More...
 
def checkRowActive (self)
 
def commitTransaction (self, cursor=None)
 
def copyFrom (self, source)
 
def createIndices (self)
 self.alterTableToMatch(tbl) More...
 
def createTables (self)
 schema creation code More...
 
def createTrigger (self, triggerName, sql, cursor=None)
 
def createTriggers (self)
 
def databaseSizeForColumn (self, key)
 
def delete (self, cursor=None)
 
def deleteRow (self, col_match_spec, where=None)
 deleteRow(col_match_spec) More...
 
def discard (self)
 
def dropIndices (self)
 
def dropTrigger (self, triggerName, cursor=None)
 
def fetchAllRows (self, join2=None)
 fetchAllRows() More...
 
def fetchRow (self, col_match_spec, cursor=None, join2=None)
 fetchRow(col_match_spec) More...
 
def fetchRowCount (self, col_match_spec=None, cursor=None, where=None)
 
def fetchRows (self, col_match_spec=None, cursor=None, where=None, order_by=None, limit_to=None, skip_to=None, join=None, join2=None, column_list=None, raw_rows=False)
 fetchRows(col_match_spec) More...
 
def fetchRowUsingPrimaryKey (self, args)
 
def fillDefaults (self)
 

real interface More...

 
def get (self, key, default=None)
 
def has_key (self, key)
 
def inc (self, key, count=1)
 
def items (self)
 
def keys (self)
 
def listFields (self, table_name, cursor=None)
 
def listFieldsDict (self, table_name, cursor=None)
 
def listIndices (self, tableName, cursor=None)
 
def listTables (self, cursor=None)
 
def listTriggers (self, cursor=None)
 
def lookup (self, join2=None, kws)
 
def lookupCreate (self, kws)
 
def lookupRows (self, join2=None, kws)
 
def newRow (self, replace=0, save=0, kws)
 
def parseFieldType (dataStr)
 
def r_deleteRow (self, a_row_obj, cursor=None)
 r_deleteRow(a_row_obj,cursor = None) More...
 
def r_insertRow (self, a_row_obj, cursor=None, replace=0)
 InsertRow(a_row_obj,cursor = None) More...
 
def r_updateRow (self, a_row_obj, cursor=None)
 r_updateRow(a_row_obj,cursor = None) More...
 
def reflect (self)
 parse the schema of an existing db and build table objects to reflect the schema. More...
 
def repl_parsePrimaryKey (key)
 
def rollbackTransaction (self, cursor=None)
 
def save (self, cursor=None)
 
def synchronizeSchema (self)
 
def values (elf)
 

Variables

 __colchanged_dict
 
 __coldata
 
 __vcolchanged
 
 __vcoldata
 
 _cursor
 
 _inside_getattr
 
 _rowInactive
 
 _should_insert
 
 _should_replace
 
 _tables
 for name, tbl in self._tables.items(): tbl.db = None More...
 
 all_rows = cursor.fetchall()
 
 aval = a_row[col_num]
 
 c_name
 
 c_options
 
 c_type
 
int col_num = 0
 
 conn
 
 cursor = self.defaultCursor()
 
dictionary data_dict = {}
 bug out is the user justs want the raw rows More...
 
int DEBUG = 0
 kInteger = "kInteger" # - kFixedString = "kFixedString" # size kVarString = "kVarString" # maxsize kBigString = "kBigString" # - kIncInteger = "kIncInteger" # - kDateTime = "kDateTime" kTimeStamp = "kTimeStamp" kReal = "kReal" More...
 
 kBigString = _ODB_BigString()
 
 kBlob = _ODB_Blob()
 
 kCreatedStamp = _ODB_CreatedStamp()
 
 kCreatedStampMS = _ODB_CreatedStampMS()
 
 kDateTime = _ODB_DateTime()
 
 kEnumeration = _ODB_Enumeration()
 
 kFixedPoint = ODB_FixedPoint()
 
 kFixedString = _ODB_FixedString()
 
 kGUID = _ODB_GUID()
 
 kIncInteger = _ODB_IncInteger()
 
 kInteger = _ODB_Integer()
 
 kModifiedStamp = _ODB_ModifiedStamp()
 
 kReal = _ODB_Real()
 
 kTimeStamp = _ODB_TimeStamp()
 
 kVarString = _ODB_VarString()
 
 name = parts[1]
 
 newrowobj = self.__defaultRowClass(self,data_dict,joined_cols = joined_cols)
 
 parts = string.split(fullname, ".", 1)
 
 return_rows = self.__defaultRowListClass()
 
string sql = sql+" LIMIT %s OFFSET %s "
 log("limit,skip = %s,%s" % (limit_to,skip_to)) More...
 
 table = parts[0]
 

Function Documentation

def pyclearsilver.odb.__del__ (   self)

--— utility stuff -------------------------------—

Definition at line 504 of file odb.py.

def pyclearsilver.odb.__deleteRow (   self,
  a_row,
  cursor = None 
)
private

Definition at line 1500 of file odb.py.

def pyclearsilver.odb.__delitem__ (   self,
  key,
  data 
)

Definition at line 2082 of file odb.py.

def pyclearsilver.odb.__getattr__ (   self,
  key 
)

-— class emulation -----------------------------—

Definition at line 517 of file odb.py.

def pyclearsilver.odb.__getitem__ (   self,
  tblname 
)

Definition at line 507 of file odb.py.

def pyclearsilver.odb.__insertRow (   self,
  a_row_obj,
  cursor = None,
  replace = 0 
)
private

Definition at line 1584 of file odb.py.

def pyclearsilver.odb.__len__ (   self)

Definition at line 2147 of file odb.py.

def pyclearsilver.odb.__packVColumn (   self)
private

#warn(self) val2 = self.getDB().decode(val) warn("val2", repr(val2)) self.__vcoldata = marshal.loads(val2)

Definition at line 1960 of file odb.py.

def pyclearsilver.odb.__repr__ (   self)

Definition at line 1979 of file odb.py.

def pyclearsilver.odb.__setattr__ (   self,
  key,
  val 
)

Definition at line 1999 of file odb.py.

def pyclearsilver.odb.__setitem__ (   self,
  key,
  data 
)

Definition at line 2058 of file odb.py.

def pyclearsilver.odb.__updateRowList (   self,
  a_row_list,
  cursor = None 
)
private

Definition at line 1518 of file odb.py.

def pyclearsilver.odb._getRaw (   self,
  key,
  convert = 1 
)
private

-— dict emulation ------------------------------—

Definition at line 2016 of file odb.py.

def pyclearsilver.odb.beginTransaction (   self,
  cursor = None 
)

Definition at line 527 of file odb.py.

def pyclearsilver.odb.changedList (   self)

changedList()

returns a list of tuples for the columns which have changed

changedList() -> [ ('name', 'fred'), ('age', 20) ]

Definition at line 2221 of file odb.py.

def pyclearsilver.odb.checkRowActive (   self)

Definition at line 2264 of file odb.py.

def pyclearsilver.odb.commitTransaction (   self,
  cursor = None 
)

Definition at line 534 of file odb.py.

def pyclearsilver.odb.copyFrom (   self,
  source 
)

Definition at line 2097 of file odb.py.

def pyclearsilver.odb.createIndices (   self)

self.alterTableToMatch(tbl)

Definition at line 566 of file odb.py.

def pyclearsilver.odb.createTables (   self)

schema creation code

Definition at line 552 of file odb.py.

def pyclearsilver.odb.createTrigger (   self,
  triggerName,
  sql,
  cursor = None 
)

Definition at line 597 of file odb.py.

def pyclearsilver.odb.createTriggers (   self)

Definition at line 582 of file odb.py.

def pyclearsilver.odb.databaseSizeForColumn (   self,
  key 
)

Definition at line 2268 of file odb.py.

def pyclearsilver.odb.delete (   self,
  cursor = None 
)

Definition at line 2237 of file odb.py.

def pyclearsilver.odb.deleteRow (   self,
  col_match_spec,
  where = None 
)

deleteRow(col_match_spec)

The col_match_spec paramaters must include all primary key columns.

Ex: a_row = tbl.fetchRow( ("order_id", 1) ) a_row = tbl.fetchRow( [ ("order_id", 1), ("enterTime", now) ] )

Definition at line 1714 of file odb.py.

def pyclearsilver.odb.discard (   self)

Definition at line 2231 of file odb.py.

def pyclearsilver.odb.dropIndices (   self)

Definition at line 575 of file odb.py.

def pyclearsilver.odb.dropTrigger (   self,
  triggerName,
  cursor = None 
)

Definition at line 601 of file odb.py.

def pyclearsilver.odb.fetchAllRows (   self,
  join2 = None 
)

fetchAllRows()

Ex: a_row_list = tbl.fetchRows( ("order_id", 1) ) a_row_list = tbl.fetchRows( [ ("order_id", 1), ("enterTime", now) ] )

Definition at line 1803 of file odb.py.

def pyclearsilver.odb.fetchRow (   self,
  col_match_spec,
  cursor = None,
  join2 = None 
)

fetchRow(col_match_spec)

The col_match_spec paramaters must include all primary key columns.

Ex: a_row = tbl.fetchRow( ("order_id", 1) ) a_row = tbl.fetchRow( [ ("order_id", 1), ("enterTime", now) ] )

Definition at line 1738 of file odb.py.

def pyclearsilver.odb.fetchRowCount (   self,
  col_match_spec = None,
  cursor = None,
  where = None 
)

Definition at line 1779 of file odb.py.

def pyclearsilver.odb.fetchRows (   self,
  col_match_spec = None,
  cursor = None,
  where = None,
  order_by = None,
  limit_to = None,
  skip_to = None,
  join = None,
  join2 = None,
  column_list = None,
  raw_rows = False 
)

fetchRows(col_match_spec)

Ex: a_row_list = tbl.fetchRows( ("order_id", 1) ) a_row_list = tbl.fetchRows( [ ("order_id", 1), ("enterTime", now) ] )

Definition at line 1764 of file odb.py.

def pyclearsilver.odb.fetchRowUsingPrimaryKey (   self,
  args 
)

Definition at line 1824 of file odb.py.

def pyclearsilver.odb.fillDefaults (   self)


real interface

Definition at line 2208 of file odb.py.

def pyclearsilver.odb.get (   self,
  key,
  default = None 
)

Definition at line 2169 of file odb.py.

def pyclearsilver.odb.has_key (   self,
  key 
)

Definition at line 2157 of file odb.py.

def pyclearsilver.odb.inc (   self,
  key,
  count = 1 
)

Definition at line 2190 of file odb.py.

def pyclearsilver.odb.items (   self)

Definition at line 2120 of file odb.py.

def pyclearsilver.odb.keys (   self)

Definition at line 2105 of file odb.py.

def pyclearsilver.odb.listFields (   self,
  table_name,
  cursor = None 
)

Definition at line 643 of file odb.py.

def pyclearsilver.odb.listFieldsDict (   self,
  table_name,
  cursor = None 
)

Definition at line 639 of file odb.py.

def pyclearsilver.odb.listIndices (   self,
  tableName,
  cursor = None 
)

Definition at line 634 of file odb.py.

def pyclearsilver.odb.listTables (   self,
  cursor = None 
)

Definition at line 626 of file odb.py.

def pyclearsilver.odb.listTriggers (   self,
  cursor = None 
)

Definition at line 630 of file odb.py.

def pyclearsilver.odb.lookup (   self,
  join2 = None,
  kws 
)

Definition at line 1838 of file odb.py.

def pyclearsilver.odb.lookupCreate (   self,
  kws 
)

Definition at line 1860 of file odb.py.

def pyclearsilver.odb.lookupRows (   self,
  join2 = None,
  kws 
)

Definition at line 1849 of file odb.py.

def pyclearsilver.odb.newRow (   self,
  replace = 0,
  save = 0,
  kws 
)

Definition at line 1810 of file odb.py.

def pyclearsilver.odb.parseFieldType (   dataStr)

Definition at line 318 of file odb.py.

def pyclearsilver.odb.r_deleteRow (   self,
  a_row_obj,
  cursor = None 
)

r_deleteRow(a_row_obj,cursor = None)

normally this is called from within the Row "delete()" method but you can call it yourself if you want

Definition at line 1670 of file odb.py.

def pyclearsilver.odb.r_insertRow (   self,
  a_row_obj,
  cursor = None,
  replace = 0 
)

InsertRow(a_row_obj,cursor = None)

normally this is called from within the Row "save()" method but you can call it yourself if you want

Definition at line 1693 of file odb.py.

def pyclearsilver.odb.r_updateRow (   self,
  a_row_obj,
  cursor = None 
)

r_updateRow(a_row_obj,cursor = None)

normally this is called from within the Row "save()" method but you can call it yourself if you want

Definition at line 1682 of file odb.py.

def pyclearsilver.odb.reflect (   self)

parse the schema of an existing db and build table objects to reflect the schema.

Definition at line 608 of file odb.py.

def pyclearsilver.odb.repl_parsePrimaryKey (   key)

Definition at line 2404 of file odb.py.

def pyclearsilver.odb.rollbackTransaction (   self,
  cursor = None 
)

Definition at line 541 of file odb.py.

def pyclearsilver.odb.save (   self,
  cursor = None 
)

Definition at line 2247 of file odb.py.

def pyclearsilver.odb.synchronizeSchema (   self)

Definition at line 614 of file odb.py.

def pyclearsilver.odb.values (   elf)

Definition at line 2136 of file odb.py.

Variable Documentation

pyclearsilver.odb.__colchanged_dict
private

Definition at line 2234 of file odb.py.

pyclearsilver.odb.__coldata
private

Definition at line 2232 of file odb.py.

pyclearsilver.odb.__vcolchanged
private

Definition at line 2071 of file odb.py.

pyclearsilver.odb.__vcoldata
private

Definition at line 2233 of file odb.py.

pyclearsilver.odb._cursor
private

Definition at line 498 of file odb.py.

pyclearsilver.odb._inside_getattr
private

Definition at line 1988 of file odb.py.

pyclearsilver.odb._rowInactive
private

Definition at line 2243 of file odb.py.

pyclearsilver.odb._should_insert
private

Definition at line 2254 of file odb.py.

pyclearsilver.odb._should_replace
private

Definition at line 2255 of file odb.py.

pyclearsilver.odb._tables
private

for name, tbl in self._tables.items(): tbl.db = None

Definition at line 493 of file odb.py.

pyclearsilver.odb.all_rows = cursor.fetchall()

Definition at line 1458 of file odb.py.

pyclearsilver.odb.aval = a_row[col_num]

Definition at line 1483 of file odb.py.

pyclearsilver.odb.c_name

Definition at line 1479 of file odb.py.

pyclearsilver.odb.c_options

Definition at line 1479 of file odb.py.

pyclearsilver.odb.c_type

Definition at line 1479 of file odb.py.

int pyclearsilver.odb.col_num = 0

Definition at line 1465 of file odb.py.

pyclearsilver.odb.conn

Definition at line 502 of file odb.py.

pyclearsilver.odb.cursor = self.defaultCursor()

Definition at line 496 of file odb.py.

dictionary pyclearsilver.odb.data_dict = {}

bug out is the user justs want the raw rows

Definition at line 1463 of file odb.py.

int pyclearsilver.odb.DEBUG = 0

kInteger = "kInteger" # - kFixedString = "kFixedString" # size kVarString = "kVarString" # maxsize kBigString = "kBigString" # - kIncInteger = "kIncInteger" # - kDateTime = "kDateTime" kTimeStamp = "kTimeStamp" kReal = "kReal"

kEnumeration = "kEnumeration" # -

Definition at line 118 of file odb.py.

pyclearsilver.odb.kBigString = _ODB_BigString()

Definition at line 305 of file odb.py.

pyclearsilver.odb.kBlob = _ODB_Blob()

Definition at line 306 of file odb.py.

pyclearsilver.odb.kCreatedStamp = _ODB_CreatedStamp()

Definition at line 311 of file odb.py.

pyclearsilver.odb.kCreatedStampMS = _ODB_CreatedStampMS()

Definition at line 312 of file odb.py.

pyclearsilver.odb.kDateTime = _ODB_DateTime()

Definition at line 307 of file odb.py.

pyclearsilver.odb.kEnumeration = _ODB_Enumeration()

Definition at line 315 of file odb.py.

pyclearsilver.odb.kFixedPoint = ODB_FixedPoint()

Definition at line 297 of file odb.py.

pyclearsilver.odb.kFixedString = _ODB_FixedString()

Definition at line 303 of file odb.py.

pyclearsilver.odb.kGUID = _ODB_GUID()

Definition at line 316 of file odb.py.

pyclearsilver.odb.kIncInteger = _ODB_IncInteger()

Definition at line 302 of file odb.py.

pyclearsilver.odb.kInteger = _ODB_Integer()

Definition at line 301 of file odb.py.

pyclearsilver.odb.kModifiedStamp = _ODB_ModifiedStamp()

Definition at line 310 of file odb.py.

pyclearsilver.odb.kReal = _ODB_Real()

Definition at line 314 of file odb.py.

pyclearsilver.odb.kTimeStamp = _ODB_TimeStamp()

Definition at line 308 of file odb.py.

pyclearsilver.odb.kVarString = _ODB_VarString()

Definition at line 304 of file odb.py.

pyclearsilver.odb.name = parts[1]

Definition at line 1472 of file odb.py.

pyclearsilver.odb.newrowobj = self.__defaultRowClass(self,data_dict,joined_cols = joined_cols)

Definition at line 1493 of file odb.py.

pyclearsilver.odb.parts = string.split(fullname, ".", 1)

Definition at line 1470 of file odb.py.

pyclearsilver.odb.return_rows = self.__defaultRowListClass()

Definition at line 1455 of file odb.py.

string pyclearsilver.odb.sql = sql+" LIMIT %s OFFSET %s "

log("limit,skip = %s,%s" % (limit_to,skip_to))

Definition at line 1436 of file odb.py.

pyclearsilver.odb.table = parts[0]

Definition at line 1471 of file odb.py.



pyclearsilver
Author(s): Scott Noob Hassan
autogenerated on Mon Jun 10 2019 15:51:13