anchor.diff:      fun(T) -> length(T) > 0 end,
       lists:map(fun create_index/1, Fields)
     ),
  -  Dql = "CREATE TABLE IF NOT EXISTS "
  -  ++ "`" ++ atom_to_list(Name) ++ "` ("
  -  ++ string:join(FieldsDql, ",")
  -  ++ ","
  -  ++ string:join(Indexes, ",")
  -  ++ ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8",
  +  Dql = [
  +    "CREATE TABLE IF NOT EXISTS ", escape(atom_to_list(Name)), " (",
  +    string:join(FieldsDql, ","), ",", string:join(Indexes, ","),
  +    ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8"
  +  ],
     case execute(Dql, State) of
       #ok_packet{} -> {ok, State};
       Error -> evaluate_execute_result(Error, State)
     end.
   
   create_column(#sumo_field{name=Name, type=integer, attrs=Attrs}) ->
  -  "`" ++ atom_to_list(Name) ++ "` INT(11) " ++ create_column_options(Attrs);
  +  [escape(atom_to_list(Name)), " INT(11) ", create_column_options(Attrs)];
   
   create_column(#sumo_field{name=Name, type=float, attrs=Attrs}) ->
  -  "`" ++ atom_to_list(Name) ++ "` FLOAT " ++ create_column_options(Attrs);
  +  [escape(atom_to_list(Name)), " FLOAT ", create_column_options(Attrs)];
   
   create_column(#sumo_field{name=Name, type=text, attrs=Attrs}) ->
  -  "`" ++ atom_to_list(Name) ++ "` TEXT " ++ create_column_options(Attrs);
  +  [escape(atom_to_list(Name)), " TEXT ", create_column_options(Attrs)];
   
   create_column(#sumo_field{name=Name, type=binary, attrs=Attrs}) ->
  -  "`" ++ atom_to_list(Name) ++ "` BLOB " ++ create_column_options(Attrs);
  +  [escape(atom_to_list(Name)), " BLOB ", create_column_options(Attrs)];
   
   create_column(#sumo_field{name=Name, type=string, attrs=Attrs}) ->
  -  "`" ++ atom_to_list(Name) ++ "` VARCHAR " ++ create_column_options(Attrs);
  +  [escape(atom_to_list(Name)), " VARCHAR ", create_column_options(Attrs)];
   
   create_column(#sumo_field{name=Name, type=date, attrs=Attrs}) ->
  -  "`" ++ atom_to_list(Name) ++ "` DATE " ++ create_column_options(Attrs);
  +  [escape(atom_to_list(Name)), " DATE ", create_column_options(Attrs)];
   
   create_column(#sumo_field{name=Name, type=datetime, attrs=Attrs}) ->
  -  "`" ++ atom_to_list(Name) ++ "` DATETIME " ++ create_column_options(Attrs).
  +  [escape(atom_to_list(Name)), " DATETIME ", create_column_options(Attrs)].
   
   create_column_options(Attrs) ->
     lists:filter(fun(T) -> is_list(T) end, lists:map(
  
positive.code:   end.
  
  delete(DocName, Id, State) ->
    Sql = "DELETE FROM `" ++ atom_to_list(DocName)
      ++ "` WHERE `" ++ atom_to_list(sumo:field_name(sumo:get_id_field(DocName)))
      ++ "`=? LIMIT 1",
    case execute(Sql, [Id], State) of
      #ok_packet{affected_rows = NumRows} -> {ok, NumRows > 0, State};
      Error -> evaluate_execute_result(Error, State)
    end.
  
  delete_all(DocName, State) ->
    Sql = "DELETE FROM `" ++ atom_to_list(DocName) ++ "`",
    case execute(Sql, State) of
      #ok_packet{affected_rows = NumRows} -> {ok, NumRows, State};
      Error -> evaluate_execute_result(Error, State)
  
negative.code:   )).
  
  create_column_option(auto_increment) ->
    ["AUTO_INCREMENT "];
  
  create_column_option(not_null) ->
    [" NOT NULL "];
  
  create_column_option({length, X}) ->
    ["(", integer_to_list(X), ") "];
  
  create_column_option(_Option) ->
    none.
  