Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 5 commits
  • 7 files changed
  • 0 commit comments
  • 2 contributors
Showing with 36 additions and 12 deletions.
  1. +14 −0 CHANGES
  2. +2 −2 Makefile
  3. +10 −7 README
  4. BIN rebar
  5. +1 −0 rebar.config
  6. +1 −1 src/epgsql.app.src
  7. +8 −2 test_src/pgsql_tests.erl
View
14 CHANGES
@@ -0,0 +1,14 @@
+latest
+
+Asynchronous API extracted from pgsql_sock into apgsql (returns whole result sets) and ipgsql (returns row by row results).
+Original tests are used to test all APIs through emulation modules.
+Execute several prepared statements as a batch.
+Bind timestamps in erlang:now() format.
+
+6f9d545 2011-11-01
+
+Asynchronous API is implemented by pgsql_sock.erl, see pgsql.erl for examples.
+gen_fsm replaced by internal queue of client requests, so you don't need to wait for response to send next request.
+Results can be delivered as regular erlang messages.
+Single process to hold driver state and receive socket data.
+Slight code reorganization.
View
4 Makefile
@@ -1,5 +1,5 @@
NAME := epgsql
-VERSION := 1.4
+VERSION := $(shell git describe --always --tags)
ERL := erl
ERLC := erlc
@@ -43,7 +43,7 @@ ebin/%.beam : src/%.erl
$(ERLC) $(ERLC_FLAGS) -o $(dir $@) $<
ebin/%.app : src/%.app.src Makefile
- sed -e s/VERSION/$(VERSION)/g $< > $@
+ sed -e s/git/\"$(VERSION)\"/g $< > $@
test_ebin/%.beam : test_src/%.erl
$(ERLC) $(ERLC_FLAGS) -o $(dir $@) $<
View
17 README
@@ -1,18 +1,21 @@
Erlang PostgreSQL Database Client
Asynchronous fork of https://github.com/wg/epgsql
-
-Asynchronous API is implemented by pgsql_sock.erl, see pgsql.erl for examples.
It passes all tests from original driver except 3 timeout tests.
Backward compatibility is preserved by module pgsql.
-Differences from original driver:
- + internal queue of client requests, so you don't need to wait response to send next request
- + responses are delivered as regular erlang messages
+Difference highlights (see CHANGES for full list):
+ + internal queue of client requests, so you don't need to wait for response to send next request
+ + results can be delivered as regular erlang messages, either complete or row by row
+ single process to hold driver state and receive socket data
- + slight code reorganization
+ + execute several prepared statements as a batch
+ + bind timestamps in erlang:now() format
+
+
+* Known problems
+ Timeout supplied at connect time will work only as connect timeout not query timeout.
+ SSL performance degrades if driver process has large inbox (thousands of messages).
-Original epgsql API
* Connect
View
BIN rebar
Binary file not shown.
View
1 rebar.config
@@ -0,0 +1 @@
+{eunit_compile_opts, [{src_dirs, ["test_src"]}]}.
View
2 src/epgsql.app.src
@@ -1,6 +1,6 @@
{application, epgsql,
[{description, "PostgreSQL Client"},
- {vsn, "VERSION"},
+ {vsn, git},
{modules, [pgsql, pgsql_binary, pgsql_connection, pgsql_fdatetime,
pgsql_idatetime, pgsql_sock, pgsql_types]},
{registered, []},
View
10 test_src/pgsql_tests.erl
@@ -577,9 +577,15 @@ warning_notice_test(Module) ->
with_connection(
Module,
fun(C) ->
- {ok, _, _} = Module:squery(C, "select 'test\\n'"),
+ Q = "create function pg_temp.raise() returns void as $$
+ begin
+ raise warning 'oops';
+ end;
+ $$ language plpgsql;
+ select pg_temp.raise()",
+ [{ok, _, _}, _] = Module:squery(C, Q),
receive
- {pgsql, C, {notice, #error{code = <<"22P06">>}}} -> ok
+ {pgsql, C, {notice, #error{message = <<"oops">>}}} -> ok
after
100 -> erlang:error(didnt_receive_notice)
end

No commit comments for this range

Something went wrong with that request. Please try again.