Annotate return types of abstract methods

This commit is contained in:
Brian J. Cardiff 2019-07-29 10:25:46 -03:00
parent 54089ef97d
commit 058c78f837
3 changed files with 6 additions and 6 deletions

View file

@ -12,11 +12,11 @@ class SQLite3::Connection < DB::Connection
URI.unescape((uri.host || "") + uri.path)
end
def build_prepared_statement(query)
def build_prepared_statement(query) : Statement
Statement.new(self, query)
end
def build_unprepared_statement(query)
def build_unprepared_statement(query) : Statement
# sqlite3 does not support unprepared statement.
# All statements once prepared should be released
# when unneeded. Unprepared statement are not aim

View file

@ -1,5 +1,5 @@
class SQLite3::Driver < DB::Driver
def build_connection(context : DB::ConnectionContext)
def build_connection(context : DB::ConnectionContext) : SQLite3::Connection
SQLite3::Connection.new(context)
end
end

View file

@ -9,7 +9,7 @@ class SQLite3::ResultSet < DB::ResultSet
# Advances to the next row. Returns `true` if there's a next row,
# `false` otherwise. Must be called at least once to advance to the first
# row.
def move_next
def move_next : Bool
@column_index = 0
case step
@ -79,11 +79,11 @@ class SQLite3::ResultSet < DB::ResultSet
read(Int64?).try &.!=(0)
end
def column_count
def column_count : Int32
LibSQLite3.column_count(self)
end
def column_name(index)
def column_name(index) : String
String.new LibSQLite3.column_name(self, index)
end