add ResultSet#exec to ensure the query is performed. By default generates a move_next.

This commit is contained in:
Brian J. Cardiff 2016-01-30 21:03:02 -03:00
parent 683e6bdfa7
commit 1fb0b8a82b
4 changed files with 28 additions and 1 deletions

View file

@ -15,6 +15,12 @@ module DB
@statement.close
end
# :nodoc:
# Ensures it executes the query
def exec
move_next
end
abstract def move_next : Bool
# TODO def empty? : Bool, handle internally with move_next (?)

View file

@ -7,7 +7,9 @@ module DB
end
def exec(*args)
execute(*args).close
query(*args) do |rs|
rs.exec
end
end
def scalar(*args)