anchor.diff:  pack_value(false) ->
       "FALSE".
   
  +table_exists(Conn, TableName) when is_atom(TableName) ->
  +    Res = pgsql:squery(Conn, ["SELECT COUNT(tablename) FROM PG_TABLES WHERE SCHEMANAME='public' AND TABLENAME = '", atom_to_list(TableName), "'"]),
  +    case Res of
  +        {ok, _, [{Count}]} ->
  +	    list_to_integer(binary_to_list(Count)) > 0;
  +	{error, Reason} ->
  +	    {error, Reason}
  +    end.
  +
  +create_table(Conn, TableName, TableDefinition) when is_atom(TableName) ->
  +    Res = pgsql:squery(Conn, ["CREATE TABLE ", atom_to_list(TableName), " ( ", tabledefinition_to_sql(TableDefinition), " )"]),
  +    case Res of
  +        {ok, [], []} ->
  +            ok;
  +        {error, Reason} ->
  +            {error, Reason}
  +    end.
  +
   %% Turns a table definition into an SQL string.
   
   tabledefinition_to_sql(TableDefinition) ->
       string:join(
  -      [ColumnName ++ " " ++ column_type_to_sql(ColumnType) ++ " " ++
  +      [atom_to_list(ColumnName) ++ " " ++ column_type_to_sql(ColumnType) ++ " " ++
   	   column_options_to_sql(Options) ||
   	  {ColumnName, ColumnType, Options} <- TableDefinition], ", ").
   
  +column_type_to_sql(auto_increment) ->
  +    "SERIAL";
   column_type_to_sql(string) ->
  -    "VARCHAR".
  -
  +    "VARCHAR";
   column_type_to_sql(integer) ->
  -    "INTEGER".
  -
  +    "INTEGER";
   column_type_to_sql(datetime) ->
       "TIMESTAMP".
   
  
positive.code:             end;
          {error, Reason} ->
              {error, Reason}
      end.
  
  find(Conn, Type, Conditions, Max, Skip, Sort, SortOrder) when is_atom(Type), is_list(Conditions), 
  
negative.code: 
  terminate(Conn) ->
      pgsql:close(Conn).
  
  find(Conn, Id) when is_list(Id) ->
      {Type, TableName, IdColumn, TableId} = boss_sql_lib:infer_type_from_id(Id),
  