   # that query() can parse the string later and emulate it with a
   # transaction and trigger.
   # See: returning_query()
-  defp returning_clause(_table, [], _cmd), do: ""
+  defp returning_clause(_table, [], _cmd), do: []
   defp returning_clause(table, returning, cmd) do
-    @pseudo_returning_statement <> cmd <> " " <> Enum.join([table | returning], ",")
+    [String.strip(@pseudo_returning_statement), cmd, Enum.join([table | returning], ",")]
   end
 
   # Generate a where clause from the given filters.

defmodule Sqlite.Ecto.Query do
  import Sqlite.Ecto.Transaction, only: [with_savepoint: 2]
  import Sqlite.Ecto.Util, only: [exec: 2, random_id: 0, quote_id: 1]

  def query(pid, sql=<<"ALTER TABLE ", _::binary>>, _params, _opts) do
    alter_table_query(pid, sql)

    |> Enum.map_reduce(start, fn (i, acc) -> {"#{i} = ?#{acc}", acc + 1} end)
    |> (fn ({filters, _acc}) -> filters end).()
    |> Enum.join(" AND ")
    |> (fn (clause) -> "WHERE " <> clause end).()
  end
end
