diff --git a/shard.yml b/shard.yml index 827d75e2..df2748ec 100644 --- a/shard.yml +++ b/shard.yml @@ -3,7 +3,7 @@ version: 0.24.0 dependencies: db: - github: crystal-lang/crystal-db - version: ~> 0.10.0 + github: place-labs/crystal-db + branch: master crystal: ">= 0.35.0, < 2.0.0" diff --git a/src/pg/statement.cr b/src/pg/statement.cr index 97a496b6..4e7b2e4e 100644 --- a/src/pg/statement.cr +++ b/src/pg/statement.cr @@ -28,6 +28,7 @@ class PG::Statement < ::DB::Statement end ResultSet.new(self, fields) rescue IO::Error + connection.close raise DB::ConnectionLost.new(connection) end @@ -39,6 +40,7 @@ class PG::Statement < ::DB::Statement last_insert_id: 0_i64 # postgres doesn't support this ) rescue IO::Error + connection.close raise DB::ConnectionLost.new(connection) end end