Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion go/libraries/doltcore/sqle/dsess/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading