mirror of
https://gitea.invidious.io/iv-org/shard-crystal-db.git
synced 2024-08-15 00:53:32 +00:00
update to crystal 0.20.3
* add missing forall annotations
This commit is contained in:
parent
3acb5b8f39
commit
eb82b96c0d
1 changed files with 3 additions and 3 deletions
|
@ -64,7 +64,7 @@ module DB
|
|||
# ```
|
||||
# name = db.query_one "select name from contacts where id = ?", 18, &.read(String)
|
||||
# ```
|
||||
def query_one(query, *args, &block : ResultSet -> U) : U
|
||||
def query_one(query, *args, &block : ResultSet -> U) : U forall U
|
||||
query(query, *args) do |rs|
|
||||
raise DB::Error.new("no rows") unless rs.move_next
|
||||
|
||||
|
@ -114,7 +114,7 @@ module DB
|
|||
# name = db.query_one? "select name from contacts where id = ?", 18, &.read(String)
|
||||
# typeof(name) # => String | Nil
|
||||
# ```
|
||||
def query_one?(query, *args, &block : ResultSet -> U) : U?
|
||||
def query_one?(query, *args, &block : ResultSet -> U) : U? forall U
|
||||
query(query, *args) do |rs|
|
||||
return nil unless rs.move_next
|
||||
|
||||
|
@ -164,7 +164,7 @@ module DB
|
|||
# ```
|
||||
# names = db.query_all "select name from contacts", &.read(String)
|
||||
# ```
|
||||
def query_all(query, *args, &block : ResultSet -> U) : Array(U)
|
||||
def query_all(query, *args, &block : ResultSet -> U) : Array(U) forall U
|
||||
ary = [] of U
|
||||
query(query, *args) do |rs|
|
||||
rs.each do
|
||||
|
|
Loading…
Reference in a new issue