mirror of
https://gitea.invidious.io/iv-org/shard-crystal-db.git
synced 2024-08-15 00:53:32 +00:00
add ResultSet#read_object
This commit is contained in:
parent
312609b722
commit
5b23114095
2 changed files with 45 additions and 11 deletions
|
@ -20,6 +20,10 @@ module DB
|
|||
# 3. (Optional) Override `#read(t)` for all `t` in `DB::TYPES`.
|
||||
# 4. Override `#column_count`, `#column_name`.
|
||||
# 5. Override `#column_type`. It must return a type in `DB::TYPES`.
|
||||
# 6. Override `#read_object` to return other data types not included in `DB::TYPES`. This
|
||||
# will create a union type, so user will be forced to cast result type. Usually `#read`
|
||||
# should be used to avoid unnecesary intermediate union type values. Calling `#read_object`
|
||||
# should also move to the next column.
|
||||
abstract class ResultSet
|
||||
include Disposable
|
||||
|
||||
|
@ -77,6 +81,10 @@ module DB
|
|||
read?(Nil)
|
||||
end
|
||||
|
||||
def read_object
|
||||
raise "Not implemented"
|
||||
end
|
||||
|
||||
# def read_blob
|
||||
# yield ... io ....
|
||||
# end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue