aboutsummaryrefslogtreecommitdiff
path: root/src/wixext/Tuples/SqlDatabaseTuple.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/wixext/Tuples/SqlDatabaseTuple.cs')
-rw-r--r--src/wixext/Tuples/SqlDatabaseTuple.cs111
1 files changed, 111 insertions, 0 deletions
diff --git a/src/wixext/Tuples/SqlDatabaseTuple.cs b/src/wixext/Tuples/SqlDatabaseTuple.cs
new file mode 100644
index 00000000..fd107690
--- /dev/null
+++ b/src/wixext/Tuples/SqlDatabaseTuple.cs
@@ -0,0 +1,111 @@
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.Tuples;
7
8 public static partial class SqlTupleDefinitions
9 {
10 public static readonly IntermediateTupleDefinition SqlDatabase = new IntermediateTupleDefinition(
11 SqlTupleDefinitionType.SqlDatabase.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(SqlDatabaseTupleFields.SqlDb), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(SqlDatabaseTupleFields.Server), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(SqlDatabaseTupleFields.Instance), IntermediateFieldType.String),
17 new IntermediateFieldDefinition(nameof(SqlDatabaseTupleFields.Database), IntermediateFieldType.String),
18 new IntermediateFieldDefinition(nameof(SqlDatabaseTupleFields.Component_), IntermediateFieldType.String),
19 new IntermediateFieldDefinition(nameof(SqlDatabaseTupleFields.User_), IntermediateFieldType.String),
20 new IntermediateFieldDefinition(nameof(SqlDatabaseTupleFields.FileSpec_), IntermediateFieldType.String),
21 new IntermediateFieldDefinition(nameof(SqlDatabaseTupleFields.FileSpec_Log), IntermediateFieldType.String),
22 new IntermediateFieldDefinition(nameof(SqlDatabaseTupleFields.Attributes), IntermediateFieldType.Number),
23 },
24 typeof(SqlDatabaseTuple));
25 }
26}
27
28namespace WixToolset.Sql.Tuples
29{
30 using WixToolset.Data;
31
32 public enum SqlDatabaseTupleFields
33 {
34 SqlDb,
35 Server,
36 Instance,
37 Database,
38 Component_,
39 User_,
40 FileSpec_,
41 FileSpec_Log,
42 Attributes,
43 }
44
45 public class SqlDatabaseTuple : IntermediateTuple
46 {
47 public SqlDatabaseTuple() : base(SqlTupleDefinitions.SqlDatabase, null, null)
48 {
49 }
50
51 public SqlDatabaseTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SqlTupleDefinitions.SqlDatabase, sourceLineNumber, id)
52 {
53 }
54
55 public IntermediateField this[SqlDatabaseTupleFields index] => this.Fields[(int)index];
56
57 public string SqlDb
58 {
59 get => this.Fields[(int)SqlDatabaseTupleFields.SqlDb].AsString();
60 set => this.Set((int)SqlDatabaseTupleFields.SqlDb, value);
61 }
62
63 public string Server
64 {
65 get => this.Fields[(int)SqlDatabaseTupleFields.Server].AsString();
66 set => this.Set((int)SqlDatabaseTupleFields.Server, value);
67 }
68
69 public string Instance
70 {
71 get => this.Fields[(int)SqlDatabaseTupleFields.Instance].AsString();
72 set => this.Set((int)SqlDatabaseTupleFields.Instance, value);
73 }
74
75 public string Database
76 {
77 get => this.Fields[(int)SqlDatabaseTupleFields.Database].AsString();
78 set => this.Set((int)SqlDatabaseTupleFields.Database, value);
79 }
80
81 public string Component_
82 {
83 get => this.Fields[(int)SqlDatabaseTupleFields.Component_].AsString();
84 set => this.Set((int)SqlDatabaseTupleFields.Component_, value);
85 }
86
87 public string User_
88 {
89 get => this.Fields[(int)SqlDatabaseTupleFields.User_].AsString();
90 set => this.Set((int)SqlDatabaseTupleFields.User_, value);
91 }
92
93 public string FileSpec_
94 {
95 get => this.Fields[(int)SqlDatabaseTupleFields.FileSpec_].AsString();
96 set => this.Set((int)SqlDatabaseTupleFields.FileSpec_, value);
97 }
98
99 public string FileSpec_Log
100 {
101 get => this.Fields[(int)SqlDatabaseTupleFields.FileSpec_Log].AsString();
102 set => this.Set((int)SqlDatabaseTupleFields.FileSpec_Log, value);
103 }
104
105 public int Attributes
106 {
107 get => this.Fields[(int)SqlDatabaseTupleFields.Attributes].AsNumber();
108 set => this.Set((int)SqlDatabaseTupleFields.Attributes, value);
109 }
110 }
111} \ No newline at end of file