Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SessionRootSetter ¶
SessionRootSetter sets the root value for the session.
type TableWriter ¶
type TableWriter interface { sql.RowReplacer sql.RowUpdater sql.RowInserter sql.RowDeleter sql.ForeignKeyUpdater sql.AutoIncrementSetter GetNextAutoIncrementValue(ctx *sql.Context, insertVal interface{}) (uint64, error) }
type WriteSession ¶
type WriteSession interface { // GetTableWriter creates a TableWriter and adds it to the WriteSession. GetTableWriter(ctx context.Context, table, db string, setter SessionRootSetter, batched bool) (TableWriter, error) // UpdateWorkingSet takes a callback to update this WriteSession's WorkingSet. The update method cannot change the // WorkingSetRef of the WriteSession. WriteSession flushes the pending writes in the session before calling the update. UpdateWorkingSet(ctx context.Context, cb func(ctx context.Context, current *doltdb.WorkingSet) (*doltdb.WorkingSet, error)) error // SetWorkingSet modifies the state of the WriteSession. The WorkingSetRef of |ws| must match the existing Ref. SetWorkingSet(ctx context.Context, ws *doltdb.WorkingSet) error // GetOptions returns the editor.Options for this session. GetOptions() editor.Options // SetOptions sets the editor.Options for this session. SetOptions(opts editor.Options) WriteSessionFlusher }
WriteSession encapsulates writes made within a SQL session. It's responsible for creating and managing the lifecycle of TableWriter's.
func NewWriteSession ¶
func NewWriteSession(nbf *types.NomsBinFormat, ws *doltdb.WorkingSet, tracker globalstate.AutoIncrementTracker, opts editor.Options) WriteSession
NewWriteSession creates and returns a WriteSession. Inserting a nil root is not an error, as there are locations that do not have a root at the time of this call. However, a root must be set through SetRoot before any table editors are returned.
type WriteSessionFlusher ¶
type WriteSessionFlusher interface { // Flush flushes the pending writes in the session. Flush(ctx context.Context) (*doltdb.WorkingSet, error) }
WriteSessionFlusher is responsible for flushing any pending edits to the session
Click to show internal directories.
Click to hide internal directories.