From c57f5bc9caad2adf1b0fe8fedc1003e49e272080 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 27 Jun 2020 15:00:38 -0700 Subject: The Great Tuple to Symbol Rename (tm) --- src/wixext/SqlCompiler.cs | 32 +++++++-------- src/wixext/SqlExtensionData.cs | 10 ++--- src/wixext/SqlTableDefinitions.cs | 16 ++++---- src/wixext/Tuples/SqlDatabaseTuple.cs | 70 ++++++++++++++++---------------- src/wixext/Tuples/SqlFileSpecTuple.cs | 52 ++++++++++++------------ src/wixext/Tuples/SqlScriptTuple.cs | 58 +++++++++++++------------- src/wixext/Tuples/SqlStringTuple.cs | 58 +++++++++++++------------- src/wixext/Tuples/SqlTupleDefinitions.cs | 26 ++++++------ 8 files changed, 161 insertions(+), 161 deletions(-) diff --git a/src/wixext/SqlCompiler.cs b/src/wixext/SqlCompiler.cs index 22b533de..2c0f914a 100644 --- a/src/wixext/SqlCompiler.cs +++ b/src/wixext/SqlCompiler.cs @@ -7,7 +7,7 @@ namespace WixToolset.Sql using System.Xml.Linq; using WixToolset.Data; using WixToolset.Extensibility; - using WixToolset.Sql.Tuples; + using WixToolset.Sql.Symbols; /// /// The compiler for the WiX Toolset SQL Server Extension. @@ -319,7 +319,7 @@ namespace WixToolset.Sql if (!this.Messaging.EncounteredError) { - var tuple = section.AddTuple(new SqlDatabaseTuple(sourceLineNumbers, id) + var symbol = section.AddSymbol(new SqlDatabaseSymbol(sourceLineNumbers, id) { Server = server, Instance = instance, @@ -332,7 +332,7 @@ namespace WixToolset.Sql if (0 != attributes) { - tuple.Attributes = attributes; + symbol.Attributes = attributes; } } } @@ -408,7 +408,7 @@ namespace WixToolset.Sql if (!this.Messaging.EncounteredError) { - var tuple = section.AddTuple(new SqlFileSpecTuple(sourceLineNumbers, id) + var symbol = section.AddSymbol(new SqlFileSpecSymbol(sourceLineNumbers, id) { Name = name, Filename = fileName, @@ -416,17 +416,17 @@ namespace WixToolset.Sql if (null != size) { - tuple.Size = size; + symbol.Size = size; } if (null != maxSize) { - tuple.MaxSize = maxSize; + symbol.MaxSize = maxSize; } if (null != growthSize) { - tuple.GrowthSize = growthSize; + symbol.GrowthSize = growthSize; } } @@ -461,7 +461,7 @@ namespace WixToolset.Sql break; case "BinaryKey": binary = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.Binary, binary); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.Binary, binary); break; case "Sequence": sequence = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, short.MaxValue); @@ -472,7 +472,7 @@ namespace WixToolset.Sql this.Messaging.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName, element.Parent.Name.LocalName)); } sqlDb = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SqlTupleDefinitions.SqlDatabase, sqlDb); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SqlSymbolDefinitions.SqlDatabase, sqlDb); break; case "User": user = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); @@ -599,7 +599,7 @@ namespace WixToolset.Sql if (!this.Messaging.EncounteredError) { - var tuple = section.AddTuple(new SqlScriptTuple(sourceLineNumbers, id) + var symbol = section.AddSymbol(new SqlScriptSymbol(sourceLineNumbers, id) { SqlDbRef = sqlDb, ComponentRef = componentId, @@ -610,7 +610,7 @@ namespace WixToolset.Sql if (CompilerConstants.IntegerNotSet != sequence) { - tuple.Sequence = sequence; + symbol.Sequence = sequence; } } } @@ -735,7 +735,7 @@ namespace WixToolset.Sql } sqlDb = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SqlTupleDefinitions.SqlDatabase, sqlDb); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SqlSymbolDefinitions.SqlDatabase, sqlDb); break; case "User": user = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); @@ -779,7 +779,7 @@ namespace WixToolset.Sql if (!this.Messaging.EncounteredError) { - var tuple = section.AddTuple(new SqlStringTuple(sourceLineNumbers, id) + var symbol = section.AddSymbol(new SqlStringSymbol(sourceLineNumbers, id) { SqlDbRef = sqlDb, ComponentRef = componentId, @@ -790,15 +790,15 @@ namespace WixToolset.Sql if (CompilerConstants.IntegerNotSet != sequence) { - tuple.Sequence = sequence; + symbol.Sequence = sequence; } } } private void AddReferenceToInstallSqlData(IntermediateSection section, SourceLineNumber sourceLineNumbers) { - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.CustomAction, "InstallSqlData"); - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.CustomAction, "UninstallSqlData"); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.CustomAction, "InstallSqlData"); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.CustomAction, "UninstallSqlData"); } } } diff --git a/src/wixext/SqlExtensionData.cs b/src/wixext/SqlExtensionData.cs index e27b698f..60de94fe 100644 --- a/src/wixext/SqlExtensionData.cs +++ b/src/wixext/SqlExtensionData.cs @@ -16,15 +16,15 @@ namespace WixToolset.Sql /// The default culture. public override string DefaultCulture => "en-US"; - public override bool TryGetTupleDefinitionByName(string name, out IntermediateTupleDefinition tupleDefinition) + public override bool TryGetSymbolDefinitionByName(string name, out IntermediateSymbolDefinition symbolDefinition) { - tupleDefinition = SqlTupleDefinitions.ByName(name); - return tupleDefinition != null; + symbolDefinition = SqlSymbolDefinitions.ByName(name); + return symbolDefinition != null; } - public override Intermediate GetLibrary(ITupleDefinitionCreator tupleDefinitions) + public override Intermediate GetLibrary(ISymbolDefinitionCreator symbolDefinitions) { - return Intermediate.Load(typeof(SqlExtensionData).Assembly, "WixToolset.Sql.sql.wixlib", tupleDefinitions); + return Intermediate.Load(typeof(SqlExtensionData).Assembly, "WixToolset.Sql.sql.wixlib", symbolDefinitions); } } } diff --git a/src/wixext/SqlTableDefinitions.cs b/src/wixext/SqlTableDefinitions.cs index 3d1daee0..0ab6f989 100644 --- a/src/wixext/SqlTableDefinitions.cs +++ b/src/wixext/SqlTableDefinitions.cs @@ -8,7 +8,7 @@ namespace WixToolset.Sql { public static readonly TableDefinition SqlDatabase = new TableDefinition( "SqlDatabase", - SqlTupleDefinitions.SqlDatabase, + SqlSymbolDefinitions.SqlDatabase, new[] { new ColumnDefinition("SqlDb", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Primary key, non-localized token", modularizeType: ColumnModularizeType.Column), @@ -21,12 +21,12 @@ namespace WixToolset.Sql new ColumnDefinition("FileSpec_Log", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Identifier, keyTable: "SqlFileSpec", keyColumn: 1, description: "Foreign key referencing SqlFileSpec.", modularizeType: ColumnModularizeType.Column), new ColumnDefinition("Attributes", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, minValue: 0, maxValue: 255, description: "1 == create on install, 2 == drop on uninstall, 4 == continue on error, 8 == drop on install, 16 == create on uninstall, 32 == confirm update existing table, 64 == create on reinstall, 128 == drop on reinstall"), }, - tupleIdIsPrimaryKey: true + symbolIdIsPrimaryKey: true ); public static readonly TableDefinition SqlFileSpec = new TableDefinition( "SqlFileSpec", - SqlTupleDefinitions.SqlFileSpec, + SqlSymbolDefinitions.SqlFileSpec, new[] { new ColumnDefinition("FileSpec", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Primary key, non-localized token", modularizeType: ColumnModularizeType.Column), @@ -36,12 +36,12 @@ namespace WixToolset.Sql new ColumnDefinition("MaxSize", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "Maximum size for file", modularizeType: ColumnModularizeType.Property), new ColumnDefinition("GrowthSize", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "Size file should grow when necessary", modularizeType: ColumnModularizeType.Property), }, - tupleIdIsPrimaryKey: true + symbolIdIsPrimaryKey: true ); public static readonly TableDefinition SqlScript = new TableDefinition( "SqlScript", - SqlTupleDefinitions.SqlScript, + SqlSymbolDefinitions.SqlScript, new[] { new ColumnDefinition("Script", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Primary key, non-localized token"), @@ -52,12 +52,12 @@ namespace WixToolset.Sql new ColumnDefinition("Attributes", ColumnType.Number, 2, primaryKey: false, nullable: false, ColumnCategory.Unknown, possibilities: "1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;27;28;29;30;31", description: "1 == execute on install, 2 == execute on uninstall, 4 == continue on error, 8 == rollback on install, 16 == rollback on uninstall"), new ColumnDefinition("Sequence", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "Order to execute SQL Queries in"), }, - tupleIdIsPrimaryKey: true + symbolIdIsPrimaryKey: true ); public static readonly TableDefinition SqlString = new TableDefinition( "SqlString", - SqlTupleDefinitions.SqlString, + SqlSymbolDefinitions.SqlString, new[] { new ColumnDefinition("String", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Id for the SqlString", modularizeType: ColumnModularizeType.Column), @@ -68,7 +68,7 @@ namespace WixToolset.Sql new ColumnDefinition("Attributes", ColumnType.Number, 2, primaryKey: false, nullable: false, ColumnCategory.Unknown, possibilities: "1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;27;28;29;30;31", description: "1 == execute on install, 2 == execute on uninstall, 4 == continue on error, 8 == rollback on install, 16 == rollback on uninstall"), new ColumnDefinition("Sequence", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "Order to execute SQL Queries in"), }, - tupleIdIsPrimaryKey: true + symbolIdIsPrimaryKey: true ); public static readonly TableDefinition[] All = new[] diff --git a/src/wixext/Tuples/SqlDatabaseTuple.cs b/src/wixext/Tuples/SqlDatabaseTuple.cs index 1e056212..6f0820ac 100644 --- a/src/wixext/Tuples/SqlDatabaseTuple.cs +++ b/src/wixext/Tuples/SqlDatabaseTuple.cs @@ -3,32 +3,32 @@ namespace WixToolset.Sql { using WixToolset.Data; - using WixToolset.Sql.Tuples; + using WixToolset.Sql.Symbols; - public static partial class SqlTupleDefinitions + public static partial class SqlSymbolDefinitions { - public static readonly IntermediateTupleDefinition SqlDatabase = new IntermediateTupleDefinition( - SqlTupleDefinitionType.SqlDatabase.ToString(), + public static readonly IntermediateSymbolDefinition SqlDatabase = new IntermediateSymbolDefinition( + SqlSymbolDefinitionType.SqlDatabase.ToString(), new[] { - new IntermediateFieldDefinition(nameof(SqlDatabaseTupleFields.Server), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(SqlDatabaseTupleFields.Instance), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(SqlDatabaseTupleFields.Database), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(SqlDatabaseTupleFields.ComponentRef), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(SqlDatabaseTupleFields.UserRef), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(SqlDatabaseTupleFields.FileSpecRef), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(SqlDatabaseTupleFields.LogFileSpecRef), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(SqlDatabaseTupleFields.Attributes), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(SqlDatabaseSymbolFields.Server), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(SqlDatabaseSymbolFields.Instance), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(SqlDatabaseSymbolFields.Database), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(SqlDatabaseSymbolFields.ComponentRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(SqlDatabaseSymbolFields.UserRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(SqlDatabaseSymbolFields.FileSpecRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(SqlDatabaseSymbolFields.LogFileSpecRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(SqlDatabaseSymbolFields.Attributes), IntermediateFieldType.Number), }, - typeof(SqlDatabaseTuple)); + typeof(SqlDatabaseSymbol)); } } -namespace WixToolset.Sql.Tuples +namespace WixToolset.Sql.Symbols { using WixToolset.Data; - public enum SqlDatabaseTupleFields + public enum SqlDatabaseSymbolFields { Server, Instance, @@ -40,64 +40,64 @@ namespace WixToolset.Sql.Tuples Attributes, } - public class SqlDatabaseTuple : IntermediateTuple + public class SqlDatabaseSymbol : IntermediateSymbol { - public SqlDatabaseTuple() : base(SqlTupleDefinitions.SqlDatabase, null, null) + public SqlDatabaseSymbol() : base(SqlSymbolDefinitions.SqlDatabase, null, null) { } - public SqlDatabaseTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SqlTupleDefinitions.SqlDatabase, sourceLineNumber, id) + public SqlDatabaseSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SqlSymbolDefinitions.SqlDatabase, sourceLineNumber, id) { } - public IntermediateField this[SqlDatabaseTupleFields index] => this.Fields[(int)index]; + public IntermediateField this[SqlDatabaseSymbolFields index] => this.Fields[(int)index]; public string Server { - get => this.Fields[(int)SqlDatabaseTupleFields.Server].AsString(); - set => this.Set((int)SqlDatabaseTupleFields.Server, value); + get => this.Fields[(int)SqlDatabaseSymbolFields.Server].AsString(); + set => this.Set((int)SqlDatabaseSymbolFields.Server, value); } public string Instance { - get => this.Fields[(int)SqlDatabaseTupleFields.Instance].AsString(); - set => this.Set((int)SqlDatabaseTupleFields.Instance, value); + get => this.Fields[(int)SqlDatabaseSymbolFields.Instance].AsString(); + set => this.Set((int)SqlDatabaseSymbolFields.Instance, value); } public string Database { - get => this.Fields[(int)SqlDatabaseTupleFields.Database].AsString(); - set => this.Set((int)SqlDatabaseTupleFields.Database, value); + get => this.Fields[(int)SqlDatabaseSymbolFields.Database].AsString(); + set => this.Set((int)SqlDatabaseSymbolFields.Database, value); } public string ComponentRef { - get => this.Fields[(int)SqlDatabaseTupleFields.ComponentRef].AsString(); - set => this.Set((int)SqlDatabaseTupleFields.ComponentRef, value); + get => this.Fields[(int)SqlDatabaseSymbolFields.ComponentRef].AsString(); + set => this.Set((int)SqlDatabaseSymbolFields.ComponentRef, value); } public string UserRef { - get => this.Fields[(int)SqlDatabaseTupleFields.UserRef].AsString(); - set => this.Set((int)SqlDatabaseTupleFields.UserRef, value); + get => this.Fields[(int)SqlDatabaseSymbolFields.UserRef].AsString(); + set => this.Set((int)SqlDatabaseSymbolFields.UserRef, value); } public string FileSpecRef { - get => this.Fields[(int)SqlDatabaseTupleFields.FileSpecRef].AsString(); - set => this.Set((int)SqlDatabaseTupleFields.FileSpecRef, value); + get => this.Fields[(int)SqlDatabaseSymbolFields.FileSpecRef].AsString(); + set => this.Set((int)SqlDatabaseSymbolFields.FileSpecRef, value); } public string LogFileSpecRef { - get => this.Fields[(int)SqlDatabaseTupleFields.LogFileSpecRef].AsString(); - set => this.Set((int)SqlDatabaseTupleFields.LogFileSpecRef, value); + get => this.Fields[(int)SqlDatabaseSymbolFields.LogFileSpecRef].AsString(); + set => this.Set((int)SqlDatabaseSymbolFields.LogFileSpecRef, value); } public int Attributes { - get => this.Fields[(int)SqlDatabaseTupleFields.Attributes].AsNumber(); - set => this.Set((int)SqlDatabaseTupleFields.Attributes, value); + get => this.Fields[(int)SqlDatabaseSymbolFields.Attributes].AsNumber(); + set => this.Set((int)SqlDatabaseSymbolFields.Attributes, value); } } } \ No newline at end of file diff --git a/src/wixext/Tuples/SqlFileSpecTuple.cs b/src/wixext/Tuples/SqlFileSpecTuple.cs index 98a3002b..d9eecc62 100644 --- a/src/wixext/Tuples/SqlFileSpecTuple.cs +++ b/src/wixext/Tuples/SqlFileSpecTuple.cs @@ -3,29 +3,29 @@ namespace WixToolset.Sql { using WixToolset.Data; - using WixToolset.Sql.Tuples; + using WixToolset.Sql.Symbols; - public static partial class SqlTupleDefinitions + public static partial class SqlSymbolDefinitions { - public static readonly IntermediateTupleDefinition SqlFileSpec = new IntermediateTupleDefinition( - SqlTupleDefinitionType.SqlFileSpec.ToString(), + public static readonly IntermediateSymbolDefinition SqlFileSpec = new IntermediateSymbolDefinition( + SqlSymbolDefinitionType.SqlFileSpec.ToString(), new[] { - new IntermediateFieldDefinition(nameof(SqlFileSpecTupleFields.Name), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(SqlFileSpecTupleFields.Filename), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(SqlFileSpecTupleFields.Size), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(SqlFileSpecTupleFields.MaxSize), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(SqlFileSpecTupleFields.GrowthSize), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(SqlFileSpecSymbolFields.Name), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(SqlFileSpecSymbolFields.Filename), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(SqlFileSpecSymbolFields.Size), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(SqlFileSpecSymbolFields.MaxSize), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(SqlFileSpecSymbolFields.GrowthSize), IntermediateFieldType.String), }, - typeof(SqlFileSpecTuple)); + typeof(SqlFileSpecSymbol)); } } -namespace WixToolset.Sql.Tuples +namespace WixToolset.Sql.Symbols { using WixToolset.Data; - public enum SqlFileSpecTupleFields + public enum SqlFileSpecSymbolFields { Name, Filename, @@ -34,46 +34,46 @@ namespace WixToolset.Sql.Tuples GrowthSize, } - public class SqlFileSpecTuple : IntermediateTuple + public class SqlFileSpecSymbol : IntermediateSymbol { - public SqlFileSpecTuple() : base(SqlTupleDefinitions.SqlFileSpec, null, null) + public SqlFileSpecSymbol() : base(SqlSymbolDefinitions.SqlFileSpec, null, null) { } - public SqlFileSpecTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SqlTupleDefinitions.SqlFileSpec, sourceLineNumber, id) + public SqlFileSpecSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SqlSymbolDefinitions.SqlFileSpec, sourceLineNumber, id) { } - public IntermediateField this[SqlFileSpecTupleFields index] => this.Fields[(int)index]; + public IntermediateField this[SqlFileSpecSymbolFields index] => this.Fields[(int)index]; public string Name { - get => this.Fields[(int)SqlFileSpecTupleFields.Name].AsString(); - set => this.Set((int)SqlFileSpecTupleFields.Name, value); + get => this.Fields[(int)SqlFileSpecSymbolFields.Name].AsString(); + set => this.Set((int)SqlFileSpecSymbolFields.Name, value); } public string Filename { - get => this.Fields[(int)SqlFileSpecTupleFields.Filename].AsString(); - set => this.Set((int)SqlFileSpecTupleFields.Filename, value); + get => this.Fields[(int)SqlFileSpecSymbolFields.Filename].AsString(); + set => this.Set((int)SqlFileSpecSymbolFields.Filename, value); } public string Size { - get => this.Fields[(int)SqlFileSpecTupleFields.Size].AsString(); - set => this.Set((int)SqlFileSpecTupleFields.Size, value); + get => this.Fields[(int)SqlFileSpecSymbolFields.Size].AsString(); + set => this.Set((int)SqlFileSpecSymbolFields.Size, value); } public string MaxSize { - get => this.Fields[(int)SqlFileSpecTupleFields.MaxSize].AsString(); - set => this.Set((int)SqlFileSpecTupleFields.MaxSize, value); + get => this.Fields[(int)SqlFileSpecSymbolFields.MaxSize].AsString(); + set => this.Set((int)SqlFileSpecSymbolFields.MaxSize, value); } public string GrowthSize { - get => this.Fields[(int)SqlFileSpecTupleFields.GrowthSize].AsString(); - set => this.Set((int)SqlFileSpecTupleFields.GrowthSize, value); + get => this.Fields[(int)SqlFileSpecSymbolFields.GrowthSize].AsString(); + set => this.Set((int)SqlFileSpecSymbolFields.GrowthSize, value); } } } \ No newline at end of file diff --git a/src/wixext/Tuples/SqlScriptTuple.cs b/src/wixext/Tuples/SqlScriptTuple.cs index 6e4e484b..94c70390 100644 --- a/src/wixext/Tuples/SqlScriptTuple.cs +++ b/src/wixext/Tuples/SqlScriptTuple.cs @@ -3,30 +3,30 @@ namespace WixToolset.Sql { using WixToolset.Data; - using WixToolset.Sql.Tuples; + using WixToolset.Sql.Symbols; - public static partial class SqlTupleDefinitions + public static partial class SqlSymbolDefinitions { - public static readonly IntermediateTupleDefinition SqlScript = new IntermediateTupleDefinition( - SqlTupleDefinitionType.SqlScript.ToString(), + public static readonly IntermediateSymbolDefinition SqlScript = new IntermediateSymbolDefinition( + SqlSymbolDefinitionType.SqlScript.ToString(), new[] { - new IntermediateFieldDefinition(nameof(SqlScriptTupleFields.SqlDbRef), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(SqlScriptTupleFields.ComponentRef), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(SqlScriptTupleFields.ScriptBinaryRef), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(SqlScriptTupleFields.UserRef), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(SqlScriptTupleFields.Attributes), IntermediateFieldType.Number), - new IntermediateFieldDefinition(nameof(SqlScriptTupleFields.Sequence), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(SqlScriptSymbolFields.SqlDbRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(SqlScriptSymbolFields.ComponentRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(SqlScriptSymbolFields.ScriptBinaryRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(SqlScriptSymbolFields.UserRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(SqlScriptSymbolFields.Attributes), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(SqlScriptSymbolFields.Sequence), IntermediateFieldType.Number), }, - typeof(SqlScriptTuple)); + typeof(SqlScriptSymbol)); } } -namespace WixToolset.Sql.Tuples +namespace WixToolset.Sql.Symbols { using WixToolset.Data; - public enum SqlScriptTupleFields + public enum SqlScriptSymbolFields { SqlDbRef, ComponentRef, @@ -36,52 +36,52 @@ namespace WixToolset.Sql.Tuples Sequence, } - public class SqlScriptTuple : IntermediateTuple + public class SqlScriptSymbol : IntermediateSymbol { - public SqlScriptTuple() : base(SqlTupleDefinitions.SqlScript, null, null) + public SqlScriptSymbol() : base(SqlSymbolDefinitions.SqlScript, null, null) { } - public SqlScriptTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SqlTupleDefinitions.SqlScript, sourceLineNumber, id) + public SqlScriptSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SqlSymbolDefinitions.SqlScript, sourceLineNumber, id) { } - public IntermediateField this[SqlScriptTupleFields index] => this.Fields[(int)index]; + public IntermediateField this[SqlScriptSymbolFields index] => this.Fields[(int)index]; public string SqlDbRef { - get => this.Fields[(int)SqlScriptTupleFields.SqlDbRef].AsString(); - set => this.Set((int)SqlScriptTupleFields.SqlDbRef, value); + get => this.Fields[(int)SqlScriptSymbolFields.SqlDbRef].AsString(); + set => this.Set((int)SqlScriptSymbolFields.SqlDbRef, value); } public string ComponentRef { - get => this.Fields[(int)SqlScriptTupleFields.ComponentRef].AsString(); - set => this.Set((int)SqlScriptTupleFields.ComponentRef, value); + get => this.Fields[(int)SqlScriptSymbolFields.ComponentRef].AsString(); + set => this.Set((int)SqlScriptSymbolFields.ComponentRef, value); } public string ScriptBinaryRef { - get => this.Fields[(int)SqlScriptTupleFields.ScriptBinaryRef].AsString(); - set => this.Set((int)SqlScriptTupleFields.ScriptBinaryRef, value); + get => this.Fields[(int)SqlScriptSymbolFields.ScriptBinaryRef].AsString(); + set => this.Set((int)SqlScriptSymbolFields.ScriptBinaryRef, value); } public string UserRef { - get => this.Fields[(int)SqlScriptTupleFields.UserRef].AsString(); - set => this.Set((int)SqlScriptTupleFields.UserRef, value); + get => this.Fields[(int)SqlScriptSymbolFields.UserRef].AsString(); + set => this.Set((int)SqlScriptSymbolFields.UserRef, value); } public int Attributes { - get => this.Fields[(int)SqlScriptTupleFields.Attributes].AsNumber(); - set => this.Set((int)SqlScriptTupleFields.Attributes, value); + get => this.Fields[(int)SqlScriptSymbolFields.Attributes].AsNumber(); + set => this.Set((int)SqlScriptSymbolFields.Attributes, value); } public int? Sequence { - get => this.Fields[(int)SqlScriptTupleFields.Sequence].AsNullableNumber(); - set => this.Set((int)SqlScriptTupleFields.Sequence, value); + get => this.Fields[(int)SqlScriptSymbolFields.Sequence].AsNullableNumber(); + set => this.Set((int)SqlScriptSymbolFields.Sequence, value); } } } \ No newline at end of file diff --git a/src/wixext/Tuples/SqlStringTuple.cs b/src/wixext/Tuples/SqlStringTuple.cs index 7a73f271..73a8206e 100644 --- a/src/wixext/Tuples/SqlStringTuple.cs +++ b/src/wixext/Tuples/SqlStringTuple.cs @@ -3,30 +3,30 @@ namespace WixToolset.Sql { using WixToolset.Data; - using WixToolset.Sql.Tuples; + using WixToolset.Sql.Symbols; - public static partial class SqlTupleDefinitions + public static partial class SqlSymbolDefinitions { - public static readonly IntermediateTupleDefinition SqlString = new IntermediateTupleDefinition( - SqlTupleDefinitionType.SqlString.ToString(), + public static readonly IntermediateSymbolDefinition SqlString = new IntermediateSymbolDefinition( + SqlSymbolDefinitionType.SqlString.ToString(), new[] { - new IntermediateFieldDefinition(nameof(SqlStringTupleFields.SqlDbRef), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(SqlStringTupleFields.ComponentRef), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(SqlStringTupleFields.SQL), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(SqlStringTupleFields.UserRef), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(SqlStringTupleFields.Attributes), IntermediateFieldType.Number), - new IntermediateFieldDefinition(nameof(SqlStringTupleFields.Sequence), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(SqlStringSymbolFields.SqlDbRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(SqlStringSymbolFields.ComponentRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(SqlStringSymbolFields.SQL), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(SqlStringSymbolFields.UserRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(SqlStringSymbolFields.Attributes), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(SqlStringSymbolFields.Sequence), IntermediateFieldType.Number), }, - typeof(SqlStringTuple)); + typeof(SqlStringSymbol)); } } -namespace WixToolset.Sql.Tuples +namespace WixToolset.Sql.Symbols { using WixToolset.Data; - public enum SqlStringTupleFields + public enum SqlStringSymbolFields { SqlDbRef, ComponentRef, @@ -36,52 +36,52 @@ namespace WixToolset.Sql.Tuples Sequence, } - public class SqlStringTuple : IntermediateTuple + public class SqlStringSymbol : IntermediateSymbol { - public SqlStringTuple() : base(SqlTupleDefinitions.SqlString, null, null) + public SqlStringSymbol() : base(SqlSymbolDefinitions.SqlString, null, null) { } - public SqlStringTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SqlTupleDefinitions.SqlString, sourceLineNumber, id) + public SqlStringSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SqlSymbolDefinitions.SqlString, sourceLineNumber, id) { } - public IntermediateField this[SqlStringTupleFields index] => this.Fields[(int)index]; + public IntermediateField this[SqlStringSymbolFields index] => this.Fields[(int)index]; public string SqlDbRef { - get => this.Fields[(int)SqlStringTupleFields.SqlDbRef].AsString(); - set => this.Set((int)SqlStringTupleFields.SqlDbRef, value); + get => this.Fields[(int)SqlStringSymbolFields.SqlDbRef].AsString(); + set => this.Set((int)SqlStringSymbolFields.SqlDbRef, value); } public string ComponentRef { - get => this.Fields[(int)SqlStringTupleFields.ComponentRef].AsString(); - set => this.Set((int)SqlStringTupleFields.ComponentRef, value); + get => this.Fields[(int)SqlStringSymbolFields.ComponentRef].AsString(); + set => this.Set((int)SqlStringSymbolFields.ComponentRef, value); } public string SQL { - get => this.Fields[(int)SqlStringTupleFields.SQL].AsString(); - set => this.Set((int)SqlStringTupleFields.SQL, value); + get => this.Fields[(int)SqlStringSymbolFields.SQL].AsString(); + set => this.Set((int)SqlStringSymbolFields.SQL, value); } public string UserRef { - get => this.Fields[(int)SqlStringTupleFields.UserRef].AsString(); - set => this.Set((int)SqlStringTupleFields.UserRef, value); + get => this.Fields[(int)SqlStringSymbolFields.UserRef].AsString(); + set => this.Set((int)SqlStringSymbolFields.UserRef, value); } public int Attributes { - get => this.Fields[(int)SqlStringTupleFields.Attributes].AsNumber(); - set => this.Set((int)SqlStringTupleFields.Attributes, value); + get => this.Fields[(int)SqlStringSymbolFields.Attributes].AsNumber(); + set => this.Set((int)SqlStringSymbolFields.Attributes, value); } public int? Sequence { - get => this.Fields[(int)SqlStringTupleFields.Sequence].AsNullableNumber(); - set => this.Set((int)SqlStringTupleFields.Sequence, value); + get => this.Fields[(int)SqlStringSymbolFields.Sequence].AsNullableNumber(); + set => this.Set((int)SqlStringSymbolFields.Sequence, value); } } } \ No newline at end of file diff --git a/src/wixext/Tuples/SqlTupleDefinitions.cs b/src/wixext/Tuples/SqlTupleDefinitions.cs index b99b96a7..336f1546 100644 --- a/src/wixext/Tuples/SqlTupleDefinitions.cs +++ b/src/wixext/Tuples/SqlTupleDefinitions.cs @@ -5,7 +5,7 @@ namespace WixToolset.Sql using System; using WixToolset.Data; - public enum SqlTupleDefinitionType + public enum SqlSymbolDefinitionType { SqlDatabase, SqlFileSpec, @@ -13,13 +13,13 @@ namespace WixToolset.Sql SqlString, } - public static partial class SqlTupleDefinitions + public static partial class SqlSymbolDefinitions { public static readonly Version Version = new Version("4.0.0"); - public static IntermediateTupleDefinition ByName(string name) + public static IntermediateSymbolDefinition ByName(string name) { - if (!Enum.TryParse(name, out SqlTupleDefinitionType type)) + if (!Enum.TryParse(name, out SqlSymbolDefinitionType type)) { return null; } @@ -27,21 +27,21 @@ namespace WixToolset.Sql return ByType(type); } - public static IntermediateTupleDefinition ByType(SqlTupleDefinitionType type) + public static IntermediateSymbolDefinition ByType(SqlSymbolDefinitionType type) { switch (type) { - case SqlTupleDefinitionType.SqlDatabase: - return SqlTupleDefinitions.SqlDatabase; + case SqlSymbolDefinitionType.SqlDatabase: + return SqlSymbolDefinitions.SqlDatabase; - case SqlTupleDefinitionType.SqlFileSpec: - return SqlTupleDefinitions.SqlFileSpec; + case SqlSymbolDefinitionType.SqlFileSpec: + return SqlSymbolDefinitions.SqlFileSpec; - case SqlTupleDefinitionType.SqlScript: - return SqlTupleDefinitions.SqlScript; + case SqlSymbolDefinitionType.SqlScript: + return SqlSymbolDefinitions.SqlScript; - case SqlTupleDefinitionType.SqlString: - return SqlTupleDefinitions.SqlString; + case SqlSymbolDefinitionType.SqlString: + return SqlSymbolDefinitions.SqlString; default: throw new ArgumentOutOfRangeException(nameof(type)); -- cgit v1.2.3-55-g6feb