aboutsummaryrefslogtreecommitdiff
path: root/src/wixext/Symbols
diff options
context:
space:
mode:
Diffstat (limited to 'src/wixext/Symbols')
-rw-r--r--src/wixext/Symbols/SqlDatabaseSymbol.cs103
-rw-r--r--src/wixext/Symbols/SqlFileSpecSymbol.cs79
-rw-r--r--src/wixext/Symbols/SqlScriptSymbol.cs87
-rw-r--r--src/wixext/Symbols/SqlStringSymbol.cs87
-rw-r--r--src/wixext/Symbols/SqlSymbolDefinitions.cs51
5 files changed, 407 insertions, 0 deletions
diff --git a/src/wixext/Symbols/SqlDatabaseSymbol.cs b/src/wixext/Symbols/SqlDatabaseSymbol.cs
new file mode 100644
index 00000000..6f0820ac
--- /dev/null
+++ b/src/wixext/Symbols/SqlDatabaseSymbol.cs
@@ -0,0 +1,103 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Sql
4{
5 using WixToolset.Data;
6 using WixToolset.Sql.Symbols;
7
8 public static partial class SqlSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition SqlDatabase = new IntermediateSymbolDefinition(
11 SqlSymbolDefinitionType.SqlDatabase.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(SqlDatabaseSymbolFields.Server), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(SqlDatabaseSymbolFields.Instance), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(SqlDatabaseSymbolFields.Database), IntermediateFieldType.String),
17 new IntermediateFieldDefinition(nameof(SqlDatabaseSymbolFields.ComponentRef), IntermediateFieldType.String),
18 new IntermediateFieldDefinition(nameof(SqlDatabaseSymbolFields.UserRef), IntermediateFieldType.String),
19 new IntermediateFieldDefinition(nameof(SqlDatabaseSymbolFields.FileSpecRef), IntermediateFieldType.String),
20 new IntermediateFieldDefinition(nameof(SqlDatabaseSymbolFields.LogFileSpecRef), IntermediateFieldType.String),
21 new IntermediateFieldDefinition(nameof(SqlDatabaseSymbolFields.Attributes), IntermediateFieldType.Number),
22 },
23 typeof(SqlDatabaseSymbol));
24 }
25}
26
27namespace WixToolset.Sql.Symbols
28{
29 using WixToolset.Data;
30
31 public enum SqlDatabaseSymbolFields
32 {
33 Server,
34 Instance,
35 Database,
36 ComponentRef,
37 UserRef,
38 FileSpecRef,
39 LogFileSpecRef,
40 Attributes,
41 }
42
43 public class SqlDatabaseSymbol : IntermediateSymbol
44 {
45 public SqlDatabaseSymbol() : base(SqlSymbolDefinitions.SqlDatabase, null, null)
46 {
47 }
48
49 public SqlDatabaseSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SqlSymbolDefinitions.SqlDatabase, sourceLineNumber, id)
50 {
51 }
52
53 public IntermediateField this[SqlDatabaseSymbolFields index] => this.Fields[(int)index];
54
55 public string Server
56 {
57 get => this.Fields[(int)SqlDatabaseSymbolFields.Server].AsString();
58 set => this.Set((int)SqlDatabaseSymbolFields.Server, value);
59 }
60
61 public string Instance
62 {
63 get => this.Fields[(int)SqlDatabaseSymbolFields.Instance].AsString();
64 set => this.Set((int)SqlDatabaseSymbolFields.Instance, value);
65 }
66
67 public string Database
68 {
69 get => this.Fields[(int)SqlDatabaseSymbolFields.Database].AsString();
70 set => this.Set((int)SqlDatabaseSymbolFields.Database, value);
71 }
72
73 public string ComponentRef
74 {
75 get => this.Fields[(int)SqlDatabaseSymbolFields.ComponentRef].AsString();
76 set => this.Set((int)SqlDatabaseSymbolFields.ComponentRef, value);
77 }
78
79 public string UserRef
80 {
81 get => this.Fields[(int)SqlDatabaseSymbolFields.UserRef].AsString();
82 set => this.Set((int)SqlDatabaseSymbolFields.UserRef, value);
83 }
84
85 public string FileSpecRef
86 {
87 get => this.Fields[(int)SqlDatabaseSymbolFields.FileSpecRef].AsString();
88 set => this.Set((int)SqlDatabaseSymbolFields.FileSpecRef, value);
89 }
90
91 public string LogFileSpecRef
92 {
93 get => this.Fields[(int)SqlDatabaseSymbolFields.LogFileSpecRef].AsString();
94 set => this.Set((int)SqlDatabaseSymbolFields.LogFileSpecRef, value);
95 }
96
97 public int Attributes
98 {
99 get => this.Fields[(int)SqlDatabaseSymbolFields.Attributes].AsNumber();
100 set => this.Set((int)SqlDatabaseSymbolFields.Attributes, value);
101 }
102 }
103} \ No newline at end of file
diff --git a/src/wixext/Symbols/SqlFileSpecSymbol.cs b/src/wixext/Symbols/SqlFileSpecSymbol.cs
new file mode 100644
index 00000000..d9eecc62
--- /dev/null
+++ b/src/wixext/Symbols/SqlFileSpecSymbol.cs
@@ -0,0 +1,79 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Sql
4{
5 using WixToolset.Data;
6 using WixToolset.Sql.Symbols;
7
8 public static partial class SqlSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition SqlFileSpec = new IntermediateSymbolDefinition(
11 SqlSymbolDefinitionType.SqlFileSpec.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(SqlFileSpecSymbolFields.Name), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(SqlFileSpecSymbolFields.Filename), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(SqlFileSpecSymbolFields.Size), IntermediateFieldType.String),
17 new IntermediateFieldDefinition(nameof(SqlFileSpecSymbolFields.MaxSize), IntermediateFieldType.String),
18 new IntermediateFieldDefinition(nameof(SqlFileSpecSymbolFields.GrowthSize), IntermediateFieldType.String),
19 },
20 typeof(SqlFileSpecSymbol));
21 }
22}
23
24namespace WixToolset.Sql.Symbols
25{
26 using WixToolset.Data;
27
28 public enum SqlFileSpecSymbolFields
29 {
30 Name,
31 Filename,
32 Size,
33 MaxSize,
34 GrowthSize,
35 }
36
37 public class SqlFileSpecSymbol : IntermediateSymbol
38 {
39 public SqlFileSpecSymbol() : base(SqlSymbolDefinitions.SqlFileSpec, null, null)
40 {
41 }
42
43 public SqlFileSpecSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SqlSymbolDefinitions.SqlFileSpec, sourceLineNumber, id)
44 {
45 }
46
47 public IntermediateField this[SqlFileSpecSymbolFields index] => this.Fields[(int)index];
48
49 public string Name
50 {
51 get => this.Fields[(int)SqlFileSpecSymbolFields.Name].AsString();
52 set => this.Set((int)SqlFileSpecSymbolFields.Name, value);
53 }
54
55 public string Filename
56 {
57 get => this.Fields[(int)SqlFileSpecSymbolFields.Filename].AsString();
58 set => this.Set((int)SqlFileSpecSymbolFields.Filename, value);
59 }
60
61 public string Size
62 {
63 get => this.Fields[(int)SqlFileSpecSymbolFields.Size].AsString();
64 set => this.Set((int)SqlFileSpecSymbolFields.Size, value);
65 }
66
67 public string MaxSize
68 {
69 get => this.Fields[(int)SqlFileSpecSymbolFields.MaxSize].AsString();
70 set => this.Set((int)SqlFileSpecSymbolFields.MaxSize, value);
71 }
72
73 public string GrowthSize
74 {
75 get => this.Fields[(int)SqlFileSpecSymbolFields.GrowthSize].AsString();
76 set => this.Set((int)SqlFileSpecSymbolFields.GrowthSize, value);
77 }
78 }
79} \ No newline at end of file
diff --git a/src/wixext/Symbols/SqlScriptSymbol.cs b/src/wixext/Symbols/SqlScriptSymbol.cs
new file mode 100644
index 00000000..94c70390
--- /dev/null
+++ b/src/wixext/Symbols/SqlScriptSymbol.cs
@@ -0,0 +1,87 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Sql
4{
5 using WixToolset.Data;
6 using WixToolset.Sql.Symbols;
7
8 public static partial class SqlSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition SqlScript = new IntermediateSymbolDefinition(
11 SqlSymbolDefinitionType.SqlScript.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(SqlScriptSymbolFields.SqlDbRef), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(SqlScriptSymbolFields.ComponentRef), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(SqlScriptSymbolFields.ScriptBinaryRef), IntermediateFieldType.String),
17 new IntermediateFieldDefinition(nameof(SqlScriptSymbolFields.UserRef), IntermediateFieldType.String),
18 new IntermediateFieldDefinition(nameof(SqlScriptSymbolFields.Attributes), IntermediateFieldType.Number),
19 new IntermediateFieldDefinition(nameof(SqlScriptSymbolFields.Sequence), IntermediateFieldType.Number),
20 },
21 typeof(SqlScriptSymbol));
22 }
23}
24
25namespace WixToolset.Sql.Symbols
26{
27 using WixToolset.Data;
28
29 public enum SqlScriptSymbolFields
30 {
31 SqlDbRef,
32 ComponentRef,
33 ScriptBinaryRef,
34 UserRef,
35 Attributes,
36 Sequence,
37 }
38
39 public class SqlScriptSymbol : IntermediateSymbol
40 {
41 public SqlScriptSymbol() : base(SqlSymbolDefinitions.SqlScript, null, null)
42 {
43 }
44
45 public SqlScriptSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SqlSymbolDefinitions.SqlScript, sourceLineNumber, id)
46 {
47 }
48
49 public IntermediateField this[SqlScriptSymbolFields index] => this.Fields[(int)index];
50
51 public string SqlDbRef
52 {
53 get => this.Fields[(int)SqlScriptSymbolFields.SqlDbRef].AsString();
54 set => this.Set((int)SqlScriptSymbolFields.SqlDbRef, value);
55 }
56
57 public string ComponentRef
58 {
59 get => this.Fields[(int)SqlScriptSymbolFields.ComponentRef].AsString();
60 set => this.Set((int)SqlScriptSymbolFields.ComponentRef, value);
61 }
62
63 public string ScriptBinaryRef
64 {
65 get => this.Fields[(int)SqlScriptSymbolFields.ScriptBinaryRef].AsString();
66 set => this.Set((int)SqlScriptSymbolFields.ScriptBinaryRef, value);
67 }
68
69 public string UserRef
70 {
71 get => this.Fields[(int)SqlScriptSymbolFields.UserRef].AsString();
72 set => this.Set((int)SqlScriptSymbolFields.UserRef, value);
73 }
74
75 public int Attributes
76 {
77 get => this.Fields[(int)SqlScriptSymbolFields.Attributes].AsNumber();
78 set => this.Set((int)SqlScriptSymbolFields.Attributes, value);
79 }
80
81 public int? Sequence
82 {
83 get => this.Fields[(int)SqlScriptSymbolFields.Sequence].AsNullableNumber();
84 set => this.Set((int)SqlScriptSymbolFields.Sequence, value);
85 }
86 }
87} \ No newline at end of file
diff --git a/src/wixext/Symbols/SqlStringSymbol.cs b/src/wixext/Symbols/SqlStringSymbol.cs
new file mode 100644
index 00000000..73a8206e
--- /dev/null
+++ b/src/wixext/Symbols/SqlStringSymbol.cs
@@ -0,0 +1,87 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Sql
4{
5 using WixToolset.Data;
6 using WixToolset.Sql.Symbols;
7
8 public static partial class SqlSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition SqlString = new IntermediateSymbolDefinition(
11 SqlSymbolDefinitionType.SqlString.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(SqlStringSymbolFields.SqlDbRef), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(SqlStringSymbolFields.ComponentRef), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(SqlStringSymbolFields.SQL), IntermediateFieldType.String),
17 new IntermediateFieldDefinition(nameof(SqlStringSymbolFields.UserRef), IntermediateFieldType.String),
18 new IntermediateFieldDefinition(nameof(SqlStringSymbolFields.Attributes), IntermediateFieldType.Number),
19 new IntermediateFieldDefinition(nameof(SqlStringSymbolFields.Sequence), IntermediateFieldType.Number),
20 },
21 typeof(SqlStringSymbol));
22 }
23}
24
25namespace WixToolset.Sql.Symbols
26{
27 using WixToolset.Data;
28
29 public enum SqlStringSymbolFields
30 {
31 SqlDbRef,
32 ComponentRef,
33 SQL,
34 UserRef,
35 Attributes,
36 Sequence,
37 }
38
39 public class SqlStringSymbol : IntermediateSymbol
40 {
41 public SqlStringSymbol() : base(SqlSymbolDefinitions.SqlString, null, null)
42 {
43 }
44
45 public SqlStringSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SqlSymbolDefinitions.SqlString, sourceLineNumber, id)
46 {
47 }
48
49 public IntermediateField this[SqlStringSymbolFields index] => this.Fields[(int)index];
50
51 public string SqlDbRef
52 {
53 get => this.Fields[(int)SqlStringSymbolFields.SqlDbRef].AsString();
54 set => this.Set((int)SqlStringSymbolFields.SqlDbRef, value);
55 }
56
57 public string ComponentRef
58 {
59 get => this.Fields[(int)SqlStringSymbolFields.ComponentRef].AsString();
60 set => this.Set((int)SqlStringSymbolFields.ComponentRef, value);
61 }
62
63 public string SQL
64 {
65 get => this.Fields[(int)SqlStringSymbolFields.SQL].AsString();
66 set => this.Set((int)SqlStringSymbolFields.SQL, value);
67 }
68
69 public string UserRef
70 {
71 get => this.Fields[(int)SqlStringSymbolFields.UserRef].AsString();
72 set => this.Set((int)SqlStringSymbolFields.UserRef, value);
73 }
74
75 public int Attributes
76 {
77 get => this.Fields[(int)SqlStringSymbolFields.Attributes].AsNumber();
78 set => this.Set((int)SqlStringSymbolFields.Attributes, value);
79 }
80
81 public int? Sequence
82 {
83 get => this.Fields[(int)SqlStringSymbolFields.Sequence].AsNullableNumber();
84 set => this.Set((int)SqlStringSymbolFields.Sequence, value);
85 }
86 }
87} \ No newline at end of file
diff --git a/src/wixext/Symbols/SqlSymbolDefinitions.cs b/src/wixext/Symbols/SqlSymbolDefinitions.cs
new file mode 100644
index 00000000..336f1546
--- /dev/null
+++ b/src/wixext/Symbols/SqlSymbolDefinitions.cs
@@ -0,0 +1,51 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Sql
4{
5 using System;
6 using WixToolset.Data;
7
8 public enum SqlSymbolDefinitionType
9 {
10 SqlDatabase,
11 SqlFileSpec,
12 SqlScript,
13 SqlString,
14 }
15
16 public static partial class SqlSymbolDefinitions
17 {
18 public static readonly Version Version = new Version("4.0.0");
19
20 public static IntermediateSymbolDefinition ByName(string name)
21 {
22 if (!Enum.TryParse(name, out SqlSymbolDefinitionType type))
23 {
24 return null;
25 }
26
27 return ByType(type);
28 }
29
30 public static IntermediateSymbolDefinition ByType(SqlSymbolDefinitionType type)
31 {
32 switch (type)
33 {
34 case SqlSymbolDefinitionType.SqlDatabase:
35 return SqlSymbolDefinitions.SqlDatabase;
36
37 case SqlSymbolDefinitionType.SqlFileSpec:
38 return SqlSymbolDefinitions.SqlFileSpec;
39
40 case SqlSymbolDefinitionType.SqlScript:
41 return SqlSymbolDefinitions.SqlScript;
42
43 case SqlSymbolDefinitionType.SqlString:
44 return SqlSymbolDefinitions.SqlString;
45
46 default:
47 throw new ArgumentOutOfRangeException(nameof(type));
48 }
49 }
50 }
51}