예제 #1
0
파일: db.py 프로젝트: gwk/muck
 def insert_record(self, record: TargetRecord):
   try:
     self.run('INSERT INTO targets (path, size, mtime, hash, src, deps) VALUES (:path, :size, :mtime, :hash, :src, :deps)',
       path=record.path, size=record.size, mtime=record.mtime, hash=record.hash, src=record.src, deps=to_marshalled(record.deps))
   except IntegrityError as e:
     raise DBError('insert_record: target path is not unique: {}', record.path) from e
예제 #2
0
파일: db.py 프로젝트: gwk/muck
 def update_record(self, record: TargetRecord):
   self.run('UPDATE targets SET size=:size, mtime=:mtime, hash=:hash, src=:src, deps=:deps WHERE path=:path',
     path=record.path, size=record.size, mtime=record.mtime, hash=record.hash, src=record.src, deps=to_marshalled(record.deps))