anchor.diff:  				["q"] ->
   					ok;
   				_ ->
  -					dopipe(cmd(P,Data))
  +					case catch cmd(P,Data) of
  +						#dp{} = NP ->
  +							dopipe(NP);
  +						X ->
  +							port_command(P#dp.resp, [io_lib:fwrite("~p",[X]),<<"\n">>]),
  +							dopipe(P)
  +					end
   			end;
   		X ->
   			port_command(P#dp.resp, [io_lib:fwrite("~p",[X]),<<"\n">>]),
  
positive.code: 	port_command(P#dp.resp, [io_lib:format(F,A),<<"\r\n">>]),
  	P.
  
  change_prompt(#dp{env = test} = P) ->
  	P;
  change_prompt(P) ->
  	case P#dp.curdb of
  		actordb ->
  			print_help(print(P,"~~~~actordb>"));
  		config ->
  			print_help(print(P,"~~~~actordb:config>"));
  		users ->
  			print_help(print(P,"~~~~actordb:users>"));
  		schema ->
  			print_help(print(P,"~~~~actordb:schema>"))
  	end.
  
  print_help(#dp{env = test} = P) ->
  	P;
  
negative.code: 		{use,Name} ->
  			case string:to_lower(binary_to_list(Name)) of
  				"actordb" ->
  					print_help(change_prompt(P#dp{curdb = actordb}));
  				"users" ->
  					print_help(change_prompt(P#dp{curdb = users}));
  				"config" ->
  					print_help(change_prompt(P#dp{curdb = config}));
  				"schema" ->
  					print_help(change_prompt(P#dp{curdb = schema}))
  			end;
  		#show{} = R ->
  			cmd_show(P,R);
  		rollback ->
  			change_prompt(P#dp{buffer = []});
  		commit ->
  			change_prompt(send_query(P#dp{buffer = []},lists:reverse(P#dp.buffer)));
  		create_table ->
  			change_prompt(cmd_create(P,Bin));
  		#select{} = R ->
  			cmd_select(P,R,Bin);
  		#insert{} = R ->
  			change_prompt(cmd_insert(P,R,Bin));
  		#update{} = R ->
  			change_prompt(cmd_update(P,R,Bin));
  		#delete{} = R ->
  			change_prompt(cmd_delete(P,R,Bin));
  		_ when is_tuple(Tuple), is_tuple(element(1,Tuple)), is_binary(element(2,Tuple)) ->
  			cmd(cmd(P,Bin,element(1,Tuple)), element(2,Tuple));
  		_ ->
  			print(P,"Unrecognized command.")
  	end.
  