@@ -186,6 +186,16 @@ func statementToJSON(stmt ast.Statement) jsonNode {
186186 return dropWorkloadGroupStatementToJSON (s )
187187 case * ast.DropWorkloadClassifierStatement :
188188 return dropWorkloadClassifierStatementToJSON (s )
189+ case * ast.CreateWorkloadGroupStatement :
190+ return createWorkloadGroupStatementToJSON (s )
191+ case * ast.AlterWorkloadGroupStatement :
192+ return alterWorkloadGroupStatementToJSON (s )
193+ case * ast.AlterSequenceStatement :
194+ return alterSequenceStatementToJSON (s )
195+ case * ast.CreateSequenceStatement :
196+ return createSequenceStatementToJSON (s )
197+ case * ast.DbccStatement :
198+ return dbccStatementToJSON (s )
189199 case * ast.DropTypeStatement :
190200 return dropTypeStatementToJSON (s )
191201 case * ast.DropAggregateStatement :
@@ -2721,11 +2731,23 @@ func dataTypeReferenceToJSON(d ast.DataTypeReference) jsonNode {
27212731 return sqlDataTypeReferenceToJSON (dt )
27222732 case * ast.XmlDataTypeReference :
27232733 return xmlDataTypeReferenceToJSON (dt )
2734+ case * ast.UserDataTypeReference :
2735+ return userDataTypeReferenceToJSON (dt )
27242736 default :
27252737 return jsonNode {"$type" : "UnknownDataType" }
27262738 }
27272739}
27282740
2741+ func userDataTypeReferenceToJSON (dt * ast.UserDataTypeReference ) jsonNode {
2742+ node := jsonNode {
2743+ "$type" : "UserDataTypeReference" ,
2744+ }
2745+ if dt .Name != nil {
2746+ node ["Name" ] = schemaObjectNameToJSON (dt .Name )
2747+ }
2748+ return node
2749+ }
2750+
27292751func xmlDataTypeReferenceToJSON (dt * ast.XmlDataTypeReference ) jsonNode {
27302752 node := jsonNode {
27312753 "$type" : "XmlDataTypeReference" ,
@@ -5504,6 +5526,188 @@ func dropWorkloadClassifierStatementToJSON(s *ast.DropWorkloadClassifierStatemen
55045526 return node
55055527}
55065528
5529+ func createWorkloadGroupStatementToJSON (s * ast.CreateWorkloadGroupStatement ) jsonNode {
5530+ node := jsonNode {
5531+ "$type" : "CreateWorkloadGroupStatement" ,
5532+ }
5533+ if s .Name != nil {
5534+ node ["Name" ] = identifierToJSON (s .Name )
5535+ }
5536+ if len (s .WorkloadGroupParameters ) > 0 {
5537+ params := make ([]jsonNode , len (s .WorkloadGroupParameters ))
5538+ for i , p := range s .WorkloadGroupParameters {
5539+ params [i ] = workloadGroupParameterToJSON (p )
5540+ }
5541+ node ["WorkloadGroupParameters" ] = params
5542+ }
5543+ if s .PoolName != nil {
5544+ node ["PoolName" ] = identifierToJSON (s .PoolName )
5545+ }
5546+ if s .ExternalPoolName != nil {
5547+ node ["ExternalPoolName" ] = identifierToJSON (s .ExternalPoolName )
5548+ }
5549+ return node
5550+ }
5551+
5552+ func alterWorkloadGroupStatementToJSON (s * ast.AlterWorkloadGroupStatement ) jsonNode {
5553+ node := jsonNode {
5554+ "$type" : "AlterWorkloadGroupStatement" ,
5555+ }
5556+ if s .Name != nil {
5557+ node ["Name" ] = identifierToJSON (s .Name )
5558+ }
5559+ if len (s .WorkloadGroupParameters ) > 0 {
5560+ params := make ([]jsonNode , len (s .WorkloadGroupParameters ))
5561+ for i , p := range s .WorkloadGroupParameters {
5562+ params [i ] = workloadGroupParameterToJSON (p )
5563+ }
5564+ node ["WorkloadGroupParameters" ] = params
5565+ }
5566+ if s .PoolName != nil {
5567+ node ["PoolName" ] = identifierToJSON (s .PoolName )
5568+ }
5569+ if s .ExternalPoolName != nil {
5570+ node ["ExternalPoolName" ] = identifierToJSON (s .ExternalPoolName )
5571+ }
5572+ return node
5573+ }
5574+
5575+ func workloadGroupParameterToJSON (p interface {}) jsonNode {
5576+ switch param := p .(type ) {
5577+ case * ast.WorkloadGroupResourceParameter :
5578+ node := jsonNode {
5579+ "$type" : "WorkloadGroupResourceParameter" ,
5580+ "ParameterType" : param .ParameterType ,
5581+ }
5582+ if param .ParameterValue != nil {
5583+ node ["ParameterValue" ] = scalarExpressionToJSON (param .ParameterValue )
5584+ }
5585+ return node
5586+ case * ast.WorkloadGroupImportanceParameter :
5587+ return jsonNode {
5588+ "$type" : "WorkloadGroupImportanceParameter" ,
5589+ "ParameterType" : param .ParameterType ,
5590+ "ParameterValue" : param .ParameterValue ,
5591+ }
5592+ default :
5593+ return jsonNode {}
5594+ }
5595+ }
5596+
5597+ func alterSequenceStatementToJSON (s * ast.AlterSequenceStatement ) jsonNode {
5598+ node := jsonNode {
5599+ "$type" : "AlterSequenceStatement" ,
5600+ }
5601+ if s .Name != nil {
5602+ node ["Name" ] = schemaObjectNameToJSON (s .Name )
5603+ }
5604+ if len (s .SequenceOptions ) > 0 {
5605+ opts := make ([]jsonNode , len (s .SequenceOptions ))
5606+ for i , opt := range s .SequenceOptions {
5607+ opts [i ] = sequenceOptionToJSON (opt )
5608+ }
5609+ node ["SequenceOptions" ] = opts
5610+ }
5611+ return node
5612+ }
5613+
5614+ func createSequenceStatementToJSON (s * ast.CreateSequenceStatement ) jsonNode {
5615+ node := jsonNode {
5616+ "$type" : "CreateSequenceStatement" ,
5617+ }
5618+ if s .Name != nil {
5619+ node ["Name" ] = schemaObjectNameToJSON (s .Name )
5620+ }
5621+ if len (s .SequenceOptions ) > 0 {
5622+ opts := make ([]jsonNode , len (s .SequenceOptions ))
5623+ for i , opt := range s .SequenceOptions {
5624+ opts [i ] = sequenceOptionToJSON (opt )
5625+ }
5626+ node ["SequenceOptions" ] = opts
5627+ }
5628+ return node
5629+ }
5630+
5631+ func sequenceOptionToJSON (opt interface {}) jsonNode {
5632+ switch o := opt .(type ) {
5633+ case * ast.SequenceOption :
5634+ return jsonNode {
5635+ "$type" : "SequenceOption" ,
5636+ "OptionKind" : o .OptionKind ,
5637+ "NoValue" : o .NoValue ,
5638+ }
5639+ case * ast.ScalarExpressionSequenceOption :
5640+ node := jsonNode {
5641+ "$type" : "ScalarExpressionSequenceOption" ,
5642+ "OptionKind" : o .OptionKind ,
5643+ "NoValue" : o .NoValue ,
5644+ }
5645+ if o .OptionValue != nil {
5646+ node ["OptionValue" ] = scalarExpressionToJSON (o .OptionValue )
5647+ }
5648+ return node
5649+ case * ast.DataTypeSequenceOption :
5650+ node := jsonNode {
5651+ "$type" : "DataTypeSequenceOption" ,
5652+ "OptionKind" : o .OptionKind ,
5653+ "NoValue" : o .NoValue ,
5654+ }
5655+ if o .DataType != nil {
5656+ node ["DataType" ] = dataTypeReferenceToJSON (o .DataType )
5657+ }
5658+ return node
5659+ default :
5660+ return jsonNode {}
5661+ }
5662+ }
5663+
5664+ func dbccStatementToJSON (s * ast.DbccStatement ) jsonNode {
5665+ node := jsonNode {
5666+ "$type" : "DbccStatement" ,
5667+ "Command" : s .Command ,
5668+ "ParenthesisRequired" : s .ParenthesisRequired ,
5669+ "OptionsUseJoin" : s .OptionsUseJoin ,
5670+ }
5671+ if s .DllName != "" {
5672+ node ["DllName" ] = s .DllName
5673+ }
5674+ if len (s .Literals ) > 0 {
5675+ lits := make ([]jsonNode , len (s .Literals ))
5676+ for i , lit := range s .Literals {
5677+ lits [i ] = dbccNamedLiteralToJSON (lit )
5678+ }
5679+ node ["Literals" ] = lits
5680+ }
5681+ if len (s .Options ) > 0 {
5682+ opts := make ([]jsonNode , len (s .Options ))
5683+ for i , opt := range s .Options {
5684+ opts [i ] = dbccOptionToJSON (opt )
5685+ }
5686+ node ["Options" ] = opts
5687+ }
5688+ return node
5689+ }
5690+
5691+ func dbccNamedLiteralToJSON (l * ast.DbccNamedLiteral ) jsonNode {
5692+ node := jsonNode {
5693+ "$type" : "DbccNamedLiteral" ,
5694+ }
5695+ if l .Name != "" {
5696+ node ["Name" ] = l .Name
5697+ }
5698+ if l .Value != nil {
5699+ node ["Value" ] = scalarExpressionToJSON (l .Value )
5700+ }
5701+ return node
5702+ }
5703+
5704+ func dbccOptionToJSON (o * ast.DbccOption ) jsonNode {
5705+ return jsonNode {
5706+ "$type" : "DbccOption" ,
5707+ "OptionKind" : o .OptionKind ,
5708+ }
5709+ }
5710+
55075711func dropTypeStatementToJSON (s * ast.DropTypeStatement ) jsonNode {
55085712 node := jsonNode {
55095713 "$type" : "DropTypeStatement" ,
0 commit comments