2016-12-03 18:56:03 +00:00
|
|
|
module DB
|
|
|
|
# Represents a statement to be executed in any of the connections
|
|
|
|
# of the pool. The statement is not be executed in a non prepared fashion.
|
|
|
|
# The execution of the statement is retried according to the pool configuration.
|
|
|
|
#
|
|
|
|
# See `PoolStatement`
|
2016-12-03 19:03:50 +00:00
|
|
|
class PoolUnpreparedStatement < PoolStatement
|
|
|
|
def initialize(db : Database, query : String)
|
|
|
|
super
|
2016-12-03 18:56:03 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
protected def do_close
|
|
|
|
# unprepared statements do not need to be release in each connection
|
|
|
|
end
|
|
|
|
|
|
|
|
# builds a statement over a real connection
|
|
|
|
private def build_statement
|
|
|
|
@db.pool.checkout.unprepared.build(@query)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|