Documentation
¶
Overview ¶
Package ast defines the Abstract Syntax Tree nodes for T-SQL.
Index ¶
- type AlterActionType
- type AlterApplicationRoleStatement
- type AlterAssemblyStatement
- type AlterAvailabilityGroupStatement
- type AlterDatabaseStatement
- type AlterFulltextIndexStatement
- type AlterFunctionStatement
- type AlterIndexStatement
- type AlterLoginStatement
- type AlterPartitionFunctionStatement
- type AlterPartitionSchemeStatement
- type AlterProcedureStatement
- type AlterQueueStatement
- type AlterResourceGovernorStatement
- type AlterResourcePoolStatement
- type AlterRoleStatement
- type AlterSequenceStatement
- type AlterServerRoleStatement
- type AlterTableAction
- type AlterTableStatement
- type AlterTriggerStatement
- type AlterUserStatement
- type AlterViewStatement
- type AlterWorkloadGroupStatement
- type AtTimeZoneExpression
- type AvailabilityReplica
- type BackupLocation
- type BackupOption
- type BackupStatement
- type BeginDialogStatement
- type BeginEndBlock
- type BeginTransactionStatement
- type BetweenExpression
- type BinaryLiteral
- type BreakStatement
- type BulkInsertStatement
- type CTEDef
- type CaseExpression
- type CastExpression
- type CloseCursorStatement
- type CloseSymmetricKeyStatement
- type CollateExpression
- type ColumnConstraint
- type ColumnDefinition
- type CommitTransactionStatement
- type ConstraintType
- type ContainsExpression
- type ContainsTableExpression
- type ContinueStatement
- type ContractMessage
- type ConvertExpression
- type CreateApplicationRoleStatement
- type CreateAssemblyStatement
- type CreateAsymmetricKeyStatement
- type CreateAvailabilityGroupStatement
- type CreateCertificateStatement
- type CreateContractStatement
- type CreateCredentialStatement
- type CreateDatabaseScopedCredentialStatement
- type CreateDefaultStatement
- type CreateFulltextCatalogStatement
- type CreateFulltextIndexStatement
- type CreateFunctionStatement
- type CreateIndexStatement
- type CreateLoginStatement
- type CreateMasterKeyStatement
- type CreateMessageTypeStatement
- type CreatePartitionFunctionStatement
- type CreatePartitionSchemeStatement
- type CreateProcedureStatement
- type CreateQueueStatement
- type CreateResourcePoolStatement
- type CreateRoleStatement
- type CreateRuleStatement
- type CreateSchemaStatement
- type CreateSequenceStatement
- type CreateServerRoleStatement
- type CreateServiceStatement
- type CreateStatisticsStatement
- type CreateSymmetricKeyStatement
- type CreateSynonymStatement
- type CreateTableStatement
- type CreateTriggerStatement
- type CreateTypeStatement
- type CreateUserStatement
- type CreateViewStatement
- type CreateWorkloadGroupStatement
- type CreateXmlIndexStatement
- type CreateXmlSchemaCollectionStatement
- type CubeExpression
- type CursorExpression
- type CursorOptions
- type DataType
- type DbccStatement
- type DeallocateCursorStatement
- type DeclareCursorStatement
- type DeclareStatement
- type DeleteStatement
- type DenyStatement
- type DerivedTable
- type DmlDerivedTable
- type DropAvailabilityGroupStatement
- type DropFulltextCatalogStatement
- type DropFulltextIndexStatement
- type DropIndexStatement
- type DropObjectStatement
- type DropResourcePoolStatement
- type DropSequenceStatement
- type DropStatisticsStatement
- type DropSynonymStatement
- type DropTableStatement
- type DropWorkloadGroupStatement
- type EnableDisableTriggerStatement
- type EndConversationStatement
- type ExecParameter
- type ExecStatement
- type ExecuteAsStatement
- type ExistsExpression
- type Expression
- type ExpressionStatement
- type FetchStatement
- type FloatLiteral
- type ForClause
- type FrameBound
- type FreetextExpression
- type FreetextTableExpression
- type FromClause
- type FulltextColumn
- type FunctionCall
- type FunctionType
- type GetConversationGroupStatement
- type GoStatement
- type GotoStatement
- type GrantStatement
- type GroupingSetsExpression
- type Identifier
- type IdentitySpec
- type IfStatement
- type InExpression
- type IndexColumn
- type InfixExpression
- type InlineIndex
- type InsertStatement
- type IntegerLiteral
- type IsDistinctFromExpression
- type IsNullExpression
- type JoinClause
- type JsonKeyValuePair
- type LabelStatement
- type LikeExpression
- type MergeActionType
- type MergeStatement
- type MergeWhenClause
- type MergeWhenType
- type MethodCallExpression
- type MoneyLiteral
- type MoveConversationStatement
- type NextValueForExpression
- type Node
- type NullLiteral
- type OpenCursorStatement
- type OpenJsonColumn
- type OpenSymmetricKeyStatement
- type OptimizeForHint
- type OrderByItem
- type OutputClause
- type OverClause
- type ParameterDef
- type ParenthesizedTableRef
- type ParseExpression
- type PartitionRange
- type PivotTable
- type PrefixExpression
- type PrintStatement
- type Program
- type QualifiedIdentifier
- type QueryOption
- type RaiserrorStatement
- type ReceiveColumn
- type ReceiveStatement
- type ReconfigureStatement
- type RestoreStatement
- type ResultSetColumn
- type ResultSetDefinition
- type ReturnStatement
- type RevertStatement
- type RevokeStatement
- type RollbackTransactionStatement
- type RollupExpression
- type SaveTransactionStatement
- type SelectColumn
- type SelectStatement
- type SendOnConversationStatement
- type SetClause
- type SetOptionStatement
- type SetStatement
- type SetTransactionIsolationStatement
- type Statement
- type StaticMethodCall
- type StringLiteral
- type SubqueryExpression
- type TableConstraint
- type TableName
- type TableReference
- type TableSampleClause
- type TableTypeDefinition
- type TableValuedFunction
- type TemporalClause
- type ThrowStatement
- type TopClause
- type TriggerTiming
- type TrimExpression
- type TruncateTableStatement
- type TryCatchStatement
- type TupleExpression
- type UnionClause
- type UnpivotTable
- type UpdateStatement
- type UpdateStatisticsStatement
- type UseStatement
- type ValuesTable
- type Variable
- type VariableDef
- type WaitforStatement
- type WhenClause
- type WhileStatement
- type WindowDefinition
- type WindowFrame
- type WithStatement
- type WithXmlnamespacesStatement
- type XmlNamespaceDef
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlterActionType ¶
type AlterActionType int
const ( AlterAddColumn AlterActionType = iota AlterDropColumn AlterAlterColumn AlterAddConstraint AlterDropConstraint AlterRenameColumn AlterEnableTrigger AlterDisableTrigger AlterSetOption AlterCheckConstraint // CHECK CONSTRAINT name AlterNoCheckConstraint // NOCHECK CONSTRAINT name AlterSwitch // SWITCH [PARTITION n] TO target [PARTITION n] AlterRebuild // REBUILD )
type AlterApplicationRoleStatement ¶
type AlterApplicationRoleStatement struct {
Token token.Token
Name string
Password string
Schema string
NewName string
}
AlterApplicationRoleStatement represents ALTER APPLICATION ROLE
func (*AlterApplicationRoleStatement) String ¶
func (a *AlterApplicationRoleStatement) String() string
func (*AlterApplicationRoleStatement) TokenLiteral ¶
func (a *AlterApplicationRoleStatement) TokenLiteral() string
type AlterAssemblyStatement ¶
type AlterAssemblyStatement struct {
Token token.Token
Name string
FromPath string // FROM 'path'
FromBinary string // FROM 0x...
PermissionSet string // WITH PERMISSION_SET = ...
}
AlterAssemblyStatement represents ALTER ASSEMBLY statement.
func (*AlterAssemblyStatement) String ¶
func (aa *AlterAssemblyStatement) String() string
func (*AlterAssemblyStatement) TokenLiteral ¶
func (aa *AlterAssemblyStatement) TokenLiteral() string
type AlterAvailabilityGroupStatement ¶
type AlterAvailabilityGroupStatement struct {
Token token.Token
Name string
Action string // ADD DATABASE, REMOVE DATABASE, FAILOVER, FORCE_FAILOVER_ALLOW_DATA_LOSS, etc.
Databases []string // For ADD/REMOVE DATABASE
Replicas []*AvailabilityReplica // For ADD/MODIFY REPLICA
}
AlterAvailabilityGroupStatement represents ALTER AVAILABILITY GROUP.
func (*AlterAvailabilityGroupStatement) String ¶
func (aag *AlterAvailabilityGroupStatement) String() string
func (*AlterAvailabilityGroupStatement) TokenLiteral ¶
func (aag *AlterAvailabilityGroupStatement) TokenLiteral() string
type AlterDatabaseStatement ¶
type AlterDatabaseStatement struct {
Token token.Token
Name *Identifier
Options string // Raw options (SET SINGLE_USER WITH ROLLBACK IMMEDIATE, etc.)
}
AlterDatabaseStatement represents ALTER DATABASE.
func (*AlterDatabaseStatement) String ¶
func (ad *AlterDatabaseStatement) String() string
func (*AlterDatabaseStatement) TokenLiteral ¶
func (ad *AlterDatabaseStatement) TokenLiteral() string
type AlterFulltextIndexStatement ¶
type AlterFulltextIndexStatement struct {
Token token.Token
TableName *QualifiedIdentifier
Action string // ADD, DROP, ENABLE, DISABLE, START/STOP POPULATION, etc.
Columns []*FulltextColumn // Columns for ADD/DROP
}
AlterFulltextIndexStatement represents ALTER FULLTEXT INDEX ON table.
func (*AlterFulltextIndexStatement) String ¶
func (afi *AlterFulltextIndexStatement) String() string
func (*AlterFulltextIndexStatement) TokenLiteral ¶
func (afi *AlterFulltextIndexStatement) TokenLiteral() string
type AlterFunctionStatement ¶
type AlterFunctionStatement struct {
Token token.Token
Name *QualifiedIdentifier
Parameters []*ParameterDef
ReturnType *DataType
ReturnsTable bool
TableDef *TableTypeDefinition
TableVar string
Options []string
AsReturn Expression
Body *BeginEndBlock
}
AlterFunctionStatement represents an ALTER FUNCTION statement.
func (*AlterFunctionStatement) String ¶
func (af *AlterFunctionStatement) String() string
func (*AlterFunctionStatement) TokenLiteral ¶
func (af *AlterFunctionStatement) TokenLiteral() string
type AlterIndexStatement ¶
type AlterIndexStatement struct {
Token token.Token
Name *Identifier // Index name or ALL
Table *QualifiedIdentifier // Table name
Action string // REBUILD, REORGANIZE, DISABLE, etc.
Options []string // WITH options
}
AlterIndexStatement represents an ALTER INDEX statement.
func (*AlterIndexStatement) String ¶
func (ai *AlterIndexStatement) String() string
func (*AlterIndexStatement) TokenLiteral ¶
func (ai *AlterIndexStatement) TokenLiteral() string
type AlterLoginStatement ¶
type AlterLoginStatement struct {
Token token.Token
Name string
Enable bool
Disable bool
Password string
OldPassword string
}
AlterLoginStatement represents ALTER LOGIN statement.
func (*AlterLoginStatement) String ¶
func (als *AlterLoginStatement) String() string
func (*AlterLoginStatement) TokenLiteral ¶
func (als *AlterLoginStatement) TokenLiteral() string
type AlterPartitionFunctionStatement ¶
type AlterPartitionFunctionStatement struct {
Token token.Token
Name string
Action string // SPLIT or MERGE
RangeValue Expression // The boundary value
}
AlterPartitionFunctionStatement represents ALTER PARTITION FUNCTION statement.
func (*AlterPartitionFunctionStatement) String ¶
func (apf *AlterPartitionFunctionStatement) String() string
func (*AlterPartitionFunctionStatement) TokenLiteral ¶
func (apf *AlterPartitionFunctionStatement) TokenLiteral() string
type AlterPartitionSchemeStatement ¶
type AlterPartitionSchemeStatement struct {
Token token.Token
Name string
NextUsed string // NEXT USED filegroup
}
AlterPartitionSchemeStatement represents ALTER PARTITION SCHEME statement.
func (*AlterPartitionSchemeStatement) String ¶
func (aps *AlterPartitionSchemeStatement) String() string
func (*AlterPartitionSchemeStatement) TokenLiteral ¶
func (aps *AlterPartitionSchemeStatement) TokenLiteral() string
type AlterProcedureStatement ¶
type AlterProcedureStatement struct {
Token token.Token
Name *QualifiedIdentifier
Parameters []*ParameterDef
Body *BeginEndBlock
Options []string
}
AlterProcedureStatement represents an ALTER PROCEDURE statement.
func (*AlterProcedureStatement) String ¶
func (ap *AlterProcedureStatement) String() string
func (*AlterProcedureStatement) TokenLiteral ¶
func (ap *AlterProcedureStatement) TokenLiteral() string
type AlterQueueStatement ¶
type AlterQueueStatement struct {
Token token.Token
Name *QualifiedIdentifier
Options map[string]string
}
AlterQueueStatement represents ALTER QUEUE.
func (*AlterQueueStatement) String ¶
func (aq *AlterQueueStatement) String() string
func (*AlterQueueStatement) TokenLiteral ¶
func (aq *AlterQueueStatement) TokenLiteral() string
type AlterResourceGovernorStatement ¶
type AlterResourceGovernorStatement struct {
Token token.Token
Action string // RECONFIGURE, DISABLE, RESET STATISTICS
ClassifierFunction string // CLASSIFIER_FUNCTION = schema.function or NULL
}
AlterResourceGovernorStatement represents ALTER RESOURCE GOVERNOR.
func (*AlterResourceGovernorStatement) String ¶
func (arg *AlterResourceGovernorStatement) String() string
func (*AlterResourceGovernorStatement) TokenLiteral ¶
func (arg *AlterResourceGovernorStatement) TokenLiteral() string
type AlterResourcePoolStatement ¶
AlterResourcePoolStatement represents ALTER RESOURCE POOL.
func (*AlterResourcePoolStatement) String ¶
func (arp *AlterResourcePoolStatement) String() string
func (*AlterResourcePoolStatement) TokenLiteral ¶
func (arp *AlterResourcePoolStatement) TokenLiteral() string
type AlterRoleStatement ¶
type AlterRoleStatement struct {
Token token.Token
Name string
AddMember string // ADD MEMBER user_name
DropMember string // DROP MEMBER user_name
NewName string // WITH NAME = new_name
}
AlterRoleStatement represents ALTER ROLE statement.
func (*AlterRoleStatement) String ¶
func (ars *AlterRoleStatement) String() string
func (*AlterRoleStatement) TokenLiteral ¶
func (ars *AlterRoleStatement) TokenLiteral() string
type AlterSequenceStatement ¶
type AlterSequenceStatement struct {
Token token.Token
Name *QualifiedIdentifier
RestartWith Expression // RESTART WITH n
IncrementBy Expression
MinValue Expression
MaxValue Expression
NoMinValue bool
NoMaxValue bool
Cycle bool
NoCycle bool
Cache Expression
NoCache bool
}
AlterSequenceStatement represents ALTER SEQUENCE.
func (*AlterSequenceStatement) String ¶
func (as *AlterSequenceStatement) String() string
func (*AlterSequenceStatement) TokenLiteral ¶
func (as *AlterSequenceStatement) TokenLiteral() string
type AlterServerRoleStatement ¶
type AlterServerRoleStatement struct {
Token token.Token
Name string
AddMember string
DropMember string
NewName string
}
AlterServerRoleStatement represents ALTER SERVER ROLE
func (*AlterServerRoleStatement) String ¶
func (a *AlterServerRoleStatement) String() string
func (*AlterServerRoleStatement) TokenLiteral ¶
func (a *AlterServerRoleStatement) TokenLiteral() string
type AlterTableAction ¶
type AlterTableAction struct {
Type AlterActionType
Column *ColumnDefinition
Columns []*ColumnDefinition // For ADD with multiple columns
ColumnName *Identifier
NewDataType *DataType
Constraint *TableConstraint
ConstraintName string
NewColumnName *Identifier
TriggerName string // For ENABLE/DISABLE TRIGGER
AllTriggers bool // For ENABLE/DISABLE TRIGGER ALL
AllConstraints bool // For CHECK/NOCHECK CONSTRAINT ALL
Options map[string]string // For SET (option = value)
RawOptions string // For SWITCH, REBUILD, etc.
}
AlterTableAction represents an action in ALTER TABLE.
func (*AlterTableAction) String ¶
func (aa *AlterTableAction) String() string
type AlterTableStatement ¶
type AlterTableStatement struct {
Token token.Token
Table *QualifiedIdentifier
Actions []*AlterTableAction
WithCheck bool // WITH CHECK modifier
WithNoCheck bool // WITH NOCHECK modifier
}
AlterTableStatement represents an ALTER TABLE statement.
func (*AlterTableStatement) String ¶
func (at *AlterTableStatement) String() string
func (*AlterTableStatement) TokenLiteral ¶
func (at *AlterTableStatement) TokenLiteral() string
type AlterTriggerStatement ¶
type AlterTriggerStatement struct {
Token token.Token
Name *QualifiedIdentifier
Table *QualifiedIdentifier
Timing TriggerTiming
Events []string
Body *BeginEndBlock
}
AlterTriggerStatement represents an ALTER TRIGGER statement.
func (*AlterTriggerStatement) String ¶
func (at *AlterTriggerStatement) String() string
func (*AlterTriggerStatement) TokenLiteral ¶
func (at *AlterTriggerStatement) TokenLiteral() string
type AlterUserStatement ¶
type AlterUserStatement struct {
Token token.Token
Name string
NewName string // WITH NAME = xxx
DefaultSchema string // WITH DEFAULT_SCHEMA = xxx
Login string // WITH LOGIN = xxx
}
AlterUserStatement represents ALTER USER statement.
func (*AlterUserStatement) String ¶
func (aus *AlterUserStatement) String() string
func (*AlterUserStatement) TokenLiteral ¶
func (aus *AlterUserStatement) TokenLiteral() string
type AlterViewStatement ¶
type AlterViewStatement struct {
Token token.Token
Name *QualifiedIdentifier
Columns []*Identifier
Options []string
AsSelect Statement // Can be SelectStatement or WithStatement (CTE)
}
AlterViewStatement represents an ALTER VIEW statement.
func (*AlterViewStatement) String ¶
func (av *AlterViewStatement) String() string
func (*AlterViewStatement) TokenLiteral ¶
func (av *AlterViewStatement) TokenLiteral() string
type AlterWorkloadGroupStatement ¶
type AlterWorkloadGroupStatement struct {
Token token.Token
Name string
Options map[string]string
PoolName string
}
AlterWorkloadGroupStatement represents ALTER WORKLOAD GROUP.
func (*AlterWorkloadGroupStatement) String ¶
func (awg *AlterWorkloadGroupStatement) String() string
func (*AlterWorkloadGroupStatement) TokenLiteral ¶
func (awg *AlterWorkloadGroupStatement) TokenLiteral() string
type AtTimeZoneExpression ¶
type AtTimeZoneExpression struct {
Token token.Token
Expr Expression
TimeZone Expression // String literal or expression for timezone
}
AtTimeZoneExpression represents expr AT TIME ZONE timezone
func (*AtTimeZoneExpression) String ¶
func (atz *AtTimeZoneExpression) String() string
func (*AtTimeZoneExpression) TokenLiteral ¶
func (atz *AtTimeZoneExpression) TokenLiteral() string
type AvailabilityReplica ¶
type AvailabilityReplica struct {
ServerName string
EndpointURL string
AvailabilityMode string // SYNCHRONOUS_COMMIT or ASYNCHRONOUS_COMMIT
FailoverMode string // AUTOMATIC or MANUAL
Options map[string]string
}
AvailabilityReplica represents a replica definition in an availability group.
func (*AvailabilityReplica) String ¶
func (ar *AvailabilityReplica) String() string
type BackupLocation ¶
BackupLocation represents a backup destination.
type BackupOption ¶
type BackupOption struct {
Name string // COMPRESSION, INIT, COPY_ONLY, etc.
Value string // Optional value
}
BackupOption represents a WITH option for BACKUP.
type BackupStatement ¶
type BackupStatement struct {
Token token.Token
BackupType string // DATABASE, LOG, CERTIFICATE
DatabaseName string // Database or certificate name
ToLocations []*BackupLocation // TO DISK/URL = 'path', ...
WithOptions []*BackupOption // WITH option = value, ...
}
BackupStatement represents BACKUP DATABASE/LOG statement.
func (*BackupStatement) String ¶
func (bs *BackupStatement) String() string
func (*BackupStatement) TokenLiteral ¶
func (bs *BackupStatement) TokenLiteral() string
type BeginDialogStatement ¶
type BeginDialogStatement struct {
Token token.Token
DialogHandle string // Variable to receive handle
FromService string
ToService string
OnContract string
WithOptions map[string]string // ENCRYPTION, LIFETIME, RELATED_CONVERSATION, etc.
}
BeginDialogStatement represents BEGIN DIALOG CONVERSATION.
func (*BeginDialogStatement) String ¶
func (bd *BeginDialogStatement) String() string
func (*BeginDialogStatement) TokenLiteral ¶
func (bd *BeginDialogStatement) TokenLiteral() string
type BeginEndBlock ¶
BeginEndBlock represents a BEGIN...END block.
func (*BeginEndBlock) String ¶
func (be *BeginEndBlock) String() string
func (*BeginEndBlock) TokenLiteral ¶
func (be *BeginEndBlock) TokenLiteral() string
type BeginTransactionStatement ¶
type BeginTransactionStatement struct {
Token token.Token
Name *Identifier
Mark string // WITH MARK 'description'
}
BeginTransactionStatement represents BEGIN TRANSACTION.
func (*BeginTransactionStatement) String ¶
func (bt *BeginTransactionStatement) String() string
func (*BeginTransactionStatement) TokenLiteral ¶
func (bt *BeginTransactionStatement) TokenLiteral() string
type BetweenExpression ¶
type BetweenExpression struct {
Token token.Token
Expr Expression
Not bool
Low Expression
High Expression
}
BetweenExpression represents a BETWEEN expression.
func (*BetweenExpression) String ¶
func (be *BetweenExpression) String() string
func (*BetweenExpression) TokenLiteral ¶
func (be *BetweenExpression) TokenLiteral() string
type BinaryLiteral ¶
BinaryLiteral represents a binary literal (0x...).
func (*BinaryLiteral) String ¶
func (bl *BinaryLiteral) String() string
func (*BinaryLiteral) TokenLiteral ¶
func (bl *BinaryLiteral) TokenLiteral() string
type BreakStatement ¶
BreakStatement represents a BREAK statement.
func (*BreakStatement) String ¶
func (bs *BreakStatement) String() string
func (*BreakStatement) TokenLiteral ¶
func (bs *BreakStatement) TokenLiteral() string
type BulkInsertStatement ¶
type BulkInsertStatement struct {
Token token.Token
Table *QualifiedIdentifier
DataFile string
Options map[string]string
}
BulkInsertStatement represents a BULK INSERT statement.
func (*BulkInsertStatement) String ¶
func (bi *BulkInsertStatement) String() string
func (*BulkInsertStatement) TokenLiteral ¶
func (bi *BulkInsertStatement) TokenLiteral() string
type CTEDef ¶
type CTEDef struct {
Name *Identifier
Columns []*Identifier
Query *SelectStatement
}
type CaseExpression ¶
type CaseExpression struct {
Token token.Token
Operand Expression // Optional: CASE operand WHEN ...
WhenClauses []*WhenClause
ElseClause Expression
}
CaseExpression represents a CASE expression.
func (*CaseExpression) String ¶
func (ce *CaseExpression) String() string
func (*CaseExpression) TokenLiteral ¶
func (ce *CaseExpression) TokenLiteral() string
type CastExpression ¶
type CastExpression struct {
Token token.Token
Expression Expression
TargetType *DataType
IsTry bool // true for TRY_CAST
}
CastExpression represents CAST(expr AS type) or TRY_CAST(expr AS type)
func (*CastExpression) String ¶
func (ce *CastExpression) String() string
func (*CastExpression) TokenLiteral ¶
func (ce *CastExpression) TokenLiteral() string
type CloseCursorStatement ¶
type CloseCursorStatement struct {
Token token.Token
CursorName *Identifier
}
CloseCursorStatement represents CLOSE cursor_name.
func (*CloseCursorStatement) String ¶
func (cc *CloseCursorStatement) String() string
func (*CloseCursorStatement) TokenLiteral ¶
func (cc *CloseCursorStatement) TokenLiteral() string
type CloseSymmetricKeyStatement ¶
type CloseSymmetricKeyStatement struct {
Token token.Token
KeyName string // empty if CLOSE ALL SYMMETRIC KEYS
All bool // CLOSE ALL SYMMETRIC KEYS
}
CloseSymmetricKeyStatement represents CLOSE SYMMETRIC KEY statement.
func (*CloseSymmetricKeyStatement) String ¶
func (csk *CloseSymmetricKeyStatement) String() string
func (*CloseSymmetricKeyStatement) TokenLiteral ¶
func (csk *CloseSymmetricKeyStatement) TokenLiteral() string
type CollateExpression ¶
type CollateExpression struct {
Token token.Token
Expr Expression
Collation string
}
CollateExpression represents expr COLLATE collation_name
func (*CollateExpression) String ¶
func (ce *CollateExpression) String() string
func (*CollateExpression) TokenLiteral ¶
func (ce *CollateExpression) TokenLiteral() string
type ColumnConstraint ¶
type ColumnConstraint struct {
Name string // Optional constraint name
Type ConstraintType
IsPrimaryKey bool
IsClustered *bool // nil = not specified
ReferencesTable *QualifiedIdentifier
ReferencesColumns []*Identifier
CheckExpression Expression
OnDelete string // CASCADE, SET NULL, SET DEFAULT, NO ACTION
OnUpdate string
}
ColumnConstraint represents an inline constraint on a column.
func (*ColumnConstraint) String ¶
func (cc *ColumnConstraint) String() string
type ColumnDefinition ¶
type ColumnDefinition struct {
Token token.Token
Name *Identifier
DataType *DataType
Nullable *bool // nil = not specified, true = NULL, false = NOT NULL
Default Expression
Identity *IdentitySpec
IsRowGuidCol bool // ROWGUIDCOL
IsSparse bool // SPARSE
IsColumnSet bool // COLUMN_SET FOR ALL_SPARSE_COLUMNS
Collation string
Computed Expression // For computed columns: AS (expression)
IsPersisted bool // PERSISTED for computed columns
Constraints []*ColumnConstraint // Inline constraints
GeneratedAlways string // "ROW START" or "ROW END" for temporal tables
InlineIndex *InlineIndex // INDEX index_name [CLUSTERED|NONCLUSTERED]
}
ColumnDefinition represents a column definition in CREATE TABLE or table variable.
func (*ColumnDefinition) String ¶
func (cd *ColumnDefinition) String() string
type CommitTransactionStatement ¶
type CommitTransactionStatement struct {
Token token.Token
Name *Identifier
}
CommitTransactionStatement represents COMMIT TRANSACTION.
func (*CommitTransactionStatement) String ¶
func (ct *CommitTransactionStatement) String() string
func (*CommitTransactionStatement) TokenLiteral ¶
func (ct *CommitTransactionStatement) TokenLiteral() string
type ConstraintType ¶
type ConstraintType int
const ( ConstraintPrimaryKey ConstraintType = iota ConstraintForeignKey ConstraintUnique ConstraintCheck ConstraintDefault ConstraintPeriod // PERIOD FOR SYSTEM_TIME ConstraintIndex // INDEX ix_name (columns) )
type ContainsExpression ¶
type ContainsExpression struct {
Token token.Token
Columns []string // Column(s) to search, or * for all
SearchTerm Expression // Search condition
Language string // Optional LANGUAGE value
}
ContainsExpression represents the CONTAINS predicate.
func (*ContainsExpression) String ¶
func (ce *ContainsExpression) String() string
func (*ContainsExpression) TokenLiteral ¶
func (ce *ContainsExpression) TokenLiteral() string
type ContainsTableExpression ¶
type ContainsTableExpression struct {
Token token.Token
TableName string
Columns []string // Column(s) to search, or * for all
SearchTerm Expression // Search condition
TopN Expression // Optional TOP n_hits
Language string // Optional LANGUAGE value
}
ContainsTableExpression represents CONTAINSTABLE function.
func (*ContainsTableExpression) String ¶
func (ct *ContainsTableExpression) String() string
func (*ContainsTableExpression) TokenLiteral ¶
func (ct *ContainsTableExpression) TokenLiteral() string
type ContinueStatement ¶
ContinueStatement represents a CONTINUE statement.
func (*ContinueStatement) String ¶
func (cs *ContinueStatement) String() string
func (*ContinueStatement) TokenLiteral ¶
func (cs *ContinueStatement) TokenLiteral() string
type ContractMessage ¶
ContractMessage represents a message type in a contract.
func (*ContractMessage) String ¶
func (cm *ContractMessage) String() string
type ConvertExpression ¶
type ConvertExpression struct {
Token token.Token
TargetType *DataType
Expression Expression
Style Expression // optional style parameter
IsTry bool // true for TRY_CONVERT
}
ConvertExpression represents CONVERT(type, expr [, style]) or TRY_CONVERT(type, expr [, style])
func (*ConvertExpression) String ¶
func (ce *ConvertExpression) String() string
func (*ConvertExpression) TokenLiteral ¶
func (ce *ConvertExpression) TokenLiteral() string
type CreateApplicationRoleStatement ¶
type CreateApplicationRoleStatement struct {
Token token.Token
Name string
Password string
Schema string
}
CreateApplicationRoleStatement represents CREATE APPLICATION ROLE
func (*CreateApplicationRoleStatement) String ¶
func (c *CreateApplicationRoleStatement) String() string
func (*CreateApplicationRoleStatement) TokenLiteral ¶
func (c *CreateApplicationRoleStatement) TokenLiteral() string
type CreateAssemblyStatement ¶
type CreateAssemblyStatement struct {
Token token.Token
Name string
FromPath string // FROM 'path'
FromBinary string // FROM 0x... (hex binary)
PermissionSet string // WITH PERMISSION_SET = SAFE|EXTERNAL_ACCESS|UNSAFE
}
CreateAssemblyStatement represents CREATE ASSEMBLY statement.
func (*CreateAssemblyStatement) String ¶
func (ca *CreateAssemblyStatement) String() string
func (*CreateAssemblyStatement) TokenLiteral ¶
func (ca *CreateAssemblyStatement) TokenLiteral() string
type CreateAsymmetricKeyStatement ¶
type CreateAsymmetricKeyStatement struct {
Token token.Token
Name string
FromFile string // FROM FILE = 'path'
FromAssembly string // FROM ASSEMBLY name
Algorithm string // WITH ALGORITHM = RSA_2048, etc.
EncryptByPwd string // ENCRYPTION BY PASSWORD = 'xxx'
}
CreateAsymmetricKeyStatement represents CREATE ASYMMETRIC KEY statement.
func (*CreateAsymmetricKeyStatement) String ¶
func (cak *CreateAsymmetricKeyStatement) String() string
func (*CreateAsymmetricKeyStatement) TokenLiteral ¶
func (cak *CreateAsymmetricKeyStatement) TokenLiteral() string
type CreateAvailabilityGroupStatement ¶
type CreateAvailabilityGroupStatement struct {
Token token.Token
Name string
Databases []string // FOR DATABASE db1, db2
Replicas []*AvailabilityReplica
}
CreateAvailabilityGroupStatement represents CREATE AVAILABILITY GROUP.
func (*CreateAvailabilityGroupStatement) String ¶
func (cag *CreateAvailabilityGroupStatement) String() string
func (*CreateAvailabilityGroupStatement) TokenLiteral ¶
func (cag *CreateAvailabilityGroupStatement) TokenLiteral() string
type CreateCertificateStatement ¶
type CreateCertificateStatement struct {
Token token.Token
Name string
Subject string // WITH SUBJECT = 'xxx'
FromFile string // FROM FILE = 'path' (optional)
EncryptByPwd string // ENCRYPTION BY PASSWORD = 'xxx' (optional)
DecryptByPwd string // DECRYPTION BY PASSWORD = 'xxx' (optional)
}
CreateCertificateStatement represents CREATE CERTIFICATE statement.
func (*CreateCertificateStatement) String ¶
func (cc *CreateCertificateStatement) String() string
func (*CreateCertificateStatement) TokenLiteral ¶
func (cc *CreateCertificateStatement) TokenLiteral() string
type CreateContractStatement ¶
type CreateContractStatement struct {
Token token.Token
Name string
Authorization string
Messages []*ContractMessage // Message types with SENT BY
}
CreateContractStatement represents CREATE CONTRACT.
func (*CreateContractStatement) String ¶
func (cc *CreateContractStatement) String() string
func (*CreateContractStatement) TokenLiteral ¶
func (cc *CreateContractStatement) TokenLiteral() string
type CreateCredentialStatement ¶
type CreateCredentialStatement struct {
Token token.Token
Name string
Identity string
Secret string
}
CreateCredentialStatement represents CREATE CREDENTIAL
func (*CreateCredentialStatement) String ¶
func (c *CreateCredentialStatement) String() string
func (*CreateCredentialStatement) TokenLiteral ¶
func (c *CreateCredentialStatement) TokenLiteral() string
type CreateDatabaseScopedCredentialStatement ¶
type CreateDatabaseScopedCredentialStatement struct {
Token token.Token
Name string
Identity string
Secret string
}
CreateDatabaseScopedCredentialStatement represents CREATE DATABASE SCOPED CREDENTIAL
func (*CreateDatabaseScopedCredentialStatement) String ¶
func (c *CreateDatabaseScopedCredentialStatement) String() string
func (*CreateDatabaseScopedCredentialStatement) TokenLiteral ¶
func (c *CreateDatabaseScopedCredentialStatement) TokenLiteral() string
type CreateDefaultStatement ¶
type CreateDefaultStatement struct {
Token token.Token
Name *QualifiedIdentifier
Value Expression
}
CreateDefaultStatement represents CREATE DEFAULT (deprecated T-SQL syntax)
func (*CreateDefaultStatement) String ¶
func (cd *CreateDefaultStatement) String() string
func (*CreateDefaultStatement) TokenLiteral ¶
func (cd *CreateDefaultStatement) TokenLiteral() string
type CreateFulltextCatalogStatement ¶
type CreateFulltextCatalogStatement struct {
Token token.Token
Name string
OnFilegroup string // ON FILEGROUP filegroup
InPath string // IN PATH 'rootpath'
AsDefault bool // AS DEFAULT
Authorization string // AUTHORIZATION owner
AccentOn *bool // ACCENT_SENSITIVITY = ON/OFF
}
CreateFulltextCatalogStatement represents CREATE FULLTEXT CATALOG.
func (*CreateFulltextCatalogStatement) String ¶
func (cfc *CreateFulltextCatalogStatement) String() string
func (*CreateFulltextCatalogStatement) TokenLiteral ¶
func (cfc *CreateFulltextCatalogStatement) TokenLiteral() string
type CreateFulltextIndexStatement ¶
type CreateFulltextIndexStatement struct {
Token token.Token
TableName *QualifiedIdentifier
Columns []*FulltextColumn // Column definitions
KeyIndex string // KEY INDEX index_name
OnCatalog string // ON catalog_name
WithOptions []string // WITH options
}
CreateFulltextIndexStatement represents CREATE FULLTEXT INDEX ON table.
func (*CreateFulltextIndexStatement) String ¶
func (cfi *CreateFulltextIndexStatement) String() string
func (*CreateFulltextIndexStatement) TokenLiteral ¶
func (cfi *CreateFulltextIndexStatement) TokenLiteral() string
type CreateFunctionStatement ¶
type CreateFunctionStatement struct {
Token token.Token
Name *QualifiedIdentifier
Parameters []*ParameterDef
ReturnType *DataType // For scalar functions
ReturnsTable bool // For inline TVF: RETURNS TABLE
TableDef *TableTypeDefinition // For multi-statement TVF: RETURNS @var TABLE (...)
TableVar string // Variable name for multi-statement TVF
Options []string // WITH SCHEMABINDING, etc.
AsReturn Expression // For inline TVF: AS RETURN (SELECT...)
Body *BeginEndBlock // For scalar and multi-statement
}
CreateFunctionStatement represents a CREATE FUNCTION statement.
func (*CreateFunctionStatement) String ¶
func (cf *CreateFunctionStatement) String() string
func (*CreateFunctionStatement) TokenLiteral ¶
func (cf *CreateFunctionStatement) TokenLiteral() string
type CreateIndexStatement ¶
type CreateIndexStatement struct {
Token token.Token
IsUnique bool
IsClustered *bool // nil = not specified, true = CLUSTERED, false = NONCLUSTERED
Name *Identifier
Table *QualifiedIdentifier
Columns []*IndexColumn
IncludeColumns []*Identifier
Where Expression
Options []string // WITH (options)
Filegroup *Identifier // ON [filegroup]
}
CreateIndexStatement represents a CREATE INDEX statement.
func (*CreateIndexStatement) String ¶
func (ci *CreateIndexStatement) String() string
func (*CreateIndexStatement) TokenLiteral ¶
func (ci *CreateIndexStatement) TokenLiteral() string
type CreateLoginStatement ¶
type CreateLoginStatement struct {
Token token.Token
Name string
FromWindows bool // FROM WINDOWS
Password string // WITH PASSWORD = 'xxx'
DefaultDB string // WITH DEFAULT_DATABASE = xxx
DefaultLang string // WITH DEFAULT_LANGUAGE = xxx
CheckPolicy *bool // WITH CHECK_POLICY = ON/OFF
CheckExpiry *bool // WITH CHECK_EXPIRATION = ON/OFF
}
CreateLoginStatement represents CREATE LOGIN statement.
func (*CreateLoginStatement) String ¶
func (cls *CreateLoginStatement) String() string
func (*CreateLoginStatement) TokenLiteral ¶
func (cls *CreateLoginStatement) TokenLiteral() string
type CreateMasterKeyStatement ¶
type CreateMasterKeyStatement struct {
Token token.Token
Password string // ENCRYPTION BY PASSWORD = 'xxx'
}
CreateMasterKeyStatement represents CREATE MASTER KEY statement.
func (*CreateMasterKeyStatement) String ¶
func (cmk *CreateMasterKeyStatement) String() string
func (*CreateMasterKeyStatement) TokenLiteral ¶
func (cmk *CreateMasterKeyStatement) TokenLiteral() string
type CreateMessageTypeStatement ¶
type CreateMessageTypeStatement struct {
Token token.Token
Name string
Validation string // NONE, EMPTY, WELL_FORMED_XML, VALID_XML WITH SCHEMA COLLECTION
Authorization string
}
CreateMessageTypeStatement represents CREATE MESSAGE TYPE.
func (*CreateMessageTypeStatement) String ¶
func (cmt *CreateMessageTypeStatement) String() string
func (*CreateMessageTypeStatement) TokenLiteral ¶
func (cmt *CreateMessageTypeStatement) TokenLiteral() string
type CreatePartitionFunctionStatement ¶
type CreatePartitionFunctionStatement struct {
Token token.Token
Name string
InputType *DataType // Parameter type
RangeType string // LEFT or RIGHT
BoundaryValues []Expression // Values list
}
CreatePartitionFunctionStatement represents CREATE PARTITION FUNCTION statement.
func (*CreatePartitionFunctionStatement) String ¶
func (cpf *CreatePartitionFunctionStatement) String() string
func (*CreatePartitionFunctionStatement) TokenLiteral ¶
func (cpf *CreatePartitionFunctionStatement) TokenLiteral() string
type CreatePartitionSchemeStatement ¶
type CreatePartitionSchemeStatement struct {
Token token.Token
Name string
FunctionName string // AS PARTITION function_name
AllTo string // ALL TO ([filegroup]) - single filegroup for all
FileGroups []string // Individual filegroups if not ALL TO
}
CreatePartitionSchemeStatement represents CREATE PARTITION SCHEME statement.
func (*CreatePartitionSchemeStatement) String ¶
func (cps *CreatePartitionSchemeStatement) String() string
func (*CreatePartitionSchemeStatement) TokenLiteral ¶
func (cps *CreatePartitionSchemeStatement) TokenLiteral() string
type CreateProcedureStatement ¶
type CreateProcedureStatement struct {
Token token.Token
Name *QualifiedIdentifier
Parameters []*ParameterDef
Body *BeginEndBlock
Options []string
}
CreateProcedureStatement represents a CREATE PROCEDURE statement.
func (*CreateProcedureStatement) String ¶
func (cp *CreateProcedureStatement) String() string
func (*CreateProcedureStatement) TokenLiteral ¶
func (cp *CreateProcedureStatement) TokenLiteral() string
type CreateQueueStatement ¶
type CreateQueueStatement struct {
Token token.Token
Name *QualifiedIdentifier
Options map[string]string // WITH options: STATUS, RETENTION, ACTIVATION, POISON_MESSAGE_HANDLING
OnFilegroup string
}
CreateQueueStatement represents CREATE QUEUE.
func (*CreateQueueStatement) String ¶
func (cq *CreateQueueStatement) String() string
func (*CreateQueueStatement) TokenLiteral ¶
func (cq *CreateQueueStatement) TokenLiteral() string
type CreateResourcePoolStatement ¶
type CreateResourcePoolStatement struct {
Token token.Token
Name string
Options map[string]string // WITH options like MAX_CPU_PERCENT, MAX_MEMORY_PERCENT
}
CreateResourcePoolStatement represents CREATE RESOURCE POOL.
func (*CreateResourcePoolStatement) String ¶
func (crp *CreateResourcePoolStatement) String() string
func (*CreateResourcePoolStatement) TokenLiteral ¶
func (crp *CreateResourcePoolStatement) TokenLiteral() string
type CreateRoleStatement ¶
type CreateRoleStatement struct {
Token token.Token
Name string
Authorization string // AUTHORIZATION owner_name
}
CreateRoleStatement represents CREATE ROLE statement.
func (*CreateRoleStatement) String ¶
func (crs *CreateRoleStatement) String() string
func (*CreateRoleStatement) TokenLiteral ¶
func (crs *CreateRoleStatement) TokenLiteral() string
type CreateRuleStatement ¶
type CreateRuleStatement struct {
Token token.Token
Name *QualifiedIdentifier
Condition Expression
}
CreateRuleStatement represents CREATE RULE name AS condition
func (*CreateRuleStatement) String ¶
func (cr *CreateRuleStatement) String() string
func (*CreateRuleStatement) TokenLiteral ¶
func (cr *CreateRuleStatement) TokenLiteral() string
type CreateSchemaStatement ¶
type CreateSchemaStatement struct {
Token token.Token
Name string
Authorization string // AUTHORIZATION owner_name
}
CreateSchemaStatement represents CREATE SCHEMA statement.
func (*CreateSchemaStatement) String ¶
func (css *CreateSchemaStatement) String() string
func (*CreateSchemaStatement) TokenLiteral ¶
func (css *CreateSchemaStatement) TokenLiteral() string
type CreateSequenceStatement ¶
type CreateSequenceStatement struct {
Token token.Token
Name *QualifiedIdentifier
DataType *DataType // Optional: AS datatype
StartWith Expression // START WITH n
IncrementBy Expression // INCREMENT BY n
MinValue Expression // MINVALUE n or NO MINVALUE
MaxValue Expression // MAXVALUE n or NO MAXVALUE
NoMinValue bool
NoMaxValue bool
Cycle bool // CYCLE or NO CYCLE
NoCycle bool
Cache Expression // CACHE n or NO CACHE
NoCache bool
}
CreateSequenceStatement represents CREATE SEQUENCE.
func (*CreateSequenceStatement) String ¶
func (cs *CreateSequenceStatement) String() string
func (*CreateSequenceStatement) TokenLiteral ¶
func (cs *CreateSequenceStatement) TokenLiteral() string
type CreateServerRoleStatement ¶
CreateServerRoleStatement represents CREATE SERVER ROLE
func (*CreateServerRoleStatement) String ¶
func (c *CreateServerRoleStatement) String() string
func (*CreateServerRoleStatement) TokenLiteral ¶
func (c *CreateServerRoleStatement) TokenLiteral() string
type CreateServiceStatement ¶
type CreateServiceStatement struct {
Token token.Token
Name string
OnQueue string
Contracts []string
Authorization string
}
CreateServiceStatement represents CREATE SERVICE.
func (*CreateServiceStatement) String ¶
func (cs *CreateServiceStatement) String() string
func (*CreateServiceStatement) TokenLiteral ¶
func (cs *CreateServiceStatement) TokenLiteral() string
type CreateStatisticsStatement ¶
type CreateStatisticsStatement struct {
Token token.Token
Name string
Table *QualifiedIdentifier
Columns []*Identifier
WithOptions []string // FULLSCAN, SAMPLE n PERCENT, NORECOMPUTE, etc.
}
CreateStatisticsStatement represents CREATE STATISTICS.
func (*CreateStatisticsStatement) String ¶
func (cs *CreateStatisticsStatement) String() string
func (*CreateStatisticsStatement) TokenLiteral ¶
func (cs *CreateStatisticsStatement) TokenLiteral() string
type CreateSymmetricKeyStatement ¶
type CreateSymmetricKeyStatement struct {
Token token.Token
Name string
Algorithm string // WITH ALGORITHM = AES_256, etc.
EncryptByCert string // ENCRYPTION BY CERTIFICATE name
EncryptByKey string // ENCRYPTION BY SYMMETRIC KEY name
EncryptByPwd string // ENCRYPTION BY PASSWORD = 'xxx'
}
CreateSymmetricKeyStatement represents CREATE SYMMETRIC KEY statement.
func (*CreateSymmetricKeyStatement) String ¶
func (csk *CreateSymmetricKeyStatement) String() string
func (*CreateSymmetricKeyStatement) TokenLiteral ¶
func (csk *CreateSymmetricKeyStatement) TokenLiteral() string
type CreateSynonymStatement ¶
type CreateSynonymStatement struct {
Token token.Token
Name *QualifiedIdentifier
Target *QualifiedIdentifier
}
CreateSynonymStatement represents CREATE SYNONYM name FOR target.
func (*CreateSynonymStatement) String ¶
func (cs *CreateSynonymStatement) String() string
func (*CreateSynonymStatement) TokenLiteral ¶
func (cs *CreateSynonymStatement) TokenLiteral() string
type CreateTableStatement ¶
type CreateTableStatement struct {
Token token.Token
Name *QualifiedIdentifier
IsTemporary bool // #temp or ##global
Columns []*ColumnDefinition
Constraints []*TableConstraint
AsSelect *SelectStatement // CREATE TABLE ... AS SELECT
FileGroup string // ON [filegroup]
TextImageOn string // TEXTIMAGE_ON [filegroup]
}
CreateTableStatement represents a CREATE TABLE statement.
func (*CreateTableStatement) String ¶
func (ct *CreateTableStatement) String() string
func (*CreateTableStatement) TokenLiteral ¶
func (ct *CreateTableStatement) TokenLiteral() string
type CreateTriggerStatement ¶
type CreateTriggerStatement struct {
Token token.Token
Name *QualifiedIdentifier
Table *QualifiedIdentifier
OnDatabase bool // ON DATABASE
OnAllServer bool // ON ALL SERVER
Timing TriggerTiming // AFTER, INSTEAD OF, FOR
Events []string // INSERT, UPDATE, DELETE or DDL event types
NotForReplication bool // NOT FOR REPLICATION
Body *BeginEndBlock
Options []string
}
CreateTriggerStatement represents a CREATE TRIGGER statement.
func (*CreateTriggerStatement) String ¶
func (ct *CreateTriggerStatement) String() string
func (*CreateTriggerStatement) TokenLiteral ¶
func (ct *CreateTriggerStatement) TokenLiteral() string
type CreateTypeStatement ¶
type CreateTypeStatement struct {
Token token.Token
Name *QualifiedIdentifier
IsTableType bool // true for AS TABLE
BaseType *DataType // For alias types: FROM base_type
Nullable *bool // For alias types: NULL/NOT NULL
TableDef *TableTypeDefinition // For table types: AS TABLE (...)
}
CreateTypeStatement represents a CREATE TYPE statement. Can be either an alias type (FROM base_type) or a table type (AS TABLE).
func (*CreateTypeStatement) String ¶
func (ct *CreateTypeStatement) String() string
func (*CreateTypeStatement) TokenLiteral ¶
func (ct *CreateTypeStatement) TokenLiteral() string
type CreateUserStatement ¶
type CreateUserStatement struct {
Token token.Token
Name string
ForLogin string // FOR LOGIN xxx
WithoutLogin bool // WITHOUT LOGIN
DefaultSchema string // WITH DEFAULT_SCHEMA = xxx
}
CreateUserStatement represents CREATE USER statement.
func (*CreateUserStatement) String ¶
func (cus *CreateUserStatement) String() string
func (*CreateUserStatement) TokenLiteral ¶
func (cus *CreateUserStatement) TokenLiteral() string
type CreateViewStatement ¶
type CreateViewStatement struct {
Token token.Token
Name *QualifiedIdentifier
Columns []*Identifier // Optional column list
Options []string // WITH SCHEMABINDING, etc.
AsSelect Statement // Can be SelectStatement or WithStatement (CTE)
CheckOption bool // WITH CHECK OPTION
}
CreateViewStatement represents a CREATE VIEW statement.
func (*CreateViewStatement) String ¶
func (cv *CreateViewStatement) String() string
func (*CreateViewStatement) TokenLiteral ¶
func (cv *CreateViewStatement) TokenLiteral() string
type CreateWorkloadGroupStatement ¶
type CreateWorkloadGroupStatement struct {
Token token.Token
Name string
Options map[string]string // WITH options
PoolName string // USING pool_name
ExternalPoolName string // EXTERNAL external_pool_name
}
CreateWorkloadGroupStatement represents CREATE WORKLOAD GROUP.
func (*CreateWorkloadGroupStatement) String ¶
func (cwg *CreateWorkloadGroupStatement) String() string
func (*CreateWorkloadGroupStatement) TokenLiteral ¶
func (cwg *CreateWorkloadGroupStatement) TokenLiteral() string
type CreateXmlIndexStatement ¶
type CreateXmlIndexStatement struct {
Token token.Token
IsPrimary bool
Name *Identifier
Table *QualifiedIdentifier
Column *Identifier
}
CreateXmlIndexStatement represents a CREATE PRIMARY/SECONDARY XML INDEX statement.
func (*CreateXmlIndexStatement) String ¶
func (xi *CreateXmlIndexStatement) String() string
func (*CreateXmlIndexStatement) TokenLiteral ¶
func (xi *CreateXmlIndexStatement) TokenLiteral() string
type CreateXmlSchemaCollectionStatement ¶
type CreateXmlSchemaCollectionStatement struct {
Token token.Token
Name *QualifiedIdentifier
SchemaData string // The XML schema content
}
CreateXmlSchemaCollectionStatement represents CREATE XML SCHEMA COLLECTION name AS N'...'
func (*CreateXmlSchemaCollectionStatement) String ¶
func (cs *CreateXmlSchemaCollectionStatement) String() string
func (*CreateXmlSchemaCollectionStatement) TokenLiteral ¶
func (cs *CreateXmlSchemaCollectionStatement) TokenLiteral() string
type CubeExpression ¶
type CubeExpression struct {
Token token.Token
Columns []Expression
}
CubeExpression represents a CUBE expression in GROUP BY
func (*CubeExpression) String ¶
func (ce *CubeExpression) String() string
func (*CubeExpression) TokenLiteral ¶
func (ce *CubeExpression) TokenLiteral() string
type CursorExpression ¶
type CursorExpression struct {
Token token.Token
Options *CursorOptions
ForSelect *SelectStatement
}
CursorExpression represents CURSOR [options] FOR select_statement
func (*CursorExpression) String ¶
func (ce *CursorExpression) String() string
func (*CursorExpression) TokenLiteral ¶
func (ce *CursorExpression) TokenLiteral() string
type CursorOptions ¶
type CursorOptions struct {
Local bool // LOCAL vs GLOBAL
Global bool
ForwardOnly bool // FORWARD_ONLY vs SCROLL
Scroll bool
Static bool // STATIC, KEYSET, DYNAMIC, FAST_FORWARD
Keyset bool
Dynamic bool
FastForward bool
ReadOnly bool // READ_ONLY, SCROLL_LOCKS, OPTIMISTIC
ScrollLocks bool
Optimistic bool
TypeWarning bool // TYPE_WARNING
}
CursorOptions represents cursor declaration options.
func (*CursorOptions) String ¶
func (co *CursorOptions) String() string
type DataType ¶
type DataType struct {
Name string
Length *int
Precision *int
Scale *int
Max bool
XmlSchema string // For typed XML: XML(schema_name)
}
DataType represents a T-SQL data type.
type DbccStatement ¶
type DbccStatement struct {
Token token.Token
Command string // CHECKDB, SHRINKFILE, FREEPROCCACHE, etc.
Arguments []Expression // Arguments in parentheses
WithOptions []string // WITH options
}
DbccStatement represents DBCC commands.
func (*DbccStatement) String ¶
func (ds *DbccStatement) String() string
func (*DbccStatement) TokenLiteral ¶
func (ds *DbccStatement) TokenLiteral() string
type DeallocateCursorStatement ¶
type DeallocateCursorStatement struct {
Token token.Token
CursorName *Identifier
}
DeallocateCursorStatement represents DEALLOCATE cursor_name.
func (*DeallocateCursorStatement) String ¶
func (dc *DeallocateCursorStatement) String() string
func (*DeallocateCursorStatement) TokenLiteral ¶
func (dc *DeallocateCursorStatement) TokenLiteral() string
type DeclareCursorStatement ¶
type DeclareCursorStatement struct {
Token token.Token
Name *Identifier
Options *CursorOptions
ForSelect *SelectStatement
ForUpdateColumns []string // FOR UPDATE OF col1, col2
}
DeclareCursorStatement represents DECLARE cursor_name CURSOR ... FOR SELECT.
func (*DeclareCursorStatement) String ¶
func (dc *DeclareCursorStatement) String() string
func (*DeclareCursorStatement) TokenLiteral ¶
func (dc *DeclareCursorStatement) TokenLiteral() string
type DeclareStatement ¶
type DeclareStatement struct {
Token token.Token
Variables []*VariableDef
}
DeclareStatement represents a DECLARE statement.
func (*DeclareStatement) String ¶
func (ds *DeclareStatement) String() string
func (*DeclareStatement) TokenLiteral ¶
func (ds *DeclareStatement) TokenLiteral() string
type DeleteStatement ¶
type DeleteStatement struct {
Token token.Token
Top *TopClause
Table *QualifiedIdentifier
TargetFunc *FunctionCall // For DELETE FROM OPENQUERY(...), DELETE FROM OPENROWSET(...)
Hints []string // Table hints: WITH (TABLOCK), etc.
Alias *Identifier
From *FromClause
Where Expression
CurrentOfCursor *Identifier // WHERE CURRENT OF cursor_name
Output *OutputClause
}
DeleteStatement represents a DELETE statement.
func (*DeleteStatement) String ¶
func (ds *DeleteStatement) String() string
func (*DeleteStatement) TokenLiteral ¶
func (ds *DeleteStatement) TokenLiteral() string
type DenyStatement ¶
type DenyStatement struct {
Token token.Token
Permissions []string // SELECT, INSERT, UPDATE, DELETE, EXECUTE, etc.
OnType string // OBJECT, SCHEMA, DATABASE, or empty
OnObject *QualifiedIdentifier
Columns []string // Column-level permissions (col1, col2, ...)
ToPrincipals []string // Users, roles, logins
Cascade bool // CASCADE
}
DenyStatement represents DENY permissions statement.
func (*DenyStatement) String ¶
func (ds *DenyStatement) String() string
func (*DenyStatement) TokenLiteral ¶
func (ds *DenyStatement) TokenLiteral() string
type DerivedTable ¶
type DerivedTable struct {
Token token.Token
Subquery *SelectStatement
Alias *Identifier
ColumnAliases []*Identifier // Column names like AS T(c1, c2)
}
DerivedTable represents a subquery in the FROM clause.
func (*DerivedTable) String ¶
func (dt *DerivedTable) String() string
func (*DerivedTable) TokenLiteral ¶
func (dt *DerivedTable) TokenLiteral() string
type DmlDerivedTable ¶
type DmlDerivedTable struct {
Token token.Token
Statement Statement // DELETE, UPDATE, or MERGE statement with OUTPUT
Alias *Identifier
ColumnAliases []*Identifier
}
DmlDerivedTable represents composable DML: FROM (DELETE/UPDATE/MERGE ... OUTPUT ...) AS alias
func (*DmlDerivedTable) String ¶
func (ddt *DmlDerivedTable) String() string
func (*DmlDerivedTable) TokenLiteral ¶
func (ddt *DmlDerivedTable) TokenLiteral() string
type DropAvailabilityGroupStatement ¶
DropAvailabilityGroupStatement represents DROP AVAILABILITY GROUP.
func (*DropAvailabilityGroupStatement) String ¶
func (dag *DropAvailabilityGroupStatement) String() string
func (*DropAvailabilityGroupStatement) TokenLiteral ¶
func (dag *DropAvailabilityGroupStatement) TokenLiteral() string
type DropFulltextCatalogStatement ¶
DropFulltextCatalogStatement represents DROP FULLTEXT CATALOG.
func (*DropFulltextCatalogStatement) String ¶
func (dfc *DropFulltextCatalogStatement) String() string
func (*DropFulltextCatalogStatement) TokenLiteral ¶
func (dfc *DropFulltextCatalogStatement) TokenLiteral() string
type DropFulltextIndexStatement ¶
type DropFulltextIndexStatement struct {
Token token.Token
TableName *QualifiedIdentifier
}
DropFulltextIndexStatement represents DROP FULLTEXT INDEX ON table.
func (*DropFulltextIndexStatement) String ¶
func (dfi *DropFulltextIndexStatement) String() string
func (*DropFulltextIndexStatement) TokenLiteral ¶
func (dfi *DropFulltextIndexStatement) TokenLiteral() string
type DropIndexStatement ¶
type DropIndexStatement struct {
Token token.Token
IfExists bool
Name *Identifier
Table *QualifiedIdentifier
}
DropIndexStatement represents a DROP INDEX statement.
func (*DropIndexStatement) String ¶
func (di *DropIndexStatement) String() string
func (*DropIndexStatement) TokenLiteral ¶
func (di *DropIndexStatement) TokenLiteral() string
type DropObjectStatement ¶
type DropObjectStatement struct {
Token token.Token
ObjectType string // VIEW, FUNCTION, PROCEDURE, TRIGGER, INDEX
IfExists bool
Names []*QualifiedIdentifier
// For DROP INDEX: index name and table
IndexName *Identifier
TableName *QualifiedIdentifier
// For DROP TRIGGER: scope
OnDatabase bool // ON DATABASE
OnAllServer bool // ON ALL SERVER
}
DropObjectStatement represents a generic DROP statement for various object types.
func (*DropObjectStatement) String ¶
func (do *DropObjectStatement) String() string
func (*DropObjectStatement) TokenLiteral ¶
func (do *DropObjectStatement) TokenLiteral() string
type DropResourcePoolStatement ¶
DropResourcePoolStatement represents DROP RESOURCE POOL.
func (*DropResourcePoolStatement) String ¶
func (drp *DropResourcePoolStatement) String() string
func (*DropResourcePoolStatement) TokenLiteral ¶
func (drp *DropResourcePoolStatement) TokenLiteral() string
type DropSequenceStatement ¶
type DropSequenceStatement struct {
Token token.Token
IfExists bool
Name *QualifiedIdentifier
}
DropSequenceStatement represents DROP SEQUENCE.
func (*DropSequenceStatement) String ¶
func (ds *DropSequenceStatement) String() string
func (*DropSequenceStatement) TokenLiteral ¶
func (ds *DropSequenceStatement) TokenLiteral() string
type DropStatisticsStatement ¶
DropStatisticsStatement represents DROP STATISTICS.
func (*DropStatisticsStatement) String ¶
func (ds *DropStatisticsStatement) String() string
func (*DropStatisticsStatement) TokenLiteral ¶
func (ds *DropStatisticsStatement) TokenLiteral() string
type DropSynonymStatement ¶
type DropSynonymStatement struct {
Token token.Token
IfExists bool
Name *QualifiedIdentifier
}
DropSynonymStatement represents DROP SYNONYM name.
func (*DropSynonymStatement) String ¶
func (ds *DropSynonymStatement) String() string
func (*DropSynonymStatement) TokenLiteral ¶
func (ds *DropSynonymStatement) TokenLiteral() string
type DropTableStatement ¶
type DropTableStatement struct {
Token token.Token
IfExists bool
Tables []*QualifiedIdentifier
}
DropTableStatement represents a DROP TABLE statement.
func (*DropTableStatement) String ¶
func (dt *DropTableStatement) String() string
func (*DropTableStatement) TokenLiteral ¶
func (dt *DropTableStatement) TokenLiteral() string
type DropWorkloadGroupStatement ¶
DropWorkloadGroupStatement represents DROP WORKLOAD GROUP.
func (*DropWorkloadGroupStatement) String ¶
func (dwg *DropWorkloadGroupStatement) String() string
func (*DropWorkloadGroupStatement) TokenLiteral ¶
func (dwg *DropWorkloadGroupStatement) TokenLiteral() string
type EnableDisableTriggerStatement ¶
type EnableDisableTriggerStatement struct {
Token token.Token
Enable bool // true = ENABLE, false = DISABLE
TriggerName *Identifier // nil if AllTriggers is true
AllTriggers bool // ENABLE/DISABLE TRIGGER ALL
TableName *QualifiedIdentifier // Target table
OnDatabase bool // ON DATABASE
OnAllServer bool // ON ALL SERVER
}
EnableDisableTriggerStatement represents ENABLE/DISABLE TRIGGER statements
func (*EnableDisableTriggerStatement) String ¶
func (s *EnableDisableTriggerStatement) String() string
func (*EnableDisableTriggerStatement) TokenLiteral ¶
func (s *EnableDisableTriggerStatement) TokenLiteral() string
type EndConversationStatement ¶
type EndConversationStatement struct {
Token token.Token
ConversationHandle string
WithCleanup bool
WithError Expression
ErrorDescription Expression
}
EndConversationStatement represents END CONVERSATION.
func (*EndConversationStatement) String ¶
func (ec *EndConversationStatement) String() string
func (*EndConversationStatement) TokenLiteral ¶
func (ec *EndConversationStatement) TokenLiteral() string
type ExecParameter ¶
type ExecParameter struct {
Name string
Value Expression
Output bool
}
type ExecStatement ¶
type ExecStatement struct {
Token token.Token
ReturnVariable *Identifier // @ReturnCode = ...
Procedure *QualifiedIdentifier
Parameters []*ExecParameter
DynamicSQL Expression // For EXEC('dynamic sql')
AtServer *Identifier // For EXEC(...) AT LinkedServer
Recompile bool // WITH RECOMPILE
ResultSets []*ResultSetDefinition // WITH RESULT SETS ((...), (...))
ResultSetsMode string // "UNDEFINED" or "NONE" for WITH RESULT SETS UNDEFINED/NONE
}
ExecStatement represents an EXEC/EXECUTE statement.
func (*ExecStatement) String ¶
func (es *ExecStatement) String() string
func (*ExecStatement) TokenLiteral ¶
func (es *ExecStatement) TokenLiteral() string
type ExecuteAsStatement ¶
type ExecuteAsStatement struct {
Token token.Token
Type string // CALLER, SELF, OWNER, USER, LOGIN
UserName string // For USER = 'name' or LOGIN = 'name'
CookieVar string // For WITH COOKIE INTO @var
}
ExecuteAsStatement represents EXECUTE AS { CALLER | SELF | OWNER | USER = 'name' }.
func (*ExecuteAsStatement) String ¶
func (ea *ExecuteAsStatement) String() string
func (*ExecuteAsStatement) TokenLiteral ¶
func (ea *ExecuteAsStatement) TokenLiteral() string
type ExistsExpression ¶
type ExistsExpression struct {
Token token.Token
Subquery *SelectStatement
}
ExistsExpression represents an EXISTS expression.
func (*ExistsExpression) String ¶
func (ee *ExistsExpression) String() string
func (*ExistsExpression) TokenLiteral ¶
func (ee *ExistsExpression) TokenLiteral() string
type Expression ¶
type Expression interface {
Node
// contains filtered or unexported methods
}
Expression represents an expression node.
type ExpressionStatement ¶
type ExpressionStatement struct {
Token token.Token
Expression Expression
}
ExpressionStatement wraps an expression as a statement.
func (*ExpressionStatement) String ¶
func (es *ExpressionStatement) String() string
func (*ExpressionStatement) TokenLiteral ¶
func (es *ExpressionStatement) TokenLiteral() string
type FetchStatement ¶
type FetchStatement struct {
Token token.Token
Direction string // NEXT, PRIOR, FIRST, LAST, ABSOLUTE, RELATIVE
Offset Expression // For ABSOLUTE n or RELATIVE n
CursorName *Identifier
IntoVars []*Variable
}
FetchStatement represents FETCH [NEXT|PRIOR|FIRST|LAST|ABSOLUTE|RELATIVE] FROM cursor INTO vars.
func (*FetchStatement) String ¶
func (fs *FetchStatement) String() string
func (*FetchStatement) TokenLiteral ¶
func (fs *FetchStatement) TokenLiteral() string
type FloatLiteral ¶
FloatLiteral represents a floating-point literal.
func (*FloatLiteral) String ¶
func (fl *FloatLiteral) String() string
func (*FloatLiteral) TokenLiteral ¶
func (fl *FloatLiteral) TokenLiteral() string
type ForClause ¶
type ForClause struct {
Token token.Token
ForType string // "XML" or "JSON"
Mode string // RAW, AUTO, PATH, EXPLICIT
ElementName string // Optional element name for RAW/PATH
Elements bool // ELEMENTS option (XML)
Type bool // TYPE option (returns xml type)
Root string // ROOT('name') option
WithoutArrayWrapper bool // WITHOUT_ARRAY_WRAPPER (JSON)
IncludeNullValues bool // INCLUDE_NULL_VALUES (JSON)
}
ForClause represents FOR XML or FOR JSON clause
type FrameBound ¶
type FrameBound struct {
Type string // UNBOUNDED PRECEDING, UNBOUNDED FOLLOWING, CURRENT ROW, n PRECEDING, n FOLLOWING
Offset Expression // for n PRECEDING/FOLLOWING
}
FrameBound represents a window frame bound.
func (*FrameBound) String ¶
func (fb *FrameBound) String() string
type FreetextExpression ¶
type FreetextExpression struct {
Token token.Token
Columns []string // Column(s) to search, or * for all
SearchTerm Expression // Search text
Language string // Optional LANGUAGE value
}
FreetextExpression represents the FREETEXT predicate.
func (*FreetextExpression) String ¶
func (fe *FreetextExpression) String() string
func (*FreetextExpression) TokenLiteral ¶
func (fe *FreetextExpression) TokenLiteral() string
type FreetextTableExpression ¶
type FreetextTableExpression struct {
Token token.Token
TableName string
Columns []string // Column(s) to search, or * for all
SearchTerm Expression // Search text
TopN Expression // Optional TOP n_hits
Language string // Optional LANGUAGE value
}
FreetextTableExpression represents FREETEXTTABLE function.
func (*FreetextTableExpression) String ¶
func (ft *FreetextTableExpression) String() string
func (*FreetextTableExpression) TokenLiteral ¶
func (ft *FreetextTableExpression) TokenLiteral() string
type FromClause ¶
type FromClause struct {
Token token.Token
Tables []TableReference
}
FromClause represents a FROM clause.
func (*FromClause) String ¶
func (fc *FromClause) String() string
type FulltextColumn ¶
type FulltextColumn struct {
Name string
TypeColumn string // TYPE COLUMN type_column_name
Language string // LANGUAGE language_term
StatisticalSemantics bool // STATISTICAL_SEMANTICS
}
FulltextColumn represents a column in a fulltext index.
func (*FulltextColumn) String ¶
func (fic *FulltextColumn) String() string
type FunctionCall ¶
type FunctionCall struct {
Token token.Token
Function Expression
Arguments []Expression
WithinGroup []*OrderByItem // For WITHIN GROUP (ORDER BY ...) - ordered-set aggregates
Over *OverClause
}
FunctionCall represents a function call.
func (*FunctionCall) String ¶
func (fc *FunctionCall) String() string
func (*FunctionCall) TokenLiteral ¶
func (fc *FunctionCall) TokenLiteral() string
type FunctionType ¶
type FunctionType int
FunctionType represents the type of function.
const ( FunctionScalar FunctionType = iota FunctionInlineTable FunctionMultiStatementTable )
type GetConversationGroupStatement ¶
type GetConversationGroupStatement struct {
Token token.Token
GroupId string // Variable to receive group ID
FromQueue *QualifiedIdentifier
Timeout Expression
}
GetConversationGroupStatement represents GET CONVERSATION GROUP.
func (*GetConversationGroupStatement) String ¶
func (gcg *GetConversationGroupStatement) String() string
func (*GetConversationGroupStatement) TokenLiteral ¶
func (gcg *GetConversationGroupStatement) TokenLiteral() string
type GoStatement ¶
GoStatement represents a GO batch separator.
func (*GoStatement) String ¶
func (gs *GoStatement) String() string
func (*GoStatement) TokenLiteral ¶
func (gs *GoStatement) TokenLiteral() string
type GotoStatement ¶
type GotoStatement struct {
Token token.Token
Label *Identifier
}
GotoStatement represents a GOTO label statement.
func (*GotoStatement) String ¶
func (gs *GotoStatement) String() string
func (*GotoStatement) TokenLiteral ¶
func (gs *GotoStatement) TokenLiteral() string
type GrantStatement ¶
type GrantStatement struct {
Token token.Token
Permissions []string // SELECT, INSERT, UPDATE, DELETE, EXECUTE, etc.
OnType string // OBJECT, SCHEMA, DATABASE, or empty for object-level
OnObject *QualifiedIdentifier
Columns []string // Column-level permissions (col1, col2, ...)
ToPrincipals []string // Users, roles, logins
WithGrantOption bool // WITH GRANT OPTION
}
GrantStatement represents GRANT permissions statement.
func (*GrantStatement) String ¶
func (gs *GrantStatement) String() string
func (*GrantStatement) TokenLiteral ¶
func (gs *GrantStatement) TokenLiteral() string
type GroupingSetsExpression ¶
type GroupingSetsExpression struct {
Token token.Token
Sets []Expression // Each element is a TupleExpression or single column
}
GroupingSetsExpression represents a GROUPING SETS expression in GROUP BY
func (*GroupingSetsExpression) String ¶
func (gse *GroupingSetsExpression) String() string
func (*GroupingSetsExpression) TokenLiteral ¶
func (gse *GroupingSetsExpression) TokenLiteral() string
type Identifier ¶
Identifier represents an identifier (table name, column name, etc.).
func (*Identifier) String ¶
func (i *Identifier) String() string
func (*Identifier) TokenLiteral ¶
func (i *Identifier) TokenLiteral() string
type IdentitySpec ¶
IdentitySpec represents IDENTITY(seed, increment) specification.
func (*IdentitySpec) String ¶
func (is *IdentitySpec) String() string
type IfStatement ¶
type IfStatement struct {
Token token.Token
Condition Expression
Consequence Statement
Alternative Statement
}
IfStatement represents an IF statement.
func (*IfStatement) String ¶
func (is *IfStatement) String() string
func (*IfStatement) TokenLiteral ¶
func (is *IfStatement) TokenLiteral() string
type InExpression ¶
type InExpression struct {
Token token.Token
Expr Expression
Not bool
Values []Expression
Subquery *SelectStatement
}
InExpression represents an IN expression.
func (*InExpression) String ¶
func (ie *InExpression) String() string
func (*InExpression) TokenLiteral ¶
func (ie *InExpression) TokenLiteral() string
type IndexColumn ¶
type IndexColumn struct {
Name *Identifier
Descending bool
}
IndexColumn represents a column in an index or constraint with optional ordering.
func (*IndexColumn) String ¶
func (ic *IndexColumn) String() string
type InfixExpression ¶
type InfixExpression struct {
Token token.Token
Left Expression
Operator string
Right Expression
}
InfixExpression represents an infix expression (a + b, a AND b, etc.).
func (*InfixExpression) String ¶
func (ie *InfixExpression) String() string
func (*InfixExpression) TokenLiteral ¶
func (ie *InfixExpression) TokenLiteral() string
type InlineIndex ¶
type InlineIndex struct {
Name string
Clustered *bool // nil = not specified, true = CLUSTERED, false = NONCLUSTERED
}
InlineIndex represents an inline index definition on a column
type InsertStatement ¶
type InsertStatement struct {
Token token.Token
Top Expression
TopPercent bool
Table *QualifiedIdentifier
Hints []string // Table hints: WITH (KEEPIDENTITY), WITH (TABLOCK), etc.
Columns []*Identifier
Values [][]Expression
Select *SelectStatement
Output *OutputClause
DefaultValues bool // INSERT ... DEFAULT VALUES
}
InsertStatement represents an INSERT statement.
func (*InsertStatement) String ¶
func (is *InsertStatement) String() string
func (*InsertStatement) TokenLiteral ¶
func (is *InsertStatement) TokenLiteral() string
type IntegerLiteral ¶
IntegerLiteral represents an integer literal.
func (*IntegerLiteral) String ¶
func (il *IntegerLiteral) String() string
func (*IntegerLiteral) TokenLiteral ¶
func (il *IntegerLiteral) TokenLiteral() string
type IsDistinctFromExpression ¶
type IsDistinctFromExpression struct {
Token token.Token
Left Expression
Right Expression
Not bool // true for IS NOT DISTINCT FROM
}
IsDistinctFromExpression represents IS [NOT] DISTINCT FROM expression (SQL Server 2022+)
func (*IsDistinctFromExpression) String ¶
func (id *IsDistinctFromExpression) String() string
func (*IsDistinctFromExpression) TokenLiteral ¶
func (id *IsDistinctFromExpression) TokenLiteral() string
type IsNullExpression ¶
type IsNullExpression struct {
Token token.Token
Expr Expression
Not bool
}
IsNullExpression represents an IS NULL or IS NOT NULL expression.
func (*IsNullExpression) String ¶
func (in *IsNullExpression) String() string
func (*IsNullExpression) TokenLiteral ¶
func (in *IsNullExpression) TokenLiteral() string
type JoinClause ¶
type JoinClause struct {
Token token.Token
Type string // INNER, LEFT, RIGHT, FULL, CROSS
Hint string // HASH, MERGE, LOOP, REMOTE
Left TableReference
Right TableReference
Condition Expression
}
JoinClause represents a JOIN clause.
func (*JoinClause) String ¶
func (jc *JoinClause) String() string
func (*JoinClause) TokenLiteral ¶
func (jc *JoinClause) TokenLiteral() string
type JsonKeyValuePair ¶
type JsonKeyValuePair struct {
Token token.Token
Key Expression
Value Expression
}
JsonKeyValuePair represents 'key':value syntax in JSON_OBJECT
func (*JsonKeyValuePair) String ¶
func (jkv *JsonKeyValuePair) String() string
func (*JsonKeyValuePair) TokenLiteral ¶
func (jkv *JsonKeyValuePair) TokenLiteral() string
type LabelStatement ¶
type LabelStatement struct {
Token token.Token
Name *Identifier
}
LabelStatement represents a label definition (LabelName:).
func (*LabelStatement) String ¶
func (ls *LabelStatement) String() string
func (*LabelStatement) TokenLiteral ¶
func (ls *LabelStatement) TokenLiteral() string
type LikeExpression ¶
type LikeExpression struct {
Token token.Token
Expr Expression
Not bool
Pattern Expression
Escape Expression
}
LikeExpression represents a LIKE expression.
func (*LikeExpression) String ¶
func (le *LikeExpression) String() string
func (*LikeExpression) TokenLiteral ¶
func (le *LikeExpression) TokenLiteral() string
type MergeActionType ¶
type MergeActionType int
MergeActionType represents the type of action in a WHEN clause.
const ( MergeActionUpdate MergeActionType = iota MergeActionDelete MergeActionInsert )
type MergeStatement ¶
type MergeStatement struct {
Token token.Token
Target *QualifiedIdentifier
TargetAlias *Identifier
Source TableReference // Can be table, subquery, etc.
SourceAlias *Identifier
OnCondition Expression
WhenClauses []*MergeWhenClause
Output *OutputClause
}
MergeStatement represents a MERGE statement.
func (*MergeStatement) String ¶
func (ms *MergeStatement) String() string
func (*MergeStatement) TokenLiteral ¶
func (ms *MergeStatement) TokenLiteral() string
type MergeWhenClause ¶
type MergeWhenClause struct {
Type MergeWhenType
Condition Expression // Optional AND condition
Action MergeActionType
SetClauses []*SetClause // For UPDATE
Columns []*Identifier // For INSERT
Values []Expression // For INSERT
}
MergeWhenClause represents a WHEN clause in a MERGE statement.
func (*MergeWhenClause) String ¶
func (mw *MergeWhenClause) String() string
type MergeWhenType ¶
type MergeWhenType int
MergeWhenType represents the type of WHEN clause.
const ( MergeWhenMatched MergeWhenType = iota MergeWhenNotMatchedByTarget MergeWhenNotMatchedBySource )
type MethodCallExpression ¶
type MethodCallExpression struct {
Token token.Token
Object Expression // The object being called on
MethodName string // value, nodes, query, exist, modify
Arguments []Expression
}
MethodCallExpression represents a method call on an object (e.g., @xml.value('xpath', 'type'))
func (*MethodCallExpression) String ¶
func (mc *MethodCallExpression) String() string
func (*MethodCallExpression) TokenLiteral ¶
func (mc *MethodCallExpression) TokenLiteral() string
type MoneyLiteral ¶
MoneyLiteral represents a money literal (e.g., $123.45).
func (*MoneyLiteral) String ¶
func (ml *MoneyLiteral) String() string
func (*MoneyLiteral) TokenLiteral ¶
func (ml *MoneyLiteral) TokenLiteral() string
type MoveConversationStatement ¶
type MoveConversationStatement struct {
Token token.Token
ConversationHandle string
ToGroupId string
}
MoveConversationStatement represents MOVE CONVERSATION.
func (*MoveConversationStatement) String ¶
func (mc *MoveConversationStatement) String() string
func (*MoveConversationStatement) TokenLiteral ¶
func (mc *MoveConversationStatement) TokenLiteral() string
type NextValueForExpression ¶
type NextValueForExpression struct {
Token token.Token
SequenceName *QualifiedIdentifier
Over *OverClause // Optional OVER (ORDER BY ...) clause
}
NextValueForExpression represents NEXT VALUE FOR sequence_name
func (*NextValueForExpression) String ¶
func (nv *NextValueForExpression) String() string
func (*NextValueForExpression) TokenLiteral ¶
func (nv *NextValueForExpression) TokenLiteral() string
type NullLiteral ¶
NullLiteral represents a NULL literal.
func (*NullLiteral) String ¶
func (nl *NullLiteral) String() string
func (*NullLiteral) TokenLiteral ¶
func (nl *NullLiteral) TokenLiteral() string
type OpenCursorStatement ¶
type OpenCursorStatement struct {
Token token.Token
CursorName *Identifier
}
OpenCursorStatement represents OPEN cursor_name.
func (*OpenCursorStatement) String ¶
func (oc *OpenCursorStatement) String() string
func (*OpenCursorStatement) TokenLiteral ¶
func (oc *OpenCursorStatement) TokenLiteral() string
type OpenJsonColumn ¶
type OpenJsonColumn struct {
Name string
DataType *DataType
Path string // JSON path like '$.name'
AsJson bool // AS JSON modifier
}
func (*OpenJsonColumn) String ¶
func (oc *OpenJsonColumn) String() string
type OpenSymmetricKeyStatement ¶
type OpenSymmetricKeyStatement struct {
Token token.Token
KeyName string
DecryptByCert string // DECRYPTION BY CERTIFICATE name
DecryptByKey string // DECRYPTION BY SYMMETRIC KEY name
DecryptByPwd string // DECRYPTION BY PASSWORD = 'xxx'
}
OpenSymmetricKeyStatement represents OPEN SYMMETRIC KEY statement.
func (*OpenSymmetricKeyStatement) String ¶
func (osk *OpenSymmetricKeyStatement) String() string
func (*OpenSymmetricKeyStatement) TokenLiteral ¶
func (osk *OpenSymmetricKeyStatement) TokenLiteral() string
type OptimizeForHint ¶
type OptimizeForHint struct {
Variable string
Value Expression // nil if UNKNOWN
Unknown bool // true if UNKNOWN
}
OptimizeForHint represents a single OPTIMIZE FOR hint binding
type OrderByItem ¶
type OrderByItem struct {
Expression Expression
Descending bool
NullsFirst *bool
}
OrderByItem represents an item in an ORDER BY clause.
func (*OrderByItem) String ¶
func (ob *OrderByItem) String() string
type OutputClause ¶
type OutputClause struct {
Columns []SelectColumn
Into *QualifiedIdentifier // INTO table
IntoVariable *Variable // INTO @variable
IntoColumns []*Identifier // Column list: INTO @table(col1, col2)
}
OutputClause represents an OUTPUT clause.
func (*OutputClause) String ¶
func (oc *OutputClause) String() string
type OverClause ¶
type OverClause struct {
Token token.Token
WindowRef string // Named window reference (e.g., OVER w)
PartitionBy []Expression
OrderBy []*OrderByItem
Frame *WindowFrame
}
OverClause represents an OVER clause for window functions.
func (*OverClause) String ¶
func (oc *OverClause) String() string
type ParameterDef ¶
type ParameterDef struct {
Name string
DataType *DataType
Default Expression
Output bool
ReadOnly bool
}
ParameterDef represents a parameter definition.
func (*ParameterDef) String ¶
func (pd *ParameterDef) String() string
type ParenthesizedTableRef ¶
type ParenthesizedTableRef struct {
Token token.Token
Inner TableReference // The table reference (possibly with joins) inside the parentheses
}
ParenthesizedTableRef represents a parenthesized table reference with joins: (t1 JOIN t2 ON ...)
func (*ParenthesizedTableRef) String ¶
func (ptr *ParenthesizedTableRef) String() string
func (*ParenthesizedTableRef) TokenLiteral ¶
func (ptr *ParenthesizedTableRef) TokenLiteral() string
type ParseExpression ¶
type ParseExpression struct {
Token token.Token
Expression Expression
TargetType *DataType
Culture Expression // optional USING culture
IsTry bool // true for TRY_PARSE
}
ParseExpression represents PARSE/TRY_PARSE(expr AS type [USING culture])
func (*ParseExpression) String ¶
func (pe *ParseExpression) String() string
func (*ParseExpression) TokenLiteral ¶
func (pe *ParseExpression) TokenLiteral() string
type PartitionRange ¶
PartitionRange represents a partition number or range
type PivotTable ¶
type PivotTable struct {
Token token.Token
Source TableReference
AggregateFunc string // SUM, COUNT, AVG, etc.
ValueColumn Expression // Column being aggregated
PivotColumn *Identifier // Column whose values become columns
PivotValues []*Identifier // Values that become column names
Alias *Identifier
}
PivotTable represents a PIVOT table operation. Syntax: source PIVOT (aggregate(value_col) FOR pivot_col IN ([v1], [v2], ...)) AS alias
func (*PivotTable) String ¶
func (pt *PivotTable) String() string
func (*PivotTable) TokenLiteral ¶
func (pt *PivotTable) TokenLiteral() string
type PrefixExpression ¶
type PrefixExpression struct {
Token token.Token
Operator string
Right Expression
}
PrefixExpression represents a prefix expression (NOT, -, ~).
func (*PrefixExpression) String ¶
func (pe *PrefixExpression) String() string
func (*PrefixExpression) TokenLiteral ¶
func (pe *PrefixExpression) TokenLiteral() string
type PrintStatement ¶
type PrintStatement struct {
Token token.Token
Expression Expression
}
PrintStatement represents a PRINT statement.
func (*PrintStatement) String ¶
func (ps *PrintStatement) String() string
func (*PrintStatement) TokenLiteral ¶
func (ps *PrintStatement) TokenLiteral() string
type Program ¶
type Program struct {
Statements []Statement
}
Program is the root node of every AST.
func (*Program) TokenLiteral ¶
type QualifiedIdentifier ¶
type QualifiedIdentifier struct {
Parts []*Identifier
}
QualifiedIdentifier represents a multi-part identifier (schema.table, etc.).
func (*QualifiedIdentifier) String ¶
func (q *QualifiedIdentifier) String() string
func (*QualifiedIdentifier) TokenLiteral ¶
func (q *QualifiedIdentifier) TokenLiteral() string
type QueryOption ¶
type QueryOption struct {
Name string // RECOMPILE, MAXDOP, HASH JOIN, USE HINT, OPTIMIZE FOR, etc.
Value Expression // Optional value (e.g., 4 for MAXDOP 4)
Hints []string // For USE HINT('hint1', 'hint2')
OptimizeFor []*OptimizeForHint // For OPTIMIZE FOR (@var = value, @var UNKNOWN)
}
QueryOption represents a query hint in OPTION clause
func (*QueryOption) String ¶
func (qo *QueryOption) String() string
type RaiserrorStatement ¶
type RaiserrorStatement struct {
Token token.Token
Message Expression
Severity Expression
State Expression
Args []Expression // Additional format arguments
Options []string
}
RaiserrorStatement represents a RAISERROR statement.
func (*RaiserrorStatement) String ¶
func (rs *RaiserrorStatement) String() string
func (*RaiserrorStatement) TokenLiteral ¶
func (rs *RaiserrorStatement) TokenLiteral() string
type ReceiveColumn ¶
ReceiveColumn represents a column in RECEIVE statement.
func (*ReceiveColumn) String ¶
func (rc *ReceiveColumn) String() string
type ReceiveStatement ¶
type ReceiveStatement struct {
Token token.Token
Top Expression // TOP(n)
Columns []*ReceiveColumn // Column assignments
FromQueue *QualifiedIdentifier
Into string // INTO table_variable
Where Expression
Timeout Expression // WAITFOR with timeout
}
ReceiveStatement represents RECEIVE FROM queue.
func (*ReceiveStatement) String ¶
func (rs *ReceiveStatement) String() string
func (*ReceiveStatement) TokenLiteral ¶
func (rs *ReceiveStatement) TokenLiteral() string
type ReconfigureStatement ¶
type ReconfigureStatement struct {
Token token.Token
WithOverride bool // RECONFIGURE WITH OVERRIDE
}
ReconfigureStatement represents RECONFIGURE statement.
func (*ReconfigureStatement) String ¶
func (rs *ReconfigureStatement) String() string
func (*ReconfigureStatement) TokenLiteral ¶
func (rs *ReconfigureStatement) TokenLiteral() string
type RestoreStatement ¶
type RestoreStatement struct {
Token token.Token
RestoreType string // DATABASE, LOG, FILELISTONLY, HEADERONLY, VERIFYONLY
DatabaseName string // Database name (empty for FILELISTONLY/HEADERONLY)
FromLocations []*BackupLocation // FROM DISK/URL = 'path', ...
WithOptions []*BackupOption // WITH option = value, ...
}
RestoreStatement represents RESTORE DATABASE/LOG/FILELISTONLY/HEADERONLY statement.
func (*RestoreStatement) String ¶
func (rs *RestoreStatement) String() string
func (*RestoreStatement) TokenLiteral ¶
func (rs *RestoreStatement) TokenLiteral() string
type ResultSetColumn ¶
type ResultSetColumn struct {
Name string
DataType *DataType
Nullable bool // true = NULL, false = NOT NULL or unspecified
HasNull bool // whether NULL/NOT NULL was specified
}
ResultSetColumn represents a column in a result set definition
type ResultSetDefinition ¶
type ResultSetDefinition struct {
Columns []*ResultSetColumn
}
ResultSetDefinition represents a result set column definition in EXEC WITH RESULT SETS
type ReturnStatement ¶
type ReturnStatement struct {
Token token.Token
Value Expression
}
ReturnStatement represents a RETURN statement.
func (*ReturnStatement) String ¶
func (rs *ReturnStatement) String() string
func (*ReturnStatement) TokenLiteral ¶
func (rs *ReturnStatement) TokenLiteral() string
type RevertStatement ¶
type RevertStatement struct {
Token token.Token
Cookie Expression // Optional: WITH COOKIE = @cookie
}
RevertStatement represents REVERT.
func (*RevertStatement) String ¶
func (rs *RevertStatement) String() string
func (*RevertStatement) TokenLiteral ¶
func (rs *RevertStatement) TokenLiteral() string
type RevokeStatement ¶
type RevokeStatement struct {
Token token.Token
GrantOptionFor bool // GRANT OPTION FOR
Permissions []string // SELECT, INSERT, UPDATE, DELETE, EXECUTE, etc.
OnType string // OBJECT, SCHEMA, DATABASE, or empty
OnObject *QualifiedIdentifier
Columns []string // Column-level permissions (col1, col2, ...)
FromPrincipals []string // Users, roles, logins
Cascade bool // CASCADE
}
RevokeStatement represents REVOKE permissions statement.
func (*RevokeStatement) String ¶
func (rs *RevokeStatement) String() string
func (*RevokeStatement) TokenLiteral ¶
func (rs *RevokeStatement) TokenLiteral() string
type RollbackTransactionStatement ¶
type RollbackTransactionStatement struct {
Token token.Token
Name *Identifier
}
RollbackTransactionStatement represents ROLLBACK TRANSACTION.
func (*RollbackTransactionStatement) String ¶
func (rt *RollbackTransactionStatement) String() string
func (*RollbackTransactionStatement) TokenLiteral ¶
func (rt *RollbackTransactionStatement) TokenLiteral() string
type RollupExpression ¶
type RollupExpression struct {
Token token.Token
Columns []Expression
}
RollupExpression represents a ROLLUP expression in GROUP BY
func (*RollupExpression) String ¶
func (re *RollupExpression) String() string
func (*RollupExpression) TokenLiteral ¶
func (re *RollupExpression) TokenLiteral() string
type SaveTransactionStatement ¶
type SaveTransactionStatement struct {
Token token.Token
SavepointName *Identifier
}
SaveTransactionStatement represents a SAVE TRANSACTION statement.
func (*SaveTransactionStatement) String ¶
func (st *SaveTransactionStatement) String() string
func (*SaveTransactionStatement) TokenLiteral ¶
func (st *SaveTransactionStatement) TokenLiteral() string
type SelectColumn ¶
type SelectColumn struct {
Expression Expression
Alias *Identifier
AllColumns bool // SELECT *
Variable *Variable // For SELECT @var = expr
}
SelectColumn represents a column in a SELECT list.
func (SelectColumn) String ¶
func (sc SelectColumn) String() string
type SelectStatement ¶
type SelectStatement struct {
Token token.Token
Distinct bool
Top *TopClause
Columns []SelectColumn
Into *QualifiedIdentifier
IntoFilegroup *Identifier // ON [filegroup] for SELECT INTO
From *FromClause
Where Expression
GroupBy []Expression
Having Expression
WindowDefs []*WindowDefinition // WINDOW w AS (...)
OrderBy []*OrderByItem
Union *UnionClause
Offset Expression
Fetch Expression
ForClause *ForClause
Options []*QueryOption // OPTION (RECOMPILE, MAXDOP 4, etc.)
}
SelectStatement represents a SELECT statement.
func (*SelectStatement) String ¶
func (ss *SelectStatement) String() string
func (*SelectStatement) TokenLiteral ¶
func (ss *SelectStatement) TokenLiteral() string
type SendOnConversationStatement ¶
type SendOnConversationStatement struct {
Token token.Token
ConversationHandle string // Variable or expression
MessageType string
MessageBody Expression
}
SendOnConversationStatement represents SEND ON CONVERSATION.
func (*SendOnConversationStatement) String ¶
func (soc *SendOnConversationStatement) String() string
func (*SendOnConversationStatement) TokenLiteral ¶
func (soc *SendOnConversationStatement) TokenLiteral() string
type SetClause ¶
type SetClause struct {
Column *QualifiedIdentifier
Operator string // "=" or "+=", "-=", "*=", "/=", "%=", "&=", "|=", "^="
Value Expression
IsMethodCall bool // For XML method calls like column.modify(...)
MethodArgs []Expression // Arguments for method calls
}
type SetOptionStatement ¶
type SetOptionStatement struct {
Token token.Token
Option string // IDENTITY_INSERT, ROWCOUNT, LANGUAGE, etc.
Table *QualifiedIdentifier // For IDENTITY_INSERT
Value Expression // The value (ON/OFF, number, identifier)
}
SetOptionStatement represents various SET option statements.
func (*SetOptionStatement) String ¶
func (so *SetOptionStatement) String() string
func (*SetOptionStatement) TokenLiteral ¶
func (so *SetOptionStatement) TokenLiteral() string
type SetStatement ¶
type SetStatement struct {
Token token.Token
Variable Expression
Value Expression
Option string // For SET options like NOCOUNT, etc.
OnOff string // ON or OFF for SET options
}
SetStatement represents a SET statement.
func (*SetStatement) String ¶
func (ss *SetStatement) String() string
func (*SetStatement) TokenLiteral ¶
func (ss *SetStatement) TokenLiteral() string
type SetTransactionIsolationStatement ¶
type SetTransactionIsolationStatement struct {
Token token.Token
Level string // READ UNCOMMITTED, READ COMMITTED, REPEATABLE READ, SERIALIZABLE, SNAPSHOT
}
SetTransactionIsolationStatement represents SET TRANSACTION ISOLATION LEVEL.
func (*SetTransactionIsolationStatement) String ¶
func (si *SetTransactionIsolationStatement) String() string
func (*SetTransactionIsolationStatement) TokenLiteral ¶
func (si *SetTransactionIsolationStatement) TokenLiteral() string
type Statement ¶
type Statement interface {
Node
// contains filtered or unexported methods
}
Statement represents a statement node.
type StaticMethodCall ¶
type StaticMethodCall struct {
Token token.Token
TypeName string // GEOGRAPHY, GEOMETRY, SCHEMA, OBJECT, etc.
MethodName string // Point, STGeomFromText, etc.
Arguments []Expression
}
StaticMethodCall represents a static method call (e.g., GEOGRAPHY::Point(...))
func (*StaticMethodCall) String ¶
func (sm *StaticMethodCall) String() string
func (*StaticMethodCall) TokenLiteral ¶
func (sm *StaticMethodCall) TokenLiteral() string
type StringLiteral ¶
StringLiteral represents a string literal.
func (*StringLiteral) String ¶
func (sl *StringLiteral) String() string
func (*StringLiteral) TokenLiteral ¶
func (sl *StringLiteral) TokenLiteral() string
type SubqueryExpression ¶
type SubqueryExpression struct {
Token token.Token
Subquery *SelectStatement
}
SubqueryExpression represents a subquery as an expression.
func (*SubqueryExpression) String ¶
func (se *SubqueryExpression) String() string
func (*SubqueryExpression) TokenLiteral ¶
func (se *SubqueryExpression) TokenLiteral() string
type TableConstraint ¶
type TableConstraint struct {
Token token.Token
Name string
Type ConstraintType
Columns []*IndexColumn // For PK, UNIQUE, FK
IsClustered *bool
IndexOptions string // WITH (FILLFACTOR = 90, etc.)
ReferencesTable *QualifiedIdentifier
ReferencesColumns []*Identifier
CheckExpression Expression
DefaultExpression Expression // For DEFAULT constraints
ForColumn *Identifier // For DEFAULT ... FOR column
OnDelete string
OnUpdate string
}
TableConstraint represents a table-level constraint in CREATE TABLE.
func (*TableConstraint) String ¶
func (tc *TableConstraint) String() string
type TableName ¶
type TableName struct {
Token token.Token
Name *QualifiedIdentifier
Alias *Identifier
Hints []string
TemporalClause *TemporalClause
TableSample *TableSampleClause
}
TableName represents a simple table reference.
func (*TableName) TokenLiteral ¶
type TableReference ¶
type TableReference interface {
Node
// contains filtered or unexported methods
}
TableReference represents a table reference (can be table, join, subquery).
type TableSampleClause ¶
type TableSampleClause struct {
Token token.Token
System bool // TABLESAMPLE SYSTEM vs regular TABLESAMPLE
Value Expression // The sample value (number)
IsPercent bool // true for PERCENT, false for ROWS
IsRows bool // true for ROWS
Seed Expression // For REPEATABLE (seed)
}
TableSampleClause represents TABLESAMPLE (n PERCENT) or TABLESAMPLE (n ROWS)
func (*TableSampleClause) String ¶
func (ts *TableSampleClause) String() string
type TableTypeDefinition ¶
type TableTypeDefinition struct {
Columns []*ColumnDefinition
Constraints []*TableConstraint
}
TableTypeDefinition represents a TABLE type for table variables.
func (*TableTypeDefinition) String ¶
func (tt *TableTypeDefinition) String() string
type TableValuedFunction ¶
type TableValuedFunction struct {
Token token.Token
Function *QualifiedIdentifier
Arguments []Expression
Alias *Identifier
ColumnAliases []*Identifier // Column names like AS T(c)
OpenJsonColumns []*OpenJsonColumn // For OPENJSON WITH clause
}
TableValuedFunction represents a table-valued function call in FROM/APPLY.
func (*TableValuedFunction) String ¶
func (tvf *TableValuedFunction) String() string
func (*TableValuedFunction) TokenLiteral ¶
func (tvf *TableValuedFunction) TokenLiteral() string
type TemporalClause ¶
type TemporalClause struct {
Token token.Token
Type string // AS OF, BETWEEN...AND, FROM...TO, CONTAINED IN, ALL
StartTime Expression // Start time/date
EndTime Expression // End time/date (for BETWEEN, FROM...TO, CONTAINED IN)
}
TemporalClause represents a FOR SYSTEM_TIME clause for temporal tables.
func (*TemporalClause) String ¶
func (tc *TemporalClause) String() string
type ThrowStatement ¶
type ThrowStatement struct {
Token token.Token
ErrorNum Expression
Message Expression
State Expression
}
ThrowStatement represents a THROW statement.
func (*ThrowStatement) String ¶
func (ts *ThrowStatement) String() string
func (*ThrowStatement) TokenLiteral ¶
func (ts *ThrowStatement) TokenLiteral() string
type TopClause ¶
type TopClause struct {
Count Expression
Percent bool
WithTies bool
}
TopClause represents a TOP clause.
type TriggerTiming ¶
type TriggerTiming int
TriggerTiming represents when a trigger fires.
const ( TriggerAfter TriggerTiming = iota TriggerInsteadOf TriggerFor )
type TrimExpression ¶
type TrimExpression struct {
Token token.Token
TrimSpec string // LEADING, TRAILING, BOTH, or empty
Characters Expression // characters to trim, or nil for default (spaces)
Expression Expression // string to trim from
}
TrimExpression represents a TRIM function call with SQL standard syntax TRIM([LEADING|TRAILING|BOTH] [characters FROM] string)
func (*TrimExpression) String ¶
func (te *TrimExpression) String() string
func (*TrimExpression) TokenLiteral ¶
func (te *TrimExpression) TokenLiteral() string
type TruncateTableStatement ¶
type TruncateTableStatement struct {
Token token.Token
Table *QualifiedIdentifier
Partitions []PartitionRange // WITH (PARTITIONS (1, 2, 3)) or (5 TO 10)
}
TruncateTableStatement represents a TRUNCATE TABLE statement.
func (*TruncateTableStatement) String ¶
func (tt *TruncateTableStatement) String() string
func (*TruncateTableStatement) TokenLiteral ¶
func (tt *TruncateTableStatement) TokenLiteral() string
type TryCatchStatement ¶
type TryCatchStatement struct {
Token token.Token
TryBlock *BeginEndBlock
CatchBlock *BeginEndBlock
}
TryCatchStatement represents a TRY...CATCH block.
func (*TryCatchStatement) String ¶
func (tc *TryCatchStatement) String() string
func (*TryCatchStatement) TokenLiteral ¶
func (tc *TryCatchStatement) TokenLiteral() string
type TupleExpression ¶
type TupleExpression struct {
Token token.Token
Elements []Expression
}
TupleExpression represents a tuple/list of expressions (e.g., (a, b) or () in GROUPING SETS).
func (*TupleExpression) String ¶
func (te *TupleExpression) String() string
func (*TupleExpression) TokenLiteral ¶
func (te *TupleExpression) TokenLiteral() string
type UnionClause ¶
type UnionClause struct {
Type string // UNION, INTERSECT, EXCEPT
All bool
Right *SelectStatement
}
UnionClause represents a UNION, INTERSECT, or EXCEPT clause.
func (*UnionClause) String ¶
func (uc *UnionClause) String() string
type UnpivotTable ¶
type UnpivotTable struct {
Token token.Token
Source TableReference
ValueColumn *Identifier // New column to hold values
PivotColumn *Identifier // New column to hold original column names
SourceColumns []*Identifier // Columns being unpivoted
Alias *Identifier
}
UnpivotTable represents an UNPIVOT table operation. Syntax: source UNPIVOT (value_col FOR pivot_col IN ([c1], [c2], ...)) AS alias
func (*UnpivotTable) String ¶
func (ut *UnpivotTable) String() string
func (*UnpivotTable) TokenLiteral ¶
func (ut *UnpivotTable) TokenLiteral() string
type UpdateStatement ¶
type UpdateStatement struct {
Token token.Token
Top *TopClause
Table *QualifiedIdentifier
TargetFunc *FunctionCall // For UPDATE OPENQUERY(...), UPDATE OPENROWSET(...)
Hints []string
Alias *Identifier
SetClauses []*SetClause
From *FromClause
Where Expression
CurrentOfCursor *Identifier // WHERE CURRENT OF cursor_name
Output *OutputClause
}
UpdateStatement represents an UPDATE statement.
func (*UpdateStatement) String ¶
func (us *UpdateStatement) String() string
func (*UpdateStatement) TokenLiteral ¶
func (us *UpdateStatement) TokenLiteral() string
type UpdateStatisticsStatement ¶
type UpdateStatisticsStatement struct {
Token token.Token
Table *QualifiedIdentifier
StatsName string // Optional specific stats name
WithOptions []string // FULLSCAN, SAMPLE, RESAMPLE, etc.
}
UpdateStatisticsStatement represents UPDATE STATISTICS.
func (*UpdateStatisticsStatement) String ¶
func (us *UpdateStatisticsStatement) String() string
func (*UpdateStatisticsStatement) TokenLiteral ¶
func (us *UpdateStatisticsStatement) TokenLiteral() string
type UseStatement ¶
type UseStatement struct {
Token token.Token
Database *Identifier
}
UseStatement represents a USE database statement.
func (*UseStatement) String ¶
func (us *UseStatement) String() string
func (*UseStatement) TokenLiteral ¶
func (us *UseStatement) TokenLiteral() string
type ValuesTable ¶
type ValuesTable struct {
Token token.Token
Rows [][]Expression // Each row is a list of expressions
Alias *Identifier
Columns []*Identifier // Column names
}
ValuesTable represents VALUES ((row1), (row2), ...) AS alias(columns)
func (*ValuesTable) String ¶
func (vt *ValuesTable) String() string
func (*ValuesTable) TokenLiteral ¶
func (vt *ValuesTable) TokenLiteral() string
type Variable ¶
Variable represents a T-SQL variable (@var or @@globalvar).
func (*Variable) TokenLiteral ¶
type VariableDef ¶
type VariableDef struct {
Name string
DataType *DataType
TableType *TableTypeDefinition // For DECLARE @t TABLE (...)
Value Expression
}
type WaitforStatement ¶
type WaitforStatement struct {
Token token.Token
Type string // "DELAY" or "TIME"
Duration Expression // String literal or variable
}
WaitforStatement represents a WAITFOR DELAY/TIME statement.
func (*WaitforStatement) String ¶
func (ws *WaitforStatement) String() string
func (*WaitforStatement) TokenLiteral ¶
func (ws *WaitforStatement) TokenLiteral() string
type WhenClause ¶
type WhenClause struct {
Condition Expression
Result Expression
}
type WhileStatement ¶
type WhileStatement struct {
Token token.Token
Condition Expression
Body Statement
}
WhileStatement represents a WHILE statement.
func (*WhileStatement) String ¶
func (ws *WhileStatement) String() string
func (*WhileStatement) TokenLiteral ¶
func (ws *WhileStatement) TokenLiteral() string
type WindowDefinition ¶
type WindowDefinition struct {
Name string
Spec *OverClause
}
WindowDefinition represents a named window: WINDOW w AS (PARTITION BY ... ORDER BY ...)
type WindowFrame ¶
type WindowFrame struct {
Type string // ROWS or RANGE
Start *FrameBound
End *FrameBound // nil if not BETWEEN
}
WindowFrame represents a window frame specification (ROWS/RANGE BETWEEN).
func (*WindowFrame) String ¶
func (wf *WindowFrame) String() string
type WithStatement ¶
type WithStatement struct {
Token token.Token
CTEs []*CTEDef
Query Statement // The main query following the CTEs
}
WithStatement represents a WITH (CTE) statement.
func (*WithStatement) String ¶
func (ws *WithStatement) String() string
func (*WithStatement) TokenLiteral ¶
func (ws *WithStatement) TokenLiteral() string
type WithXmlnamespacesStatement ¶
type WithXmlnamespacesStatement struct {
Token token.Token
Namespaces []*XmlNamespaceDef
Query Statement
}
WithXmlnamespacesStatement represents WITH XMLNAMESPACES (...) SELECT ...
func (*WithXmlnamespacesStatement) String ¶
func (w *WithXmlnamespacesStatement) String() string
func (*WithXmlnamespacesStatement) TokenLiteral ¶
func (w *WithXmlnamespacesStatement) TokenLiteral() string
type XmlNamespaceDef ¶
type XmlNamespaceDef struct {
URI string
Prefix string // empty for DEFAULT namespace
IsDefault bool
}
XmlNamespaceDef represents a single namespace declaration
func (*XmlNamespaceDef) String ¶
func (x *XmlNamespaceDef) String() string