@@ -66,6 +66,8 @@ if Code.ensure_loaded?(Sqlitex.Server) do
6666 value
6767 % { } = value ->
6868 Ecto.Adapter . json_library ( ) . encode! ( value )
69+ value when is_list ( value ) ->
70+ Ecto.Adapter . json_library ( ) . encode! ( value )
6971 value ->
7072 value
7173 end
@@ -496,7 +498,7 @@ if Code.ensure_loaded?(Sqlitex.Server) do
496498 [ @ pseudo_returning_statement , cmd , ?\s , fields ]
497499 end
498500
499- defp ecto_to_db ( { :array , _ } ) do
501+ defp ecto_to_db ( { :array , _data } ) do
500502 raise ArgumentError , "Array type is not supported by SQLite"
501503 end
502504
@@ -772,7 +774,7 @@ if Code.ensure_loaded?(Sqlitex.Server) do
772774 defp column_type ( :string , _opts ) , do: "TEXT"
773775 defp column_type ( :map , _opts ) , do: "TEXT"
774776 defp column_type ( { :map , _ } , _opts ) , do: "TEXT"
775- defp column_type ( { :array , _ } , _opts ) , do: raise ( ArgumentError , "Array type is not supported by SQLite" )
777+ defp column_type ( { :array , _ } , _opts ) , do: "TEXT"
776778 defp column_type ( :decimal , opts ) do
777779 # We only store precision and scale for DECIMAL.
778780 precision = Keyword . get ( opts , :precision )
0 commit comments