Просмотр исходного кода

Revert "Move common types into .hrl file"

This reverts commit 3806a8504dcc5fe0b6ec72f63f4add7c81d67f52.
David N. Welton 10 лет назад
Родитель
Сommit
88b89724c3
2 измененных файлов с 29 добавлено и 30 удалено
  1. 0 30
      include/epgsql.hrl
  2. 29 0
      src/epgsql.erl

+ 0 - 30
include/epgsql.hrl

@@ -16,33 +16,3 @@
                  extra :: [{detail, binary()}
                            | {hint, binary()}
                            | {position, binary()}]}).
-
--type connection() :: pid().
-
--type connect_option() :: {database, string()}
-                          | {port, inet:port_number()}
-                          | {ssl, boolean() | required}
-                          | {ssl_opts, list()} % ssl:option(), see OTP ssl_api.hrl
-                          | {timeout, timeout()}
-                          | {async, pid()}.
--type connect_error() :: #error{}.
--type query_error() :: #error{}.
-
--type bind_param() ::
-        null
-        | boolean()
-        | string()
-        | binary()
-        | integer()
-        | float()
-        | calendar:date()
-        | calendar:time()                       %actualy, `Seconds' may be float()
-        | calendar:datetime()
-        | {calendar:time(), Days::non_neg_integer(), Months::non_neg_integer()}
-        | [bind_param()].                       %array (maybe nested)
-
--type squery_row() :: {binary()}.
--type equery_row() :: {bind_param()}.
--type ok_reply(RowType) :: {ok, [#column{}], [RowType]}  % SELECT
-                         | {ok, non_neg_integer()}   % UPDATE / INSERT
-                         | {ok, non_neg_integer(), [#column{}], [RowType]}. % UPDATE / INSERT + RETURNING

+ 29 - 0
src/epgsql.erl

@@ -27,6 +27,35 @@
 
 -include("epgsql.hrl").
 
+-type connection() :: pid().
+-type connect_option() :: {database, string()}
+                          | {port, inet:port_number()}
+                          | {ssl, boolean() | required}
+                          | {ssl_opts, list()} % ssl:option(), see OTP ssl_api.hrl
+                          | {timeout, timeout()}
+                          | {async, pid()}.
+-type connect_error() :: #error{}.
+-type query_error() :: #error{}.
+
+-type bind_param() ::
+        null
+        | boolean()
+        | string()
+        | binary()
+        | integer()
+        | float()
+        | calendar:date()
+        | calendar:time()                       %actualy, `Seconds' may be float()
+        | calendar:datetime()
+        | {calendar:time(), Days::non_neg_integer(), Months::non_neg_integer()}
+        | [bind_param()].                       %array (maybe nested)
+
+-type squery_row() :: {binary()}.
+-type equery_row() :: {bind_param()}.
+-type ok_reply(RowType) :: {ok, [#column{}], [RowType]}  % SELECT
+                         | {ok, non_neg_integer()}   % UPDATE / INSERT
+                         | {ok, non_neg_integer(), [#column{}], [RowType]}. % UPDATE / INSERT + RETURNING
+
 %% -- client interface --
 connect(Settings) ->
 	Host = proplists:get_value(host, Settings, "localhost"),