<s> import copy <EOL> from db import Db <EOL> class MemoryDb ( Db ) : <EOL> @ classmethod <EOL> def new ( cls , config ) : <EOL> super ( MemoryDb , cls ) . new ( config ) <EOL> cls . data = [ ] <EOL> cls . id = <NUM_LIT:0> <EOL> cls . auto_throw_error = True <EOL> return cls <EOL> @ classmethod <EOL> def init_conn ( cls ) : <EOL> pass <EOL> @ classmethod <EOL> def drop_revision ( cls ) : <EOL> cls . data = [ ] <EOL> @ classmethod <EOL> def create_revision ( cls ) : <EOL> pass <EOL> @ classmethod <EOL> def get_commit_history ( cls ) : <EOL> return copy . copy ( cls . data ) <EOL> @ classmethod <EOL> def get_applied_alters ( cls ) : <EOL> return [ d [ <NUM_LIT:1> ] for d in cls . data ] <EOL> @ classmethod <EOL> def append_commit ( cls , ref ) : <EOL> cls . id += <NUM_LIT:1> <EOL> cls . data . append ( [ cls . id , ref , None ] ) <EOL> @ classmethod <EOL> def get_append_commit_query ( cls , _ ) : <EOL> return "<STR_LIT>" <EOL> @ classmethod <EOL> def remove_commit ( cls , ref ) : <EOL> to_remove = [ d for d in cls . data if d [ <NUM_LIT:1> ] == ref ] <EOL> if len ( to_remove ) > <NUM_LIT:0> : <EOL> cls . data . remove ( to_remove [ <NUM_LIT:0> ] ) <EOL> return True <EOL> @ classmethod <EOL> def get_remove_commit_query ( cls , _ ) : <EOL> return "<STR_LIT>" <EOL> @ classmethod <EOL> def create_history ( cls ) : <EOL> return True <EOL> @ classmethod <EOL> def conn ( cls ) : <EOL> return cls <EOL> @ classmethod <EOL> def run_file_cmd ( cls , filename ) : <EOL> """<STR_LIT>""" <EOL> return [ '<STR_LIT>' ] , None , None <EOL> @ classmethod <EOL> def run_file_cmd_with_error ( cls , filename ) : <EOL> """<STR_LIT>""" <EOL> return [ '<STR_LIT>' ] , None , None </s>
