|
1 | | -# $Id: back_gadfly.py,v 1.2 2002-08-23 04:48:10 richard Exp $ |
| 1 | +# $Id: back_gadfly.py,v 1.3 2002-08-23 04:58:00 richard Exp $ |
2 | 2 | __doc__ = ''' |
3 | 3 | About Gadfly |
4 | 4 | ============ |
@@ -710,16 +710,16 @@ def getjournal(self, classname, nodeid): |
710 | 710 | return res |
711 | 711 |
|
712 | 712 | def pack(self, pack_before): |
713 | | - ''' Pack the database, removing all journal entries before the |
714 | | - "pack_before" date. |
| 713 | + ''' Delete all journal entries except "create" before 'pack_before'. |
715 | 714 | ''' |
716 | 715 | # get a 'yyyymmddhhmmss' version of the date |
717 | 716 | date_stamp = pack_before.serialise() |
718 | 717 |
|
719 | 718 | # do the delete |
720 | 719 | cursor = self.conn.cursor() |
721 | 720 | for classname in self.classes.keys(): |
722 | | - sql = 'delete from %s__journal where date<?'%classname |
| 721 | + sql = "delete from %s__journal where date<? and "\ |
| 722 | + "action<>'create'"%classname |
723 | 723 | if __debug__: |
724 | 724 | print >>hyperdb.DEBUG, 'pack', (self, sql, date_stamp) |
725 | 725 | cursor.execute(sql, (date_stamp,)) |
@@ -1645,6 +1645,20 @@ def __init__(self, db, classname, **properties): |
1645 | 1645 |
|
1646 | 1646 | # |
1647 | 1647 | # $Log: not supported by cvs2svn $ |
| 1648 | +# Revision 1.2 2002/08/23 04:48:10 richard |
| 1649 | +# That's gadfly done, mostly. Things left: |
| 1650 | +# - Class.filter (I'm a wuss ;) |
| 1651 | +# - schema changes adding new non-multilink properties are not implemented. |
| 1652 | +# gadfly doesn't have an ALTER TABLE command, making that quite difficult :) |
| 1653 | +# |
| 1654 | +# I had to mangle two unit tests to get this all working: |
| 1655 | +# - gadfly also can't handle two handles open on the one database, so |
| 1656 | +# testIDGeneration doesn't try that. |
| 1657 | +# - testNewProperty is disabled as per the second comment above. |
| 1658 | +# |
| 1659 | +# I noticed test_pack was incorrect, and the *dbm tests fail there now. |
| 1660 | +# Looking into it... |
| 1661 | +# |
1648 | 1662 | # Revision 1.1 2002/08/22 07:56:51 richard |
1649 | 1663 | # Whee! It's not finished yet, but I can create a new instance and play with |
1650 | 1664 | # it a little bit :) |
|
0 commit comments