Skip to content

Commit 8f42522

Browse files
authored
Define Base.close and Base.isopen for SQLite.DB to make it have a little more like a connection (#215)
1 parent 0e3a29c commit 8f42522

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/SQLite.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ DB() = DB(":memory:")
5858
DBInterface.connect(::Type{DB}) = DB()
5959
DBInterface.connect(::Type{DB}, f::AbstractString) = DB(f)
6060
DBInterface.close!(db::DB) = _close(db)
61+
Base.close(db::DB) = _close(db)
62+
Base.isopen(db::DB) = db.handle != C_NULL
6163

6264
function _close(db::DB)
6365
db.handle == C_NULL || sqlite3_close_v2(db.handle)

0 commit comments

Comments
 (0)