Skip to content

Commit bfe2d85

Browse files
committed
Add show methods
1 parent 63cee13 commit bfe2d85

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/QuerySQLite.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,5 +505,20 @@ function IteratorInterfaceExtensions.getiterator(outside_code::OutsideCode)
505505
return SQLiteCursor{NamedTuple{Tuple(header), Tuple{types...}}}(stmt, Ref(status), Ref(0))
506506
end
507507

508+
function Base.show(io::IO, source::OutsideCode)
509+
TableShowUtils.printtable(io, IteratorInterfaceExtensions.getiterator(source), "SQLite query result")
510+
end
511+
512+
function Base.show(io::IO, ::MIME"text/html", source::OutsideCode)
513+
TableShowUtils.printHTMLtable(io, IteratorInterfaceExtensions.getiterator(source))
514+
end
515+
516+
Base.Multimedia.showable(::MIME"text/html", source::OutsideCode) = true
517+
518+
function Base.show(io::IO, ::MIME"application/vnd.dataresource+json", source::OutsideCode)
519+
TableShowUtils.printdataresource(io, IteratorInterfaceExtensions.getiterator(source))
520+
end
521+
522+
Base.Multimedia.showable(::MIME"application/vnd.dataresource+json", source::OutsideCode) = true
508523

509524
end # module

0 commit comments

Comments
 (0)