From 8477b836a0b18a6f5e03a8c41741fe4fe03d7cee Mon Sep 17 00:00:00 2001 From: Peter Davids Date: Tue, 27 Dec 2022 10:24:32 -0500 Subject: [PATCH] withdbmapcontext --- db.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/db.go b/db.go index d78062e5..fbbe9c60 100644 --- a/db.go +++ b/db.go @@ -117,6 +117,14 @@ func (m *DbMap) dynamicTableMap() map[string]*TableMap { return m.tablesDynamic } +// WithDbMapContext is like WithContext, but returns the DbMap instead of a generic SqlExecutor +func (m *DbMap) WithDbMapContext(ctx context.Context) DbMap { + copy := &DbMap{} + *copy = *m + copy.ctx = ctx + return *copy +} + func (m *DbMap) WithContext(ctx context.Context) SqlExecutor { copy := &DbMap{} *copy = *m