DistributedDatabase

So far I concluded there are two possible paths to adding database to the CMU distributed code.

  1. Ignore the .dc file db flag entirely and create a DistributedDatabaseObjectAI and probably a DatabaseClientRepository to interact with the database. Would be less impact on existing code and more easy for me to implement. The coder would have to learn at least a little SQLAlchemy (or whatever I end up using) to use and learn and I assume not what you guys would desire :slight_smile:

  2. Use the .dc file db tag and put whatever database voodoo into a black box. I’ve spent all morning looking for how panda processes the dc tags. I found the is_tag() in DCClass and been browsing dcDecleration, libDCparser, and some other files but could not find anything.
    I need a bit of guidance on how deep I need to go to listen for the db tag and get the required info to do the database magic.

PS. Next time you guys do videos please invest in a smart board. They are also quite fun! :smiley:

You can ask dcfield.isDb(), or more generally, dcfield.hasKeyword(‘db’), to query whether a particular field (a.k.a. “method” or “message”) carries the db keyword.

You can also use the DCPacker to pack all of the data for a particular field into a compact and efficient binary representation, and also unpack it again later. Or you can just use pickle or shelve for the same purpose, since these are in fact generally simple Python structures.

David