@@ -12,8 +12,8 @@ defmodule Sqlitex.SqlBuilder do
1212 # column_name: :column_type, of
1313 # column_name: {:column_type, [column_constraints]}
1414 def create_table ( name , table_opts , cols ) do
15- tbl_options = get_opts_dict ( table_opts , & table_opt / 1 )
16- get_opt = & ( Dict . get ( tbl_options , & 1 , nil ) )
15+ tbl_options = get_opts_map ( table_opts , & table_opt / 1 )
16+ get_opt = & ( Map . get ( tbl_options , & 1 , nil ) )
1717
1818 "CREATE #{ get_opt . ( :temp ) } TABLE \" #{ name } \" (#{ get_columns_block ( cols ) } #{ get_opt . ( :primary_key ) } )"
1919 end
@@ -38,9 +38,9 @@ defmodule Sqlitex.SqlBuilder do
3838 defp column_opt ( :not_null ) , do: { :not_null , "NOT NULL" }
3939 defp column_opt ( :autoincrement ) , do: { :autoincrement , "AUTOINCREMENT" }
4040
41- # Helper function that creates a dictionary of option names
41+ # Helper function that creates a map of option names
4242 # and their string representations
43- defp get_opts_dict ( opts , opt ) do
43+ defp get_opts_map ( opts , opt ) do
4444 Enum . into ( opts , % { } , & ( opt . ( & 1 ) ) )
4545 end
4646
@@ -51,8 +51,8 @@ defmodule Sqlitex.SqlBuilder do
5151 case col do
5252 # Column with name, type and constraint
5353 { name , { type , constraints } } ->
54- col_options = get_opts_dict ( constraints , & column_opt / 1 )
55- get_opt = & ( Dict . get ( col_options , & 1 , nil ) )
54+ col_options = get_opts_map ( constraints , & column_opt / 1 )
55+ get_opt = & ( Map . get ( col_options , & 1 , nil ) )
5656
5757 [ ~s( "#{ name } ") , type , get_opt . ( :primary_key ) , get_opt . ( :not_null ) , get_opt . ( :autoincrement ) ]
5858 |> Enum . filter ( & ( & 1 ) )
0 commit comments