diff --git a/go/libraries/doltcore/sqle/dsess/session.go b/go/libraries/doltcore/sqle/dsess/session.go index 9808a83039c..6ef46d671f1 100644 --- a/go/libraries/doltcore/sqle/dsess/session.go +++ b/go/libraries/doltcore/sqle/dsess/session.go @@ -50,7 +50,8 @@ var ErrSessionNotPersistable = errors.New("session is not persistable") // DoltSession is the sql.Session implementation used by dolt. It is accessible through a *sql.Context instance type DoltSession struct { sql.Session - DoltgresSessObj any // This is used by Doltgres to persist objects in the session. This is not used by Dolt. + DoltgresSessObj any // This is used by Doltgres to persist objects in the session. This is not used by Dolt. + notices []any // This is used by Doltgres to store notices. This is not used by Dolt. username string email string dbStates map[string]*DatabaseSessionState @@ -326,6 +327,24 @@ func (d *DoltSession) ValidateSession(ctx *sql.Context) error { return d.validateErr } +// Notices returns the set of notices currently queued in this session. Notices are specific to Doltgres sessions +// and are not used by Dolt sessions. +func (d *DoltSession) Notices() []any { + return d.notices +} + +// Notice adds a notice to the queue of the current notices in this session that have not been sent to the client yet. +// Notices are specific to Doltgres sessions and are not used by Dolt sessions. +func (d *DoltSession) Notice(notice any) { + d.notices = append(d.notices, notice) +} + +// ClearNotices clears the queued notices in this session. Notices are specific to Doltgres sessions and are not +// used by Dolt sessions. +func (d *DoltSession) ClearNotices() { + d.notices = nil +} + // StartTransaction refreshes the state of this session and starts a new transaction. func (d *DoltSession) StartTransaction(ctx *sql.Context, tCharacteristic sql.TransactionCharacteristic) (sql.Transaction, error) { // TODO: this is only necessary to support filter-branch, which needs to set a root directly and not have the