Explorar o código

add >= <= mysql where encoding

hippp %!s(int64=10) %!d(string=hai) anos
pai
achega
35a29994fb
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      plugins/emysql/src/emysql.erl

+ 6 - 0
plugins/emysql/src/emysql.erl

@@ -384,9 +384,15 @@ encode_where({like, Field, Value}) ->
 encode_where({'<', Field, Value}) ->	
 	atom_to_list(Field) ++ " < " ++ encode(Value);
 
+encode_where({'<=', Field, Value}) ->
+	atom_to_list(Field) ++ " <= " ++ encode(Value);
+
 encode_where({'>', Field, Value}) ->	
 	atom_to_list(Field) ++ " > " ++ encode(Value);
 
+encode_where({'>=', Field, Value}) ->
+	atom_to_list(Field) ++ " >= " ++ encode(Value);
+
 encode_where({'in', Field, Values}) ->	
 	InStr = string:join([encode(Value) || Value <- Values], ","),
 	atom_to_list(Field) ++ " in (" ++ InStr ++ ")";