rpki.sql.sql_persistent Class Reference
Inherits
object.
Inherited by rpki.left_right.data_elt, rpki.publication.control_elt, rpki.rpki_engine.ca_detail_obj, rpki.rpki_engine.ca_obj, rpki.rpki_engine.child_cert_obj, rpki.rpki_engine.revoked_cert_obj, and rpki.rpki_engine.roa_obj.
List of all members.
Detailed Description
Mixin for persistent class that needs to be stored in SQL.
Definition at line 140 of file sql.py.
Member Function Documentation
def rpki.sql.sql_persistent.sql_decode |
( |
|
self, |
|
|
|
vals | |
|
) |
| | |
Initialize an object with values returned by self.sql_fetch().
This is a default version that assumes a one-to-one mapping
between column names in SQL and attribute names in Python. If you
need something fancier, override this.
Reimplemented in rpki.rpki_engine.ca_detail_obj.
Definition at line 308 of file sql.py.
def rpki.sql.sql_persistent.sql_delete |
( |
|
self |
) |
|
Delete this object from SQL.
Definition at line 281 of file sql.py.
def rpki.sql.sql_persistent.sql_delete_hook |
( |
|
self |
) |
|
def rpki.sql.sql_persistent.sql_encode |
( |
|
self |
) |
|
Convert object attributes into a dict for use with canned SQL
queries. This is a default version that assumes a one-to-one
mapping between column names in SQL and attribute names in Python.
If you need something fancier, override this.
Definition at line 295 of file sql.py.
def rpki.sql.sql_persistent.sql_fetch |
( |
|
cls, |
|
|
|
gctx, |
|
|
|
id | |
|
) |
| | |
Fetch one object from SQL, based on its primary key.
Since in this one case we know that the primary index is also the
cache key, we check for a cache hit directly in the hope of
bypassing the SQL lookup entirely.
This method is usually called via a one-line class-specific
wrapper. As a convenience, we also accept an id of None, and just
return None in this case.
Definition at line 161 of file sql.py.
def rpki.sql.sql_persistent.sql_fetch_all |
( |
|
cls, |
|
|
|
gctx | |
|
) |
| | |
Fetch all objects of this type from SQL.
Definition at line 199 of file sql.py.
def rpki.sql.sql_persistent.sql_fetch_hook |
( |
|
self |
) |
|
def rpki.sql.sql_persistent.sql_fetch_where |
( |
|
cls, |
|
|
|
gctx, |
|
|
|
where, |
|
|
|
args = None , |
|
|
|
also_from = None | |
|
) |
| | |
Fetch objects of this type matching an arbitrary SQL WHERE expression.
Definition at line 204 of file sql.py.
def rpki.sql.sql_persistent.sql_fetch_where1 |
( |
|
cls, |
|
|
|
gctx, |
|
|
|
where, |
|
|
|
args = None , |
|
|
|
also_from = None | |
|
) |
| | |
Fetch one object from SQL, based on an arbitrary SQL WHERE expression.
Definition at line 184 of file sql.py.
def rpki.sql.sql_persistent.sql_init |
( |
|
cls, |
|
|
|
gctx, |
|
|
|
row, |
|
|
|
key | |
|
) |
| | |
Initialize one Python object from the result of a SQL query.
Definition at line 231 of file sql.py.
def rpki.sql.sql_persistent.sql_insert_hook |
( |
|
self |
) |
|
def rpki.sql.sql_persistent.sql_is_dirty |
( |
|
self |
) |
|
Query whether this object needs to be written back to SQL.
Definition at line 251 of file sql.py.
def rpki.sql.sql_persistent.sql_mark_clean |
( |
|
self |
) |
|
Mark this object as not needing to be written back to SQL.
Definition at line 247 of file sql.py.
def rpki.sql.sql_persistent.sql_mark_deleted |
( |
|
self |
) |
|
Mark this object as needing to be deleted in SQL.
Definition at line 255 of file sql.py.
def rpki.sql.sql_persistent.sql_mark_dirty |
( |
|
self |
) |
|
Mark this object as needing to be written back to SQL.
Definition at line 243 of file sql.py.
def rpki.sql.sql_persistent.sql_store |
( |
|
self |
) |
|
Store this object to SQL.
Definition at line 259 of file sql.py.
def rpki.sql.sql_persistent.sql_update_hook |
( |
|
self |
) |
|
Member Data Documentation
Enable logging of SQL actions.
Definition at line 158 of file sql.py.
Whether our cached copy of this object has been deleted.
Definition at line 153 of file sql.py.
Whether this object is already in SQL or not.
Definition at line 148 of file sql.py.
The documentation for this class was generated from the following file: