From 2df59141a12979c9869ad2e62d01e9f7432e2f7c Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Mon, 6 Apr 2020 09:06:53 +1000 Subject: Modernize SqlCompiler and tuples. --- src/wixext/Tuples/SqlDatabaseTuple.cs | 48 +++++++++++++++-------------------- src/wixext/Tuples/SqlFileSpecTuple.cs | 8 ------ src/wixext/Tuples/SqlScriptTuple.cs | 48 +++++++++++++++-------------------- src/wixext/Tuples/SqlStringTuple.cs | 38 +++++++++++---------------- 4 files changed, 55 insertions(+), 87 deletions(-) (limited to 'src/wixext/Tuples') diff --git a/src/wixext/Tuples/SqlDatabaseTuple.cs b/src/wixext/Tuples/SqlDatabaseTuple.cs index fd107690..1e056212 100644 --- a/src/wixext/Tuples/SqlDatabaseTuple.cs +++ b/src/wixext/Tuples/SqlDatabaseTuple.cs @@ -11,14 +11,13 @@ namespace WixToolset.Sql SqlTupleDefinitionType.SqlDatabase.ToString(), new[] { - new IntermediateFieldDefinition(nameof(SqlDatabaseTupleFields.SqlDb), IntermediateFieldType.String), 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.Component_), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(SqlDatabaseTupleFields.User_), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(SqlDatabaseTupleFields.FileSpec_), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(SqlDatabaseTupleFields.FileSpec_Log), 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), }, typeof(SqlDatabaseTuple)); @@ -31,14 +30,13 @@ namespace WixToolset.Sql.Tuples public enum SqlDatabaseTupleFields { - SqlDb, Server, Instance, Database, - Component_, - User_, - FileSpec_, - FileSpec_Log, + ComponentRef, + UserRef, + FileSpecRef, + LogFileSpecRef, Attributes, } @@ -54,12 +52,6 @@ namespace WixToolset.Sql.Tuples public IntermediateField this[SqlDatabaseTupleFields index] => this.Fields[(int)index]; - public string SqlDb - { - get => this.Fields[(int)SqlDatabaseTupleFields.SqlDb].AsString(); - set => this.Set((int)SqlDatabaseTupleFields.SqlDb, value); - } - public string Server { get => this.Fields[(int)SqlDatabaseTupleFields.Server].AsString(); @@ -78,28 +70,28 @@ namespace WixToolset.Sql.Tuples set => this.Set((int)SqlDatabaseTupleFields.Database, value); } - public string Component_ + public string ComponentRef { - get => this.Fields[(int)SqlDatabaseTupleFields.Component_].AsString(); - set => this.Set((int)SqlDatabaseTupleFields.Component_, value); + get => this.Fields[(int)SqlDatabaseTupleFields.ComponentRef].AsString(); + set => this.Set((int)SqlDatabaseTupleFields.ComponentRef, value); } - public string User_ + public string UserRef { - get => this.Fields[(int)SqlDatabaseTupleFields.User_].AsString(); - set => this.Set((int)SqlDatabaseTupleFields.User_, value); + get => this.Fields[(int)SqlDatabaseTupleFields.UserRef].AsString(); + set => this.Set((int)SqlDatabaseTupleFields.UserRef, value); } - public string FileSpec_ + public string FileSpecRef { - get => this.Fields[(int)SqlDatabaseTupleFields.FileSpec_].AsString(); - set => this.Set((int)SqlDatabaseTupleFields.FileSpec_, value); + get => this.Fields[(int)SqlDatabaseTupleFields.FileSpecRef].AsString(); + set => this.Set((int)SqlDatabaseTupleFields.FileSpecRef, value); } - public string FileSpec_Log + public string LogFileSpecRef { - get => this.Fields[(int)SqlDatabaseTupleFields.FileSpec_Log].AsString(); - set => this.Set((int)SqlDatabaseTupleFields.FileSpec_Log, value); + get => this.Fields[(int)SqlDatabaseTupleFields.LogFileSpecRef].AsString(); + set => this.Set((int)SqlDatabaseTupleFields.LogFileSpecRef, value); } public int Attributes diff --git a/src/wixext/Tuples/SqlFileSpecTuple.cs b/src/wixext/Tuples/SqlFileSpecTuple.cs index 9813ec83..98a3002b 100644 --- a/src/wixext/Tuples/SqlFileSpecTuple.cs +++ b/src/wixext/Tuples/SqlFileSpecTuple.cs @@ -11,7 +11,6 @@ namespace WixToolset.Sql SqlTupleDefinitionType.SqlFileSpec.ToString(), new[] { - new IntermediateFieldDefinition(nameof(SqlFileSpecTupleFields.FileSpec), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(SqlFileSpecTupleFields.Name), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(SqlFileSpecTupleFields.Filename), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(SqlFileSpecTupleFields.Size), IntermediateFieldType.String), @@ -28,7 +27,6 @@ namespace WixToolset.Sql.Tuples public enum SqlFileSpecTupleFields { - FileSpec, Name, Filename, Size, @@ -48,12 +46,6 @@ namespace WixToolset.Sql.Tuples public IntermediateField this[SqlFileSpecTupleFields index] => this.Fields[(int)index]; - public string FileSpec - { - get => this.Fields[(int)SqlFileSpecTupleFields.FileSpec].AsString(); - set => this.Set((int)SqlFileSpecTupleFields.FileSpec, value); - } - public string Name { get => this.Fields[(int)SqlFileSpecTupleFields.Name].AsString(); diff --git a/src/wixext/Tuples/SqlScriptTuple.cs b/src/wixext/Tuples/SqlScriptTuple.cs index b1f95709..de76d49d 100644 --- a/src/wixext/Tuples/SqlScriptTuple.cs +++ b/src/wixext/Tuples/SqlScriptTuple.cs @@ -11,11 +11,10 @@ namespace WixToolset.Sql SqlTupleDefinitionType.SqlScript.ToString(), new[] { - new IntermediateFieldDefinition(nameof(SqlScriptTupleFields.Script), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(SqlScriptTupleFields.SqlDb_), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(SqlScriptTupleFields.Component_), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(SqlScriptTupleFields.ScriptBinary_), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(SqlScriptTupleFields.User_), IntermediateFieldType.String), + 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), }, @@ -29,11 +28,10 @@ namespace WixToolset.Sql.Tuples public enum SqlScriptTupleFields { - Script, - SqlDb_, - Component_, - ScriptBinary_, - User_, + SqlDbRef, + ComponentRef, + ScriptBinaryRef, + UserRef, Attributes, Sequence, } @@ -50,34 +48,28 @@ namespace WixToolset.Sql.Tuples public IntermediateField this[SqlScriptTupleFields index] => this.Fields[(int)index]; - public string Script + public string SqlDbRef { - get => this.Fields[(int)SqlScriptTupleFields.Script].AsString(); - set => this.Set((int)SqlScriptTupleFields.Script, value); + get => this.Fields[(int)SqlScriptTupleFields.SqlDbRef].AsString(); + set => this.Set((int)SqlScriptTupleFields.SqlDbRef, value); } - public string SqlDb_ + public string ComponentRef { - get => this.Fields[(int)SqlScriptTupleFields.SqlDb_].AsString(); - set => this.Set((int)SqlScriptTupleFields.SqlDb_, value); + get => this.Fields[(int)SqlScriptTupleFields.ComponentRef].AsString(); + set => this.Set((int)SqlScriptTupleFields.ComponentRef, value); } - public string Component_ + public string ScriptBinaryRef { - get => this.Fields[(int)SqlScriptTupleFields.Component_].AsString(); - set => this.Set((int)SqlScriptTupleFields.Component_, value); + get => this.Fields[(int)SqlScriptTupleFields.ScriptBinaryRef].AsString(); + set => this.Set((int)SqlScriptTupleFields.ScriptBinaryRef, value); } - public string ScriptBinary_ + public string UserRef { - get => this.Fields[(int)SqlScriptTupleFields.ScriptBinary_].AsString(); - set => this.Set((int)SqlScriptTupleFields.ScriptBinary_, value); - } - - public string User_ - { - get => this.Fields[(int)SqlScriptTupleFields.User_].AsString(); - set => this.Set((int)SqlScriptTupleFields.User_, value); + get => this.Fields[(int)SqlScriptTupleFields.UserRef].AsString(); + set => this.Set((int)SqlScriptTupleFields.UserRef, value); } public int Attributes diff --git a/src/wixext/Tuples/SqlStringTuple.cs b/src/wixext/Tuples/SqlStringTuple.cs index d2cba0e0..77882d33 100644 --- a/src/wixext/Tuples/SqlStringTuple.cs +++ b/src/wixext/Tuples/SqlStringTuple.cs @@ -11,11 +11,10 @@ namespace WixToolset.Sql SqlTupleDefinitionType.SqlString.ToString(), new[] { - new IntermediateFieldDefinition(nameof(SqlStringTupleFields.String), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(SqlStringTupleFields.SqlDb_), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(SqlStringTupleFields.Component_), IntermediateFieldType.String), + 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.User_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(SqlStringTupleFields.UserRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(SqlStringTupleFields.Attributes), IntermediateFieldType.Number), new IntermediateFieldDefinition(nameof(SqlStringTupleFields.Sequence), IntermediateFieldType.Number), }, @@ -29,11 +28,10 @@ namespace WixToolset.Sql.Tuples public enum SqlStringTupleFields { - String, - SqlDb_, - Component_, + SqlDbRef, + ComponentRef, SQL, - User_, + UserRef, Attributes, Sequence, } @@ -50,22 +48,16 @@ namespace WixToolset.Sql.Tuples public IntermediateField this[SqlStringTupleFields index] => this.Fields[(int)index]; - public string String + public string SqlDbRef { - get => this.Fields[(int)SqlStringTupleFields.String].AsString(); - set => this.Set((int)SqlStringTupleFields.String, value); + get => this.Fields[(int)SqlStringTupleFields.SqlDbRef].AsString(); + set => this.Set((int)SqlStringTupleFields.SqlDbRef, value); } - public string SqlDb_ + public string ComponentRef { - get => this.Fields[(int)SqlStringTupleFields.SqlDb_].AsString(); - set => this.Set((int)SqlStringTupleFields.SqlDb_, value); - } - - public string Component_ - { - get => this.Fields[(int)SqlStringTupleFields.Component_].AsString(); - set => this.Set((int)SqlStringTupleFields.Component_, value); + get => this.Fields[(int)SqlStringTupleFields.ComponentRef].AsString(); + set => this.Set((int)SqlStringTupleFields.ComponentRef, value); } public string SQL @@ -74,10 +66,10 @@ namespace WixToolset.Sql.Tuples set => this.Set((int)SqlStringTupleFields.SQL, value); } - public string User_ + public string UserRef { - get => this.Fields[(int)SqlStringTupleFields.User_].AsString(); - set => this.Set((int)SqlStringTupleFields.User_, value); + get => this.Fields[(int)SqlStringTupleFields.UserRef].AsString(); + set => this.Set((int)SqlStringTupleFields.UserRef, value); } public int Attributes -- cgit v1.2.3-55-g6feb