Versions in this module Expand all Collapse all v0 v0.30.0 May 6, 2026 Changes in this version type InternalVars + EmbeddedClientConfig *spanner.ClientConfig + EmbeddedClientOptions []option.ClientOption v0.29.0 Mar 22, 2026 Changes in this version type DisplayVars + TabVisualize bool + WidthStrategy enums.WidthStrategy + type DocResult struct + Content string + Name string + type DocSearchResult struct + Name string + Snippet string type EnumVar + func WidthStrategyVar(ptr *enums.WidthStrategy, desc string) *EnumVar[enums.WidthStrategy] type FeatureVars + VertexAILocation string type Session + func (s *Session) GetDatabaseDdlCached(ctx context.Context) (*adminpb.GetDatabaseDdlResponse, error) v0.28.0 Mar 9, 2026 Changes in this version + type BatchManager struct + func (b *BatchManager) Abort() + func (b *BatchManager) Current() Statement + func (b *BatchManager) Info() *BatchInfo + func (b *BatchManager) IsActive() bool + func (b *BatchManager) SetCurrent(stmt Statement) + func (b *BatchManager) Start(mode batchMode) error + func (b *BatchManager) TakeForExecution() (Statement, error) + type ConnectionVars struct + Database string + EmulatorPlatform string + EnableADCPlus bool + Host string + ImpersonateServiceAccount string + Insecure bool + Instance string + Port int + Project string + Role string + WithoutAuthentication bool + type DisplayVars struct + AnalyzeColumns string + AutoWrap bool + CLIFormat enums.DisplayMode + EnableHighlight bool + EnableProgressBar bool + ExplainFormat enums.ExplainFormat + ExplainWrapWidth int64 + FixedWidth *int64 + HistoryFile string + InlineStats string + MarkdownCodeblock bool + MultilineProtoText bool + OutputTemplate *template.Template + OutputTemplateFile string + ParsedAnalyzeColumns []columnRenderDef + ParsedInlineStats []inlineStatsDef + Prompt string + Prompt2 string + SQLBatchSize int64 + SQLTableName string + SkipColumnNames bool + StyledOutput enums.StyledMode + SuppressResultLines bool + TabWidth int64 + TypeStylesRaw string + UsePager bool + Verbose bool type EnumVar + func StyledModeVar(ptr *enums.StyledMode, desc string) *EnumVar[enums.StyledMode] + type FeatureVars struct + AsyncDDL bool + AutoConnectAfterCreate bool + DatabaseDialect databasepb.DatabaseDialect + EchoExecutedDDL bool + EchoInput bool + FuzzyFinderKey string + FuzzyFinderOptions string + LogGrpc bool + LogLevel slog.Level + MCP bool + SkipSystemCommand bool + VertexAIModel string + VertexAIProject string + type InternalVars struct + LastQueryCache *LastQueryCache + ProtoDescriptor *descriptorpb.FileDescriptorSet + ProtoDescriptorFile []string + type QueryVars struct + AutoPartitionMode bool + BuildStatementMode enums.ParseMode + DataBoostEnabled bool + DirectedRead *sppb.DirectedReadOptions + LintPlan bool + MaxPartitionedParallelism int64 + OptimizerStatisticsPackage string + OptimizerVersion string + Profile bool + QueryMode *sppb.ExecuteSqlRequest_QueryMode + RPCPriority sppb.RequestOptions_Priority + ReadOnlyStaleness *spanner.TimestampBound + ReadTimestamp time.Time + StatementTimeout *time.Duration + StreamingMode enums.StreamingMode + TablePreviewRows int64 + TryPartitionQuery bool + type TransactionManager struct + func NewTransactionManager(client *spanner.Client, sysVars *systemVariables, ...) *TransactionManager + func (tm *TransactionManager) BeginPendingTransaction(ctx context.Context, isolationLevel sppb.TransactionOptions_IsolationLevel, ...) error + func (tm *TransactionManager) BeginReadOnlyTransaction(ctx context.Context, typ timestampBoundType, staleness time.Duration, ...) (time.Time, error) + func (tm *TransactionManager) BeginReadOnlyTransactionLocked(ctx context.Context, typ timestampBoundType, staleness time.Duration, ...) (time.Time, error) + func (tm *TransactionManager) BeginReadWriteTransaction(ctx context.Context, isolationLevel sppb.TransactionOptions_IsolationLevel, ...) error + func (tm *TransactionManager) BeginReadWriteTransactionLocked(ctx context.Context, isolationLevel sppb.TransactionOptions_IsolationLevel, ...) error + func (tm *TransactionManager) ClosePendingTransaction() error + func (tm *TransactionManager) CloseReadOnlyTransaction() error + func (tm *TransactionManager) CommitReadWriteTransaction(ctx context.Context) (spanner.CommitResponse, error) + func (tm *TransactionManager) CommitReadWriteTransactionLocked(ctx context.Context) (spanner.CommitResponse, error) + func (tm *TransactionManager) DetermineTransaction(ctx context.Context) (time.Time, error) + func (tm *TransactionManager) DetermineTransactionAndState(ctx context.Context) (time.Time, bool, error) + func (tm *TransactionManager) DetermineTransactionLocked(ctx context.Context) (time.Time, error) + func (tm *TransactionManager) GetTransactionFlagsWithLock() (inTransaction bool, inReadWriteTransaction bool) + func (tm *TransactionManager) InPendingTransaction() bool + func (tm *TransactionManager) InReadOnlyTransaction() bool + func (tm *TransactionManager) InReadWriteTransaction() bool + func (tm *TransactionManager) InTransaction() bool + func (tm *TransactionManager) NewTransactionOptionsBuilder() *TransactionOptionsBuilder + func (tm *TransactionManager) RollbackReadWriteTransaction(ctx context.Context) error + func (tm *TransactionManager) RollbackReadWriteTransactionLocked(ctx context.Context) error + func (tm *TransactionManager) RunAnalyzeQuery(ctx context.Context, stmt spanner.Statement) (*sppb.QueryPlan, *sppb.ResultSetMetadata, error) + func (tm *TransactionManager) RunInNewOrExistRwTx(ctx context.Context, ...) (*DMLResult, error) + func (tm *TransactionManager) RunInNewOrExistRwTxLocked(ctx context.Context, ...) (*DMLResult, error) + func (tm *TransactionManager) RunPartitionQuery(ctx context.Context, stmt spanner.Statement) ([]*spanner.Partition, *spanner.BatchReadOnlyTransaction, error) + func (tm *TransactionManager) RunQuery(ctx context.Context, stmt spanner.Statement) (*spanner.RowIterator, *spanner.ReadOnlyTransaction) + func (tm *TransactionManager) RunQueryWithStats(ctx context.Context, stmt spanner.Statement, implicit bool) (*spanner.RowIterator, *spanner.ReadOnlyTransaction) + func (tm *TransactionManager) RunUpdate(ctx context.Context, stmt spanner.Statement, implicit bool) ([]Row, map[string]any, int64, *sppb.ResultSetMetadata, *sppb.QueryPlan, error) + func (tm *TransactionManager) TransactionAttrsWithLock() transactionAttributes + func (tm *TransactionManager) TransactionMode() transactionMode + func (tm *TransactionManager) TransactionState() (mode transactionMode, isActive bool) + func (tm *TransactionManager) TransitTransaction(ctx context.Context, ...) error + func (tm *TransactionManager) ValidateDatabaseOperation() error + type TransactionVars struct + AutoBatchDML bool + Autocommit bool + AutocommitDMLMode enums.AutocommitDMLMode + CommitResponse *sppb.CommitResponse + CommitTimestamp time.Time + DefaultIsolationLevel sppb.TransactionOptions_IsolationLevel + ExcludeTxnFromChangeStreams bool + MaxCommitDelay *time.Duration + ReadLockMode sppb.TransactionOptions_ReadWrite_ReadLockMode + ReadOnly bool + RequestTag string + RetryAbortsInternally bool + ReturnCommitStats bool + TransactionTag string v0.27.0 Mar 1, 2026 Changes in this version + const DefaultAnalyzeColumns + var DefaultParsedAnalyzeColumns = lo.Must(customListToTableRenderDefs(DefaultAnalyzeColumns)) + var ErrNoTransaction = errors.New("no active transaction") + var ErrNotInPendingTransaction = errors.New("not in pending transaction") + var ErrNotInReadOnlyTransaction = errors.New("not in read-only transaction") + var ErrNotInReadWriteTransaction = errors.New("not in read-write transaction") + func GetExitCode(err error) int + func GetTerminalSize(w io.Writer) (int, error) + func InterceptorLogger(l *zap.Logger) logging.Logger + func IsMetaCommand(line string) bool + func LinkTypePred(typ string) func(cl *sppb.PlanNode_ChildLink) bool + func ListAvailableSamples() string + func Main(version, installFrom string) + func NewExitCodeError(exitCode int) error + func PS1PS2FuncToPromptFunc(ps1F func() string, ps2F func(ps1 string) string) func(w io.Writer, lnum int) (int, error) + func ParseStatements(content []byte, filename string) ([]string, error) + func SetLogLevel(logLevel string) (slog.Level, error) + func ValidateSpannerOptions(opts *spannerOptions) error + type AbortBatchStatement struct + func (s *AbortBatchStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type AddSplitPointsStatement struct + SplitPoints []*databasepb.SplitPoints + func (s *AddSplitPointsStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type BatchDMLStatement struct + DMLs []spanner.Statement + func (BatchDMLStatement) IsMutationStatement() + func (s *BatchDMLStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type BatchInfo struct + Mode batchMode + Size int + type BeginRoStatement struct + Priority sppb.RequestOptions_Priority + Staleness time.Duration + Timestamp time.Time + TimestampBoundType timestampBoundType + func (s *BeginRoStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type BeginRwStatement struct + IsolationLevel sppb.TransactionOptions_IsolationLevel + Priority sppb.RequestOptions_Priority + func (s *BeginRwStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type BeginStatement struct + IsolationLevel sppb.TransactionOptions_IsolationLevel + Priority sppb.RequestOptions_Priority + func (s *BeginStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type BufferedProcessor struct + func NewBufferedProcessor(formatter format.FormatFunc, out io.Writer, screenWidth int) *BufferedProcessor + func (p *BufferedProcessor) Finish(stats QueryStats, rowCount int64) error + func (p *BufferedProcessor) Init(metadata *sppb.ResultSetMetadata, sysVars *systemVariables) error + func (p *BufferedProcessor) ProcessRow(row Row) error + type BulkDdlStatement struct + Ddls []string + func (BulkDdlStatement) IsMutationStatement() + func (s *BulkDdlStatement) Execute(ctx context.Context, session *Session) (*Result, error) + func (s *BulkDdlStatement) String() string + type CQLStatement struct + CQL string + func (cs *CQLStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type Cli struct + Credential []byte + SessionHandler *SessionHandler + SystemVariables *systemVariables + func NewCli(ctx context.Context, credential []byte, sysVars *systemVariables) (*Cli, error) + func (c *Cli) ExitOnError(err error) int + func (c *Cli) GetErrStream() io.Writer + func (c *Cli) GetInStream() io.ReadCloser + func (c *Cli) GetTerminalSizeWithTty(w io.Writer) (int, error) + func (c *Cli) GetTtyStream() *os.File + func (c *Cli) GetWriter() io.Writer + func (c *Cli) PrintBatchError(err error) + func (c *Cli) PrintInteractiveError(err error) + func (c *Cli) PrintProgressingMark(w io.Writer) func() + func (c *Cli) PrintResult(screenWidth int, result *Result, interactive bool, input string, w io.Writer) error + func (c *Cli) RunBatch(ctx context.Context, input string) error + func (c *Cli) RunInteractive(ctx context.Context) error + func (c *Cli) RunMCP(ctx context.Context) error + type CommitStatement struct + func (s *CommitStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type CreateDatabaseStatement struct + CreateStatement string + func (CreateDatabaseStatement) IsMutationStatement() + func (s *CreateDatabaseStatement) Execute(ctx context.Context, session *Session) (*Result, error) + func (s *CreateDatabaseStatement) String() string + type CustomVar struct + func (c *CustomVar) Description() string + func (c *CustomVar) Get() (string, error) + func (c *CustomVar) IsReadOnly() bool + func (c *CustomVar) Set(value string) error + type DMLResult struct + Affected int64 + CommitResponse spanner.CommitResponse + Metadata *sppb.ResultSetMetadata + Plan *sppb.QueryPlan + type DdlStatement struct + Ddl string + func (s *DdlStatement) Execute(ctx context.Context, session *Session) (*Result, error) + func (s *DdlStatement) String() string + type DependencyResolver struct + func NewDependencyResolver() *DependencyResolver + func (dr *DependencyResolver) BuildDependencyGraphWithTxn(ctx context.Context, txn *spanner.ReadOnlyTransaction) error + func (dr *DependencyResolver) GetDependencyInfo(tableName string) (*TableDependency, error) + func (dr *DependencyResolver) GetOrderForTables(tablesToExport []string) ([]string, error) + func (dr *DependencyResolver) GetTableOrder() ([]string, error) + type DescribeStatement struct + IsDML bool + Statement string + func (s *DescribeStatement) Execute(ctx context.Context, session *Session) (*Result, error) + func (s *DescribeStatement) String() string + type DetachStatement struct + type DetachedCompatible interface + type DisableOutputRedirectMetaCommand struct + func (d *DisableOutputRedirectMetaCommand) Execute(ctx context.Context, session *Session) (*Result, error) + type DisableTeeMetaCommand struct + func (d *DisableTeeMetaCommand) Execute(ctx context.Context, session *Session) (*Result, error) + type DmlStatement struct + Dml string + func (s *DmlStatement) Execute(ctx context.Context, session *Session) (*Result, error) + func (s *DmlStatement) String() string + type DropDatabaseStatement struct + DatabaseId string + func (s *DropDatabaseStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type DumpDatabaseStatement struct + func (s *DumpDatabaseStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type DumpSchemaStatement struct + func (s *DumpSchemaStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type DumpTablesStatement struct + Tables []string + func (s *DumpTablesStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type EndpointVar struct + func (e *EndpointVar) Description() string + func (e *EndpointVar) Get() (string, error) + func (e *EndpointVar) IsReadOnly() bool + func (e *EndpointVar) Set(value string) error + type EnumVar struct + func AutocommitDMLModeVar(ptr *enums.AutocommitDMLMode, desc string) *EnumVar[enums.AutocommitDMLMode] + func DisplayModeVar(ptr *enums.DisplayMode, desc string) *EnumVar[enums.DisplayMode] + func ExplainFormatVar(ptr *enums.ExplainFormat, desc string) *EnumVar[enums.ExplainFormat] + func ParseModeVar(ptr *enums.ParseMode, desc string) *EnumVar[enums.ParseMode] + func StreamingModeVar(ptr *enums.StreamingMode, desc string) *EnumVar[enums.StreamingMode] + func (e *EnumVar[T]) Description() string + func (e *EnumVar[T]) Get() (string, error) + func (e *EnumVar[T]) IsReadOnly() bool + func (e *EnumVar[T]) Set(value string) error + func (e *EnumVar[T]) ValidValues() []string + type ErrAddNotSupported struct + Name string + func (e *ErrAddNotSupported) Error() string + type ErrUnknownVariable struct + Name string + func (e *ErrUnknownVariable) Error() string + type ExecuteStatementArgs struct + Statement string + type ExitCodeError struct + func (e *ExitCodeError) Error() string + type ExitStatement struct + type ExplainAnalyzeDmlStatement struct + Dml string + Format enums.ExplainFormat + Width int64 + func (s *ExplainAnalyzeDmlStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type ExplainAnalyzeStatement struct + Format enums.ExplainFormat + Query string + Width int64 + func (s *ExplainAnalyzeStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type ExplainLastQueryStatement struct + Analyze bool + Format enums.ExplainFormat + Width int64 + func (s *ExplainLastQueryStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type ExplainStatement struct + Explain string + Format enums.ExplainFormat + IsDML bool + Width int64 + func (s *ExplainStatement) Execute(ctx context.Context, session *Session) (*Result, error) + func (s *ExplainStatement) String() string + type FKReference struct + ChildTable string + ConstraintName string + ParentTable string + type GeminiStatement struct + Text string + func (s *GeminiStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type HelpStatement struct + func (s *HelpStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type HelpVariablesStatement struct + func (s *HelpVariablesStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type History interface + Add func(string) + type IntGetterVar struct + func (i *IntGetterVar) Description() string + func (i *IntGetterVar) Get() (string, error) + func (i *IntGetterVar) IsReadOnly() bool + func (i *IntGetterVar) Set(value string) error + type LastQueryCache struct + CommitTimestamp time.Time + QueryPlan *sppb.QueryPlan + QueryStats map[string]any + ReadTimestamp time.Time + type LogLevelVar struct + func (l *LogLevelVar) Description() string + func (l *LogLevelVar) Get() (string, error) + func (l *LogLevelVar) IsReadOnly() bool + func (l *LogLevelVar) Set(value string) error + func (l *LogLevelVar) ValidValues() []string + type MetaCommandStatement interface + type MutateStatement struct + Body string + Operation string + Table string + func (s *MutateStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type MutationStatement interface + type NopStatement struct + func (s *NopStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type OutputContext struct + CommitStats *sppb.CommitResponse_CommitStats + CommitTimestamp string + IsExecutedDML bool + Metrics *metrics.ExecutionMetrics + ReadTimestamp string + Stats *QueryStats + Verbose bool + type OutputRedirectMetaCommand struct + FilePath string + func (o *OutputRedirectMetaCommand) Execute(ctx context.Context, session *Session) (*Result, error) + type PartitionStatement struct + SQL string + func (s *PartitionStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type PartitionedDmlStatement struct + Dml string + func (s *PartitionedDmlStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type PromptMetaCommand struct + PromptString string + func (p *PromptMetaCommand) Execute(ctx context.Context, session *Session) (*Result, error) + type ProtoDescriptorVar struct + func (p *ProtoDescriptorVar) Add(value string) error + func (p *ProtoDescriptorVar) Description() string + func (p *ProtoDescriptorVar) Get() (string, error) + func (p *ProtoDescriptorVar) IsReadOnly() bool + func (p *ProtoDescriptorVar) Set(value string) error + type ProtoEnumVar struct + func DatabaseDialectVar(ptr *databasepb.DatabaseDialect, desc string) *ProtoEnumVar[databasepb.DatabaseDialect] + func IsolationLevelVar(ptr *sppb.TransactionOptions_IsolationLevel, desc string) *ProtoEnumVar[sppb.TransactionOptions_IsolationLevel] + func QueryModeVar(ptr *sppb.ExecuteSqlRequest_QueryMode, desc string) *ProtoEnumVar[sppb.ExecuteSqlRequest_QueryMode] + func RPCPriorityVar(ptr *sppb.RequestOptions_Priority, desc string) *ProtoEnumVar[sppb.RequestOptions_Priority] + func ReadLockModeVar(ptr *sppb.TransactionOptions_ReadWrite_ReadLockMode, desc string) *ProtoEnumVar[sppb.TransactionOptions_ReadWrite_ReadLockMode] + func (p *ProtoEnumVar[T]) Description() string + func (p *ProtoEnumVar[T]) Get() (string, error) + func (p *ProtoEnumVar[T]) IsReadOnly() bool + func (p *ProtoEnumVar[T]) Set(value string) error + func (p *ProtoEnumVar[T]) ValidValues() []string + type QueryIndexAdvice struct + DDL []string + ImprovementFactor float64 + type QueryResult struct + Iterator *spanner.RowIterator + Transaction *spanner.ReadOnlyTransaction + type QueryStats struct + BytesReturned string + CPUTime string + DataBytesRead string + DeletedRowsScanned string + ElapsedTime string + FilesystemDelaySeconds string + IsGraphQuery string + LockingDelay string + MemoryPeakUsageBytes string + MemoryUsagePercentage string + OptimizerStatisticsPackage string + OptimizerVersion string + QueryPlanCached string + QueryPlanCreationTime string + QueryText string + RemoteServerCalls string + RowsReturned string + RowsScanned string + RuntimeCached string + RuntimeCreationTime string + ServerQueueDelay string + StatisticsLoadTime string + TotalMemoryPeakUsageByte string + Unknown jsontext.Value + type ReadOnlyVar struct + func NewReadOnlyVar(getter func() string, desc string) *ReadOnlyVar + func (r *ReadOnlyVar) Description() string + func (r *ReadOnlyVar) Get() (string, error) + func (r *ReadOnlyVar) IsReadOnly() bool + func (r *ReadOnlyVar) Set(value string) error + type Result struct + AffectedRows int + AffectedRowsType rowCountType + BatchInfo *BatchInfo + ColumnAlign []tw.Align + CommitStats *sppb.CommitResponse_CommitStats + CommitTimestamp time.Time + ForceVerbose bool + ForceWrap bool + HasSQLFormattedValues bool + IndexAdvice []QueryIndexAdvice + IsDirectOutput bool + IsExecutedDML bool + KeepVariables bool + LintResults []string + Metrics *metrics.ExecutionMetrics + PartitionCount int + PreInput string + Predicates []string + ReadTimestamp time.Time + Rows []Row + SQLTableNameForExport string + Stats QueryStats + Streamed bool + TableHeader TableHeader + type RollbackStatement struct + func (s *RollbackStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type Row = format.Row + type RowIterResult struct + Error error + Metadata *sppb.ResultSetMetadata + QueryPlan *sppb.QueryPlan + QueryStats map[string]interface{} + RowCount int64 + Rows iter.Seq[Row] + type RowProcessor interface + Finish func(stats QueryStats, rowCount int64) error + Init func(metadata *sppb.ResultSetMetadata, sysVars *systemVariables) error + ProcessRow func(row Row) error + func NewStreamingProcessorForMode(mode enums.DisplayMode, out io.Writer, sysVars *systemVariables, ...) RowProcessor + type RunBatchStatement struct + func (s *RunBatchStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type RunPartitionStatement struct + Token string + func (s *RunPartitionStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type RunPartitionedQueryStatement struct + SQL string + func (s *RunPartitionedQueryStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type SampleDatabase struct + BaseDir string + DataURI string + Description string + Dialect string + IsEmbedded bool + Name string + ParsedDialect databasepb.DatabaseDialect + SchemaURI string + Source string + func (s *SampleDatabase) ResolveURIs() + type SelectStatement struct + Query string + func (s *SelectStatement) Execute(ctx context.Context, session *Session) (*Result, error) + func (s *SelectStatement) String() string + type Session struct + func NewAdminSession(ctx context.Context, sysVars *systemVariables, opts ...option.ClientOption) (*Session, error) + func NewSession(ctx context.Context, sysVars *systemVariables, opts ...option.ClientOption) (*Session, error) + func (s *Session) BeginPendingTransaction(ctx context.Context, isolationLevel sppb.TransactionOptions_IsolationLevel, ...) error + func (s *Session) BeginReadOnlyTransaction(ctx context.Context, typ timestampBoundType, staleness time.Duration, ...) (time.Time, error) + func (s *Session) BeginReadOnlyTransactionLocked(ctx context.Context, typ timestampBoundType, staleness time.Duration, ...) (time.Time, error) + func (s *Session) BeginReadWriteTransaction(ctx context.Context, isolationLevel sppb.TransactionOptions_IsolationLevel, ...) error + func (s *Session) BeginReadWriteTransactionLocked(ctx context.Context, isolationLevel sppb.TransactionOptions_IsolationLevel, ...) error + func (s *Session) Close() + func (s *Session) ClosePendingTransaction() error + func (s *Session) CloseReadOnlyTransaction() error + func (s *Session) CommitReadWriteTransaction(ctx context.Context) (spanner.CommitResponse, error) + func (s *Session) CommitReadWriteTransactionLocked(ctx context.Context) (spanner.CommitResponse, error) + func (s *Session) ConnectToDatabase(ctx context.Context, databaseId string) error + func (s *Session) DatabaseExists(ctx context.Context) (bool, error) + func (s *Session) DatabasePath() string + func (s *Session) DetermineTransaction(ctx context.Context) (time.Time, error) + func (s *Session) DetermineTransactionAndState(ctx context.Context) (time.Time, bool, error) + func (s *Session) DetermineTransactionLocked(ctx context.Context) (time.Time, error) + func (s *Session) ExecuteStatement(ctx context.Context, stmt Statement) (result *Result, err error) + func (s *Session) GetDatabaseSchema(ctx context.Context) ([]string, *descriptorpb.FileDescriptorSet, error) + func (s *Session) GetTransactionFlagsWithLock() (inTransaction bool, inReadWriteTransaction bool) + func (s *Session) InPendingTransaction() bool + func (s *Session) InReadOnlyTransaction() bool + func (s *Session) InReadWriteTransaction() bool + func (s *Session) InTransaction() bool + func (s *Session) IncrementSchemaGeneration() + func (s *Session) InstanceExists() (bool, error) + func (s *Session) InstancePath() string + func (s *Session) IsDetached() bool + func (s *Session) Mode() SessionMode + func (s *Session) NewTransactionOptionsBuilder() *TransactionOptionsBuilder + func (s *Session) RecreateClient() error + func (s *Session) RequiresDatabaseConnection() bool + func (s *Session) RollbackReadWriteTransaction(ctx context.Context) error + func (s *Session) RollbackReadWriteTransactionLocked(ctx context.Context) error + func (s *Session) RunAnalyzeQuery(ctx context.Context, stmt spanner.Statement) (*sppb.QueryPlan, *sppb.ResultSetMetadata, error) + func (s *Session) RunInNewOrExistRwTx(ctx context.Context, ...) (*DMLResult, error) + func (s *Session) RunInNewOrExistRwTxLocked(ctx context.Context, ...) (*DMLResult, error) + func (s *Session) RunPartitionQuery(ctx context.Context, stmt spanner.Statement) ([]*spanner.Partition, *spanner.BatchReadOnlyTransaction, error) + func (s *Session) RunQuery(ctx context.Context, stmt spanner.Statement) (*spanner.RowIterator, *spanner.ReadOnlyTransaction) + func (s *Session) RunQueryWithStats(ctx context.Context, stmt spanner.Statement, implicit bool) (*spanner.RowIterator, *spanner.ReadOnlyTransaction) + func (s *Session) RunUpdate(ctx context.Context, stmt spanner.Statement, implicit bool) ([]Row, map[string]any, int64, *sppb.ResultSetMetadata, *sppb.QueryPlan, error) + func (s *Session) SchemaGeneration() uint64 + func (s *Session) TransactionAttrsWithLock() transactionAttributes + func (s *Session) TransactionMode() transactionMode + func (s *Session) TransactionState() (mode transactionMode, isActive bool) + func (s *Session) TransitTransaction(ctx context.Context, ...) error + func (s *Session) ValidateDatabaseOperation() error + func (s *Session) ValidateDetachedOperation() error + func (s *Session) ValidateStatementExecution(stmt Statement) error + type SessionHandler struct + func NewSessionHandler(session *Session) *SessionHandler + func (h *SessionHandler) Close() + func (h *SessionHandler) ExecuteStatement(ctx context.Context, stmt Statement) (*Result, error) + func (h *SessionHandler) GetSession() *Session + type SessionMode int + const DatabaseConnected + const Detached + type SetAddStatement struct + Value string + VarName string + func (s *SetAddStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type SetParamTypeStatement struct + Name string + Type string + func (s *SetParamTypeStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type SetParamValueStatement struct + Name string + Value string + func (s *SetParamValueStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type SetStatement struct + Value string + VarName string + func (s *SetStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type SetTransactionStatement struct + IsReadOnly bool + func (s *SetTransactionStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type ShellMetaCommand struct + Command string + func (s *ShellMetaCommand) Execute(ctx context.Context, session *Session) (*Result, error) + type ShowColumnsStatement struct + Schema string + Table string + func (s *ShowColumnsStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type ShowCreateStatement struct + Name string + ObjectType string + Schema string + func (s *ShowCreateStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type ShowDatabasesStatement struct + func (s *ShowDatabasesStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type ShowDdlsStatement struct + func (s *ShowDdlsStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type ShowIndexStatement struct + Schema string + Table string + func (s *ShowIndexStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type ShowLocalProtoStatement struct + func (s *ShowLocalProtoStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type ShowOperationStatement struct + Mode string + OperationId string + func (s *ShowOperationStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type ShowParamsStatement struct + func (s *ShowParamsStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type ShowPlanNodeStatement struct + NodeID int + func (s *ShowPlanNodeStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type ShowQueryProfileStatement struct + Fprint int64 + func (s *ShowQueryProfileStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type ShowQueryProfilesStatement struct + func (s *ShowQueryProfilesStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type ShowRemoteProtoStatement struct + func (s *ShowRemoteProtoStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type ShowSchemaUpdateOperations struct + func (s *ShowSchemaUpdateOperations) Execute(ctx context.Context, session *Session) (*Result, error) + type ShowSplitPointsStatement struct + func (s *ShowSplitPointsStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type ShowTablesStatement struct + Schema string + func (s *ShowTablesStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type ShowVariableStatement struct + VarName string + func (s *ShowVariableStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type ShowVariablesStatement struct + func (s *ShowVariablesStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type SourceMetaCommand struct + FilePath string + func (s *SourceMetaCommand) Execute(ctx context.Context, session *Session) (*Result, error) + type StartBatchStatement struct + Mode batchMode + func (s *StartBatchStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type Statement interface + Execute func(ctx context.Context, session *Session) (*Result, error) + func BuildCLIStatement(stripped, raw string) (Statement, error) + func BuildNativeStatementLexical(stripped string, raw string) (Statement, error) + func BuildNativeStatementMemefish(stripped, raw string) (Statement, error) + func BuildStatement(input string) (Statement, error) + func BuildStatementWithComments(stripped, raw string) (Statement, error) + func BuildStatementWithCommentsWithMode(stripped, raw string, mode enums.ParseMode) (Statement, error) + func ParseMetaCommand(input string) (Statement, error) + type StreamingProcessor struct + func NewStreamingProcessor(formatter format.StreamingFormatter, out io.Writer, screenWidth int) *StreamingProcessor + func (p *StreamingProcessor) Finish(stats QueryStats, rowCount int64) error + func (p *StreamingProcessor) Init(metadata *sppb.ResultSetMetadata, sysVars *systemVariables) error + func (p *StreamingProcessor) ProcessRow(row Row) error + type SyncProtoStatement struct + DeletePaths []string + UpsertPaths []string + func (s *SyncProtoStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type TableDependency struct + ChildrenTables []string + ForeignKeys []FKReference + Level int + OnDeleteAction string + ParentTable string + ReferencedBy []FKReference + TableName string + type TableHeader interface + Render func(verbose bool) []string + type TablePreviewProcessor struct + func NewTablePreviewProcessor(formatter format.StreamingFormatter, previewSize int) *TablePreviewProcessor + func (p *TablePreviewProcessor) Finish(stats QueryStats, rowCount int64) error + func (p *TablePreviewProcessor) Init(metadata *sppb.ResultSetMetadata, sysVars *systemVariables) error + func (p *TablePreviewProcessor) ProcessRow(row Row) error + type TeeOutputMetaCommand struct + FilePath string + func (t *TeeOutputMetaCommand) Execute(ctx context.Context, session *Session) (*Result, error) + type TemplateVar struct + func (t *TemplateVar) Description() string + func (t *TemplateVar) Get() (string, error) + func (t *TemplateVar) IsReadOnly() bool + func (t *TemplateVar) Set(value string) error + type TimestampBoundVar struct + func (t *TimestampBoundVar) Description() string + func (t *TimestampBoundVar) Get() (string, error) + func (t *TimestampBoundVar) IsReadOnly() bool + func (t *TimestampBoundVar) Set(value string) error + type TimestampVar struct + func (t *TimestampVar) Description() string + func (t *TimestampVar) Get() (string, error) + func (t *TimestampVar) IsReadOnly() bool + func (t *TimestampVar) Set(value string) error + type TransactionOptionsBuilder struct + func (b *TransactionOptionsBuilder) Build() spanner.TransactionOptions + func (b *TransactionOptionsBuilder) BuildIsolationLevel() sppb.TransactionOptions_IsolationLevel + func (b *TransactionOptionsBuilder) BuildPriority() sppb.RequestOptions_Priority + func (b *TransactionOptionsBuilder) WithIsolationLevel(level sppb.TransactionOptions_IsolationLevel) *TransactionOptionsBuilder + func (b *TransactionOptionsBuilder) WithPriority(priority sppb.RequestOptions_Priority) *TransactionOptionsBuilder + func (b *TransactionOptionsBuilder) WithTag(tag string) *TransactionOptionsBuilder + type TruncateTableStatement struct + Schema string + Table string + func (s *TruncateTableStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type TryPartitionedQueryStatement struct + SQL string + func (s *TryPartitionedQueryStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type UnimplementedVar struct + func (u *UnimplementedVar) Description() string + func (u *UnimplementedVar) Get() (string, error) + func (u *UnimplementedVar) IsReadOnly() bool + func (u *UnimplementedVar) Set(value string) error + type UnsetParamStatement struct + Name string + func (s *UnsetParamStatement) Execute(ctx context.Context, session *Session) (*Result, error) + type UpdateResult struct + Count int64 + Metadata *sppb.ResultSetMetadata + Plan *sppb.QueryPlan + Rows []Row + Stats map[string]any + type UseDatabaseMetaCommand struct + Database string + func (s *UseDatabaseMetaCommand) Execute(ctx context.Context, session *Session) (*Result, error) + type UseStatement struct + Database string + Role string + type ValidValuesEnumerator interface + ValidValues func() []string + type VarHandler struct + func BoolVar(ptr *bool, desc string) *VarHandler[bool] + func IntVar(ptr *int64, desc string) *VarHandler[int64] + func NullableDurationVar(ptr **time.Duration, desc string) *VarHandler[*time.Duration] + func NullableIntVar(ptr **int64, desc string) *VarHandler[*int64] + func StringVar(ptr *string, desc string) *VarHandler[string] + func (h *VarHandler[T]) AsReadOnly() *VarHandler[T] + func (h *VarHandler[T]) Description() string + func (h *VarHandler[T]) Get() (string, error) + func (h *VarHandler[T]) IsReadOnly() bool + func (h *VarHandler[T]) Set(value string) error + func (h *VarHandler[T]) ValidValues() []string + func (h *VarHandler[T]) WithValidator(validate func(T) error) *VarHandler[T] + type VarRegistry struct + func NewVarRegistry(sv *systemVariables) *VarRegistry + func (r *VarRegistry) Add(name, value string) error + func (r *VarRegistry) Get(name string) (string, error) + func (r *VarRegistry) GetDescription(name string) (string, error) + func (r *VarRegistry) GetVariable(name string) Variable + func (r *VarRegistry) IsReadOnly(name string) (bool, error) + func (r *VarRegistry) ListVariableInfo() map[string]struct{ ... } + func (r *VarRegistry) ListVariables() map[string]string + func (r *VarRegistry) Register(name string, v Variable) + func (r *VarRegistry) RegisterWithAdd(name string, v Variable, addFunc func(string) error) + func (r *VarRegistry) Set(name, value string, isGoogleSQL bool) error + type Variable interface + Description func() string + Get func() (string, error) + IsReadOnly func() bool + Set func(string) error