Commit c70027a5 authored by Kirill Smelkov's avatar Kirill Smelkov

go/zodb: Connection.DB

Provide way for users to retrieve Connection -> DB from which it was opened.
Wendelin.core 2 might need this to open a second connection given a one.
parent a9ab8556
// Copyright (C) 2018-2019 Nexedi SA and Contributors. // Copyright (C) 2018-2020 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com> // Kirill Smelkov <kirr@nexedi.com>
// //
// This program is free software: you can Use, Study, Modify and Redistribute // This program is free software: you can Use, Study, Modify and Redistribute
...@@ -190,6 +190,12 @@ func newConnection(db *DB, at Tid) *Connection { ...@@ -190,6 +190,12 @@ func newConnection(db *DB, at Tid) *Connection {
} }
} }
// DB returns database handle under which the connection was opened.
func (conn *Connection) DB() *DB {
conn.checkLive("db")
return conn.db
}
// At returns database state corresponding to the connection. // At returns database state corresponding to the connection.
func (conn *Connection) At() Tid { func (conn *Connection) At() Tid {
conn.checkLive("at") conn.checkLive("at")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment