Skip to content

Commit

Permalink
Merge pull request #36 from schveiguy/undeprecate_lockconnection
Browse files Browse the repository at this point in the history
Fix issue #34 - undeprecate lockConnection.
  • Loading branch information
denizzzka authored Jun 12, 2020
2 parents 1d5f5b4 + 6d5b950 commit f8e5534
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions source/vibe/db/postgresql/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ class PostgresClient
/// Get connection from the pool.
///
/// Do not forgot to call .reset() for connection if ConnectionException
/// will be catched while using LockedConnection!
deprecated("use pickConnection instead or report why lockConnection should be left")
/// was caught while using LockedConnection!
LockedConnection lockConnection()
{
logDebugV("get connection from the pool");
Expand All @@ -89,7 +88,6 @@ class PostgresClient
{
logDebugV("get connection from the pool");
scope conn = pool.lockConnection();
scope(exit) destroy(conn);

try
return dg(conn);
Expand Down Expand Up @@ -465,7 +463,7 @@ version(IntegrationTest) void __integration_test(string connString)

auto client = new PostgresClient(connString, 3);

client.pickConnection((scope conn) {
auto conn = client.lockConnection;
{
auto res = conn.execStatement(
"SELECT 123::integer, 567::integer, 'asd fgh'::text",
Expand Down Expand Up @@ -620,6 +618,4 @@ version(IntegrationTest) void __integration_test(string connString)
assert(futureNtf.name == "foo");
assert(futureNtf.extra == "bar");
}

}); // pickConnection
}

0 comments on commit f8e5534

Please sign in to comment.