Skip to content

Commit

Permalink
Cleanup DBInterface a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
quinnj authored and iamed2 committed Aug 17, 2024
1 parent 9eca383 commit 36d6b24
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/dbinterface.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
DBInterface.connect(::Type{Connection}, args...; kws...) = Connection(args...; kws...)

DBInterface.prepare(conn::Connection, args...; kws...) = prepare(conn, args...; kws...)

function DBInterface.execute(conn::Union{Connection,Statement}, args...; kws...)
return execute(conn, args...; kws...)
struct DBConnection <: DBInterface.Connection
conn::Connection
end

DBInterface.close!(conn::Connection) = close(conn)
DBInterface.connect(::Type{Connection}, args...; kws...) = DBConnection(Connection(args...; kws...))
DBInterface.prepare(conn::DBConnection, args...; kws...) = prepare(conn.conn, args...; kws...)
DBInterface.execute(conn::DBConnection, args...; kws...) = execute(conn.conn, args...; kws...)
DBInterface.execute(conn::DBConnection, str::AbstractString; kws...) = execute(conn.conn, str; kws...)
DBInterface.execute(stmt::Statement, args...; kws...) = execute(stmt, args...; kws...)
DBInterface.close!(conn::DBConnection) = close(conn)

0 comments on commit 36d6b24

Please sign in to comment.