System.Data.SQLite
Check-in [ee1d336998]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:First pass at LINQ support for VS2008 SP1 beta1
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | sourceforge
Files: files | file ages | folders
SHA1: ee1d336998d94d4b1e92eff6b7dbd89ef784652f
User & Date: rmsimpson 2008-07-01 05:24:49
Context
2008-07-16
23:32
no message check-in: c49238f784 user: rmsimpson tags: sourceforge
2008-07-01
05:24
First pass at LINQ support for VS2008 SP1 beta1 check-in: ee1d336998 user: rmsimpson tags: sourceforge
2008-06-27
21:34
1.0.50.0 check-in: 5d225801e2 user: rmsimpson tags: sourceforge
Changes
Hide Diffs Unified Diffs Show Whitespace Changes Patch

Added System.Data.SQLite.Linq/AssemblyInfo.cs.









































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
32
33
34
35
36
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following 
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("System.Data.SQLite.Linq")]
[assembly: AssemblyDescription("ADO.NET 2.0 Data Provider for SQLite")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("http://sqlite.phxsoftware.com")]
[assembly: AssemblyProduct("System.Data.SQLite")]
[assembly: AssemblyCopyright("Public Domain")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible 
// to COM components.  If you need to access a type in this assembly from 
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("d9d0877d-53d0-4ba6-962e-66b7e1663478")]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version 
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Build and Revision Numbers 
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.34.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

Added System.Data.SQLite.Linq/Resources/Common.ConceptualSchemaDefinition.csdl.































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<?xml version="1.0" encoding="utf-8"?>
<Schema xmlns="http://schemas.microsoft.com/ado/2006/04/edm" xmlns:edm="http://schemas.microsoft.com/ado/2006/04/edm" xmlns:cg="http://schemas.microsoft.com/ado/2006/04/codegeneration" Namespace="Store" Alias="Self">

  <EntityContainer Name="SchemaInformation">

    <EntitySet Name="Tables" EntityType="Self.Table" />
    <EntitySet Name="TableColumns" EntityType="Self.Column" />
    <EntitySet Name="TableConstraints" EntityType="Self.Constraint" />
    <EntitySet Name="TableForeignKeys" EntityType="Self.ForeignKey" />
    
    <EntitySet Name="Views" EntityType="Self.View" />
    <EntitySet Name="ViewColumns" EntityType="Self.Column" />
    <EntitySet Name="ViewConstraints" EntityType="Self.Constraint" />
    <EntitySet Name="ViewForeignKeys" EntityType="Self.ForeignKey" />
    
    <EntitySet Name="Functions" EntityType="Self.Function" />
    <EntitySet Name="FunctionParameters" EntityType="Self.Parameter" />
    <EntitySet Name="Procedures" EntityType="Self.Procedure" />
    <EntitySet Name="ProcedureParameters" EntityType="Self.Parameter" />
 
    <AssociationSet Name="TableTableColumns" Association="Self.TableOrViewColumn" >
      <End Role="Parent" EntitySet="Tables"/>
      <End Role="Column" EntitySet="TableColumns"/>
    </AssociationSet>
    <AssociationSet Name="TableTableConstraints" Association="Self.TableOrViewConstraint" >
      <End Role="Parent" EntitySet="Tables"/>
      <End Role="Constraint" EntitySet="TableConstraints"/>
    </AssociationSet>
    <AssociationSet Name="TableConstraintColumns" Association="Self.TableOrViewConstraintColumn" >
      <End Role="Column" EntitySet="TableColumns"/>
      <End Role="Constraint" EntitySet="TableConstraints"/>
    </AssociationSet>
    <AssociationSet Name="TableConstraintForeignKeys" Association="Self.ConstraintForeignKey" >
      <End Role="ForeignKey" EntitySet="TableForeignKeys"/>
      <End Role="Constraint" EntitySet="TableConstraints"/>
    </AssociationSet>
    <AssociationSet Name="FromTableForeignKeyColumns" Association="Self.FromForeignKeyColumn" >
      <End Role="Column" EntitySet="TableColumns"/>
      <End Role="ForeignKey" EntitySet="TableForeignKeys"/>
    </AssociationSet>
    <AssociationSet Name="ToTableForeignKeyColumns" Association="Self.ToForeignKeyColumn" >
      <End Role="Column" EntitySet="TableColumns"/>
      <End Role="ForeignKey" EntitySet="TableForeignKeys"/>
    </AssociationSet>
    
    <AssociationSet Name="ViewViewColumns" Association="Self.TableOrViewColumn" >
      <End Role="Parent" EntitySet="Views"/>
      <End Role="Column" EntitySet="ViewColumns"/>
    </AssociationSet>
    <AssociationSet Name="ViewViewConstraints" Association="Self.TableOrViewConstraint" >
      <End Role="Parent" EntitySet="Views"/>
      <End Role="Constraint" EntitySet="ViewConstraints"/>
    </AssociationSet>
    <AssociationSet Name="ViewConstraintColumns" Association="Self.TableOrViewConstraintColumn" >
      <End Role="Column" EntitySet="ViewColumns"/>
      <End Role="Constraint" EntitySet="ViewConstraints"/>
    </AssociationSet>
    <AssociationSet Name="ViewConstraintForeignKeys" Association="Self.ConstraintForeignKey" >
      <End Role="ForeignKey" EntitySet="ViewForeignKeys"/>
      <End Role="Constraint" EntitySet="ViewConstraints"/>
    </AssociationSet>
    <AssociationSet Name="FromViewForeignKeyColumns" Association="Self.FromForeignKeyColumn" >
      <End Role="Column" EntitySet="ViewColumns"/>
      <End Role="ForeignKey" EntitySet="ViewForeignKeys"/>
    </AssociationSet>
    <AssociationSet Name="ToViewForeignKeyColumns" Association="Self.ToForeignKeyColumn" >
      <End Role="Column" EntitySet="ViewColumns"/>
      <End Role="ForeignKey" EntitySet="ViewForeignKeys"/>
    </AssociationSet>
    
    <AssociationSet Name="FunctionFunctionParameters" Association="Self.RoutineParameter" >
      <End Role="Routine" EntitySet="Functions"/>
      <End Role="Parameter" EntitySet="FunctionParameters"/>
    </AssociationSet>
    
    <AssociationSet Name="ProcedureProcedureParameters" Association="Self.RoutineParameter" >
      <End Role="Routine" EntitySet="Procedures"/>
      <End Role="Parameter" EntitySet="ProcedureParameters"/>
    </AssociationSet>

  </EntityContainer>

  <ComplexType Name="TypeSpecification">
    <Property Name="TypeName" Nullable="false" Type="String"  />
    <Property Name="MaxLength" Nullable="true" Type="Int32" />
    <Property Name="Precision" Nullable="true" Type="Int16" />
    <Property Name="DateTimePrecision" Nullable="true" Type="Int32" />
    <Property Name="Scale" Nullable="true" Type="Int32" />
    <Property Name="Collation" Nullable="false" Type="Self.Collation" />
    <Property Name="CharacterSet" Nullable="false" Type="Self.CharacterSet" />
    <Property Name="IsMultiSet" Nullable="false" Type="Boolean"/>
  </ComplexType>

  <ComplexType Name="Collation">
    <Property Name="CatalogName" Nullable="true" Type="String"  />
    <Property Name="SchemaName" Nullable="true" Type="String" />
    <Property Name="Name" Nullable="true" Type="String" />
  </ComplexType>

  <ComplexType Name="CharacterSet">
    <Property Name="CatalogName" Nullable="true" Type="String"  />
    <Property Name="SchemaName" Nullable="true" Type="String" />
    <Property Name="Name" Nullable="true" Type="String" />
  </ComplexType>

  <EntityType Name="TableOrView" Abstract="true">
    <Key>
      <PropertyRef Name="Id" />
    </Key>
    <Property Name="Id" Nullable="false" Type="String"  />
    <Property Name="Name" Nullable="false" Type="String"  />
    <Property Name="CatalogName" Type="String"  />
    <Property Name="SchemaName" Type="String"  />
    <NavigationProperty Relationship="Self.TableOrViewColumn" Name="Columns" FromRole="Parent" ToRole="Column" />
    <NavigationProperty Relationship="Self.TableOrViewConstraint" Name="Constraints" FromRole="Parent" ToRole="Constraint" />
  </EntityType>

  <EntityType Name="Table" BaseType="Self.TableOrView">
  </EntityType>

  <EntityType Name="Column">
    <Key>
      <PropertyRef Name="Id" />
    </Key>
    <Property Name="Id" Nullable="false" Type="String"  />
    <Property Name="Name" Nullable="false" Type="String" />
    <Property Name="Ordinal" Nullable="false" Type="Int32" />
    <Property Name="IsNullable" Nullable="false" Type="Boolean" />
    <Property Name="ColumnType" Nullable="false" Type="Self.TypeSpecification"/>
    <Property Name="IsIdentity" Nullable="false" Type="Boolean" />
    <Property Name="IsStoreGenerated" Nullable="false" Type="Boolean" />
    <Property Name="Default" Type="String" />
    <NavigationProperty Relationship="Self.TableOrViewColumn" Name="Parent" FromRole="Column" ToRole="Parent" />
  </EntityType>
  
  <EntityType Name="View" BaseType="Self.TableOrView">
    <Property Name="IsUpdatable" Nullable="false" Type="Boolean" />
    <Property Name="ViewDefinition" Nullable="true" Type="String"  />
  </EntityType>
  
  <EntityType Name="Routine" Abstract="true">
    <Key>
      <PropertyRef Name="Id" />
    </Key>
    <Property Name="Id" Nullable="false" Type="String"  />
    <Property Name="CatalogName" Type="String"  />
    <Property Name="SchemaName" Type="String"  />
    <Property Name="Name" Nullable="false" Type="String"  />
    <NavigationProperty Relationship="Self.RoutineParameter" Name="Parameters" FromRole="Routine" ToRole="Parameter" />
  </EntityType>
  
  <EntityType Name="Parameter">
    <Key>
      <PropertyRef Name="Id" />
    </Key>
    <Property Name="Id" Nullable="false" Type="String"  />
    <Property Name="Name" Nullable="false" Type="String"  />
    <Property Name="Ordinal" Nullable="false" Type="Int32" />
    <Property Name="ParameterType" Nullable="false" Type="Self.TypeSpecification"/>
    <Property Name="Mode" Type="String"  />
    <Property Name="Default" Type="String"  />
    <NavigationProperty Relationship="Self.RoutineParameter" Name="Routine" FromRole="Parameter" ToRole="Routine" />
  </EntityType>

  <EntityType Name="Function" BaseType="Self.Routine" Abstract="true">
    <Property Name="IsBuiltIn" Type="Boolean" />
    <Property Name="IsNiladic" Type="Boolean" />
  </EntityType>

  <EntityType Name="ScalarFunction" BaseType="Self.Function">
    <Property Name="ReturnType" Type="Self.TypeSpecification" Nullable="false"/>
    <Property Name="IsAggregate" Type="Boolean" />
  </EntityType>

  <EntityType Name="Procedure" BaseType="Self.Routine">
  </EntityType>

  <EntityType Name="Constraint" Abstract="true">
    <Key>
      <PropertyRef Name="Id" />
    </Key>
    <Property Name="Id" Nullable="false" Type="String"  />
    <Property Name="Name" Nullable="false" Type="String"  />
    <Property Name="IsDeferrable" Nullable="false" Type="Boolean"  />
    <Property Name="IsInitiallyDeferred" Nullable="false" Type="Boolean"  />
    <NavigationProperty Relationship="Self.TableOrViewConstraint" Name="Parent" FromRole="Constraint" ToRole="Parent" />
  </EntityType>

  <EntityType Name="CheckConstraint" BaseType="Self.Constraint">
    <Property Name="Expression" Nullable="false" Type="String" />
  </EntityType>
  
  <EntityType Name="TableOrViewColumnConstraint" BaseType="Self.Constraint" Abstract="true">
    <NavigationProperty Relationship="Self.TableOrViewConstraintColumn" Name="Columns" FromRole="Constraint" ToRole="Column" />
  </EntityType>

  <EntityType Name="PrimaryKeyConstraint" BaseType="Self.TableOrViewColumnConstraint">
  </EntityType>

  <EntityType Name="UniqueConstraint" BaseType="Self.TableOrViewColumnConstraint">
  </EntityType>

  <EntityType Name="ForeignKeyConstraint" BaseType="Self.Constraint">
    <Property Name="UpdateRule" Nullable="false" Type="String"  />
    <Property Name="DeleteRule" Nullable="false" Type="String"  />
    <NavigationProperty Relationship="Self.ConstraintForeignKey" Name="ForeignKeys" FromRole="Constraint" ToRole="ForeignKey" />
  </EntityType>

  <EntityType Name="ForeignKey">
    <Key>
      <PropertyRef Name="Id" />
    </Key>
    <Property Name="Id" Nullable="false" Type="String"  />
    <Property Name="Ordinal" Nullable="false" Type="Int32" />
    <NavigationProperty Relationship="Self.ConstraintForeignKey" Name="Constraint" FromRole="ForeignKey" ToRole="Constraint" />
    <NavigationProperty Relationship="Self.FromForeignKeyColumn" Name="FromColumn" FromRole="ForeignKey" ToRole="Column" />
    <NavigationProperty Relationship="Self.ToForeignKeyColumn" Name="ToColumn" FromRole="ForeignKey" ToRole="Column" />
  </EntityType>
  
  <Association Name="TableOrViewColumn">
    <End Type="Self.TableOrView" Role="Parent" Multiplicity="1" />
    <End Type="Self.Column" Role="Column" Multiplicity="*" />
  </Association>
  
  <Association Name="TableOrViewConstraint">
    <End Type="Self.TableOrView" Role="Parent" Multiplicity="1" />
    <End Type="Self.Constraint" Role="Constraint" Multiplicity="*" />
  </Association>

  <Association Name="TableOrViewConstraintColumn">
    <End Type="Self.TableOrViewColumnConstraint" Role="Constraint" Multiplicity="*" />
    <End Type="Self.Column" Role="Column" Multiplicity="*" />
  </Association>

  <Association Name="ConstraintForeignKey">
    <End Type="Self.ForeignKeyConstraint" Role="Constraint" Multiplicity="1" />
    <End Type="Self.ForeignKey" Role="ForeignKey" Multiplicity="*" />
  </Association>

  <Association Name="ToForeignKeyColumn">
    <End Type="Self.ForeignKey" Role="ForeignKey" Multiplicity="*" />
    <End Type="Self.Column" Role="Column" Multiplicity="1" />
  </Association>

  <Association Name="FromForeignKeyColumn">
    <End Type="Self.ForeignKey" Role="ForeignKey" Multiplicity="*" />
    <End Type="Self.Column" Role="Column" Multiplicity="1" />
  </Association>
  
  <Association Name="RoutineParameter">
    <End Type="Self.Routine" Role="Routine" Multiplicity="1" />
    <End Type="Self.Parameter" Role="Parameter" Multiplicity="*" />
  </Association>

</Schema>

Added System.Data.SQLite.Linq/Resources/Common.ProviderManifest.xsd.





















































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<?xml version="1.0" encoding="utf-8"?>
<xs:schema elementFormDefault="qualified"
		   xmlns:xs="http://www.w3.org/2001/XMLSchema"
		   targetNamespace="http://schemas.microsoft.com/ado/2006/04/edm/providermanifest"
		   xmlns:pm="http://schemas.microsoft.com/ado/2006/04/edm/providermanifest">

  <xs:element name="ProviderManifest">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Types" type="pm:TTypes" minOccurs="1" maxOccurs="1" />
        <xs:element name="Functions" type="pm:TFunctions" minOccurs="0" maxOccurs="1"/>
      </xs:sequence>
      <xs:attribute name="Namespace" type="xs:string" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:complexType name="TVersion">
    <xs:attribute name="Major" type="xs:int" use="required" />
    <xs:attribute name="Minor" type="xs:int" use="required" />
    <xs:attribute name="Build" type="xs:int" use="required" />
    <xs:attribute name="Revision" type="xs:int" use="required" />
  </xs:complexType>

  <xs:complexType name="TIntegerFacetDescription">
    <xs:attribute name="Minimum" type="xs:int" use="optional" />
    <xs:attribute name="Maximum" type="xs:int" use="optional" />
    <xs:attribute name="DefaultValue" type="xs:int" use="optional" />
    <xs:attribute name="Constant" type="xs:boolean" default="false" />
  </xs:complexType>

  <xs:complexType name="TBooleanFacetDescription">
    <xs:attribute name="DefaultValue" type="xs:boolean" use="optional" />
    <xs:attribute name="Constant" type="xs:boolean" default="true" />
  </xs:complexType>

  <xs:complexType name="TDateTimeFacetDescription">
    <xs:attribute name="Constant" type="xs:boolean" default="false" />
  </xs:complexType>

  <xs:complexType name="TFacetDescriptions">
    <xs:choice maxOccurs="unbounded">
      <xs:element name="Precision" minOccurs="0" maxOccurs="1" type="pm:TIntegerFacetDescription"/>
      <xs:element name="Scale" minOccurs="0" maxOccurs="1" type="pm:TIntegerFacetDescription"/>
      <xs:element name="MaxLength" minOccurs="0" maxOccurs="1" type="pm:TIntegerFacetDescription"/>
      <xs:element name="Unicode" minOccurs="0" maxOccurs="1" type="pm:TBooleanFacetDescription"/>
      <xs:element name="FixedLength" minOccurs="0" maxOccurs="1" type="pm:TBooleanFacetDescription"/>
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="TType">
    <xs:sequence>
      <xs:element name="FacetDescriptions" type="pm:TFacetDescriptions" minOccurs="0" maxOccurs="1"/>
    </xs:sequence>
    <xs:attribute name="Name" type="xs:string" use="required"/>
    <xs:attribute name="PrimitiveTypeKind" type="pm:TPrimitiveTypeKind" use="required" />
  </xs:complexType>

  <xs:complexType name="TTypes">
    <xs:sequence>
      <xs:element name="Type" type="pm:TType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>

  <xs:attributeGroup name="TFacetAttribute">
    <xs:attribute name="Precision" type="xs:int" use="optional"/>
    <xs:attribute name="Scale" type="xs:int" use="optional"/>
    <xs:attribute name="MaxLength" type="xs:int" use="optional"/>
    <xs:attribute name="Unicode" type="xs:boolean" use="optional"/>
    <xs:attribute name="FixedLength" type="xs:boolean" use="optional"/>
  </xs:attributeGroup>

  <xs:complexType name="TFunctionParameter">
    <xs:attribute name="Name" type="xs:string" use="required" />
    <xs:attribute name="Type" type="xs:string" use="required" />
    <xs:attributeGroup ref="pm:TFacetAttribute" />
    <xs:attribute name="Mode" type="pm:TParameterDirection" use="required" />
  </xs:complexType>

  <xs:complexType name="TReturnType">
    <xs:attribute name="Type" type="xs:string" use="required" />
    <xs:attributeGroup ref="pm:TFacetAttribute" />
  </xs:complexType>

  <xs:complexType name="TFunction">
    <xs:choice minOccurs="0" maxOccurs ="unbounded">
      <xs:element name ="ReturnType" type="pm:TReturnType" minOccurs="0" maxOccurs="1" />
      <xs:element name="Parameter" type="pm:TFunctionParameter" minOccurs="0" maxOccurs="unbounded"/>
    </xs:choice>
    <xs:attribute name="Name" type="xs:string" use="required" />
    <xs:attribute name="Aggregate" type="xs:boolean" use="optional" />
    <xs:attribute name="BuiltIn" type="xs:boolean" use="optional" />
    <xs:attribute name="StoreFunctionName" type="xs:string" use="optional" />
    <xs:attribute name="NiladicFunction" type="xs:boolean" use="optional" />
    <xs:attribute name="ParameterTypeSemantics" type="pm:TParameterTypeSemantics" use="optional" default="AllowImplicitConversion" />
  </xs:complexType>

  <xs:complexType name="TFunctions">
    <xs:sequence>
      <xs:element name="Function" type="pm:TFunction" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>

  <xs:simpleType name="TPrimitiveTypeKind">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Binary"/>
      <xs:enumeration value="Boolean"/>
      <xs:enumeration value="Byte"/>
      <xs:enumeration value="Decimal"/>
      <xs:enumeration value="DateTime"/>
      <xs:enumeration value="Time"/>
      <xs:enumeration value="DateTimeOffset"/>        
      <xs:enumeration value="Double"/>
      <xs:enumeration value="Guid"/>
      <xs:enumeration value="Single"/>
      <xs:enumeration value="SByte"/>
      <xs:enumeration value="Int16"/>
      <xs:enumeration value="Int32"/>
      <xs:enumeration value="Int64"/>
      <xs:enumeration value="String"/>
    </xs:restriction>
  </xs:simpleType>


  <xs:simpleType name="TParameterDirection">
    <xs:restriction base="xs:string">
      <xs:enumeration value="In"/>
      <xs:enumeration value="Out"/>
      <xs:enumeration value="InOut"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="TParameterTypeSemantics">
    <xs:restriction base="xs:string">
      <xs:enumeration value="ExactMatchOnly" />
      <xs:enumeration value="AllowImplicitPromotion" />
      <xs:enumeration value="AllowImplicitConversion" />
    </xs:restriction>
  </xs:simpleType>
</xs:schema>

Added System.Data.SQLite.Linq/Resources/SQLiteProviderServices.ProviderManifest.xml.































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
<?xml version="1.0" encoding="utf-8"?>
<!-- 
####################################################################################################################

BE AWARE THAT THE ORDER IN WHICH TYPES ARE DESCRIBED IN THE PROVIDER MANIFEST IS RELEVANT AND HAVE IMPACT IN LOOKUP
PROCESS

#################################################################################################################### 
-->
<ProviderManifest Namespace="EFSQLite" xmlns="http://schemas.microsoft.com/ado/2006/04/edm/providermanifest">
  <Types>
    <Type Name="tinyint" PrimitiveTypeKind="Byte">
    </Type>
    <Type Name="smallint" PrimitiveTypeKind="Int16">
    </Type>
    <Type Name="int" PrimitiveTypeKind="Int32">
    </Type>
    <Type Name="integer" PrimitiveTypeKind="Int64">
    </Type>
    <Type Name="float" PrimitiveTypeKind="Double">
    </Type>
    <Type Name="real" PrimitiveTypeKind="Single">
    </Type>
    <Type Name="decimal" PrimitiveTypeKind="Decimal">
      <FacetDescriptions>
        <Precision Minimum="1" Maximum="53" DefaultValue="18" Constant="false" />
        <Scale Minimum="0" Maximum="53" DefaultValue="0" Constant="false" />
      </FacetDescriptions>
    </Type>
    <Type Name="blob" PrimitiveTypeKind="Binary">
      <FacetDescriptions>
        <MaxLength DefaultValue="2147483647" Constant="true" />
        <FixedLength DefaultValue="false" Constant="true" />
      </FacetDescriptions>
    </Type>
    <Type Name="bit" PrimitiveTypeKind="Boolean">
    </Type>
    <Type Name="datetime" PrimitiveTypeKind="DateTime">
      <FacetDescriptions>
          <Precision DefaultValue="3" Constant="true" />
      </FacetDescriptions>
    </Type>
    <Type Name="nvarchar" PrimitiveTypeKind="String">
      <FacetDescriptions>
        <MaxLength Minimum="1" Maximum="2147483647" DefaultValue="2147483647" Constant="false" />
        <Unicode DefaultValue="true" Constant="true" />
        <FixedLength DefaultValue="false" Constant="true" />
      </FacetDescriptions>
    </Type>
    <Type Name="varchar" PrimitiveTypeKind="String">
      <FacetDescriptions>
        <MaxLength Minimum="1" Maximum="2147483647" DefaultValue="2147483647" Constant="false" />
        <Unicode DefaultValue="false" Constant="true" />
        <FixedLength DefaultValue="false" Constant="true" />
      </FacetDescriptions>
    </Type>
    <Type Name="char" PrimitiveTypeKind="String">
      <FacetDescriptions>
        <MaxLength Minimum="1" Maximum="2147483647" DefaultValue="2147483647" Constant="false" />
        <Unicode DefaultValue="false" Constant="true" />
        <FixedLength DefaultValue="true" Constant="true" />
      </FacetDescriptions>
    </Type>
    <Type Name="nchar" PrimitiveTypeKind="String">
      <FacetDescriptions>
        <MaxLength Minimum="1" Maximum="2147483647" DefaultValue="2147483647" Constant="false" />
        <Unicode DefaultValue="true" Constant="true" />
        <FixedLength DefaultValue="true" Constant="true" />
      </FacetDescriptions>
    </Type>
    <Type Name="uniqueidentifier" PrimitiveTypeKind="Guid">
    </Type>
  </Types>
  <Functions>

    <!-- BEGIN AGGREGATES ############################################# -->
    <!-- AVG -->
    <Function Name="AVG" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="Collection(Int32)" Mode="In" />
    </Function>
    <Function Name="AVG" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Int64" />
      <Parameter Name="arg" Type="Collection(Int64)" Mode="In" />
    </Function>
    <Function Name="AVG" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Decimal" />
      <Parameter Name="arg" Type="Collection(Decimal)" Mode="In" />
    </Function>
    <Function Name="AVG" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Collection(Double)" Mode="In" />
    </Function>

    <!-- CHECKSUM_AGG -->
    <Function Name="CHECKSUM_AGG" Aggregate="true" BuiltIn="true" ParameterTypeSemantics="ExactMatchOnly">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="Collection(Int32)" Mode="In" />
    </Function>

    <!-- COUNT -->
    <Function Name="COUNT" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="Collection(Boolean)" Mode="In" />
    </Function>
    <Function Name="COUNT" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="Collection(Double)" Mode="In" />
    </Function>
    <Function Name="COUNT" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="Collection(Decimal)" Mode="In" />
    </Function>
    <Function Name="COUNT" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="Collection(DateTime)" Mode="In" />
    </Function>
    <Function Name="COUNT" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="Collection(DateTimeOffset)" Mode="In" />
    </Function>
    <Function Name="COUNT" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="Collection(Time)" Mode="In" />
    </Function>
    <Function Name="COUNT" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="Collection(Guid)" Mode="In" />
    </Function>
    <Function Name="COUNT" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="Collection(String)" Mode="In" />
    </Function>
    <Function Name="COUNT" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="Collection(Binary)" Mode="In" />
    </Function>

    <!-- COUNT_BIG -->
    <Function Name="COUNT_BIG" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Int64" />
      <Parameter Name="arg" Type="Collection(Boolean)" Mode="In" />
    </Function>
    <Function Name="COUNT_BIG" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Int64" />
      <Parameter Name="arg" Type="Collection(Double)" Mode="In" />
    </Function>
    <Function Name="COUNT_BIG" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Int64" />
      <Parameter Name="arg" Type="Collection(Decimal)" Mode="In" />
    </Function>
    <Function Name="COUNT_BIG" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Int64" />
      <Parameter Name="arg" Type="Collection(DateTime)" Mode="In" />
    </Function>
    <Function Name="COUNT_BIG" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Int64" />
      <Parameter Name="arg" Type="Collection(DateTimeOffset)" Mode="In" />
    </Function>
    <Function Name="COUNT_BIG" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Int64" />
      <Parameter Name="arg" Type="Collection(Time)" Mode="In" />
    </Function>
    <Function Name="COUNT_BIG" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Int64" />
      <Parameter Name="arg" Type="Collection(Guid)" Mode="In" />
    </Function>
    <Function Name="COUNT_BIG" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Int64" />
      <Parameter Name="arg" Type="Collection(String)" Mode="In" />
    </Function>
    <Function Name="COUNT_BIG" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Int64" />
      <Parameter Name="arg" Type="Collection(Binary)" Mode="In" />
    </Function>

    <!-- GROUPING !NOT SUPPORTED! -->

    <!-- MAX -->
    <Function Name="MAX" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Byte" />
      <Parameter Name="arg" Type="Collection(Byte)" Mode="In" />
    </Function>
    <Function Name="MAX" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Int16" />
      <Parameter Name="arg" Type="Collection(Int16)" Mode="In" />
    </Function>
    <Function Name="MAX" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="Collection(Int32)" Mode="In" />
    </Function>
    <Function Name="MAX" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Int64" />
      <Parameter Name="arg" Type="Collection(Int64)" Mode="In" />
    </Function>
    <Function Name="MAX" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Decimal" />
      <Parameter Name="arg" Type="Collection(Decimal)" Mode="In" />
    </Function>
    <Function Name="MAX" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Collection(Double)" Mode="In" />
    </Function>
    <Function Name="MAX" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Single" />
      <Parameter Name="arg" Type="Collection(Single)" Mode="In" />
    </Function>
    <Function Name="MAX" Aggregate="true" BuiltIn="true">
      <ReturnType Type="DateTime" />
      <Parameter Name="arg" Type="Collection(DateTime)" Mode="In" />
    </Function>
    <Function Name="MAX" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Time" />
      <Parameter Name="arg" Type="Collection(Time)" Mode="In" />
    </Function>
    <Function Name="MAX" Aggregate="true" BuiltIn="true">
      <ReturnType Type="DateTimeOffset" />
      <Parameter Name="arg" Type="Collection(DateTimeOffset)" Mode="In" />
    </Function>
    <Function Name="MAX" Aggregate="true" BuiltIn="true">
      <ReturnType Type="String" />
      <Parameter Name="arg" Type="Collection(String)" Mode="In" />
    </Function>
    <Function Name="MAX" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Binary" />
      <Parameter Name="arg" Type="Collection(Binary)" Mode="In" />
    </Function>

    <!-- MIN -->
    <Function Name="MIN" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Byte" />
      <Parameter Name="arg" Type="Collection(Byte)" Mode="In" />
    </Function>
    <Function Name="MIN" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Int16" />
      <Parameter Name="arg" Type="Collection(Int16)" Mode="In" />
    </Function>
    <Function Name="MIN" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="Collection(Int32)" Mode="In" />
    </Function>
    <Function Name="MIN" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Int64" />
      <Parameter Name="arg" Type="Collection(Int64)" Mode="In" />
    </Function>
    <Function Name="MIN" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Decimal" />
      <Parameter Name="arg" Type="Collection(Decimal)" Mode="In" />
    </Function>
    <Function Name="MIN" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Collection(Double)" Mode="In" />
    </Function>
    <Function Name="MIN" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Single" />
      <Parameter Name="arg" Type="Collection(Single)" Mode="In" />
    </Function>
    <Function Name="MIN" Aggregate="true" BuiltIn="true">
      <ReturnType Type="DateTime" />
      <Parameter Name="arg" Type="Collection(DateTime)" Mode="In" />
    </Function>
    <Function Name="MIN" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Time" />
      <Parameter Name="arg" Type="Collection(Time)" Mode="In" />
    </Function>
    <Function Name="MIN" Aggregate="true" BuiltIn="true">
      <ReturnType Type="DateTimeOffset" />
      <Parameter Name="arg" Type="Collection(DateTimeOffset)" Mode="In" />
    </Function>
    <Function Name="MIN" Aggregate="true" BuiltIn="true">
      <ReturnType Type="String" />
      <Parameter Name="arg" Type="Collection(String)" Mode="In" />
    </Function>
    <Function Name="MIN" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Binary" />
      <Parameter Name="arg" Type="Collection(Binary)" Mode="In" />
    </Function>

    <!-- SUM -->
    <Function Name="SUM" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="Collection(Int32)" Mode="In" />
    </Function>
    <Function Name="SUM" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Int64" />
      <Parameter Name="arg" Type="Collection(Int64)" Mode="In" />
    </Function>
    <Function Name="SUM" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Decimal" />
      <Parameter Name="arg" Type="Collection(Decimal)" Mode="In" />
    </Function>
    <Function Name="SUM" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Collection(Double)" Mode="In" />
    </Function>

    <!-- STDEV -->
    <Function Name="STDEV" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Collection(Double)" Mode="In" />
    </Function>

    <Function Name="STDEV" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Collection(Decimal)" Mode="In" />
    </Function>


      <!-- STDEVP -->
    <Function Name="STDEVP" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Collection(Double)" Mode="In" />
    </Function>

      <Function Name="STDEVP" Aggregate="true" BuiltIn="true">
          <ReturnType Type="Double" />
          <Parameter Name="arg" Type="Collection(Decimal)" Mode="In" />
      </Function>      

    <!-- VAR -->
    <Function Name="VAR" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Collection(Double)" Mode="In" />
    </Function>

    <Function Name="VAR" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Collection(Decimal)" Mode="In" />
    </Function>

      <!-- VARP -->
    <Function Name="VARP" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Collection(Double)" Mode="In" />
    </Function>

    <Function Name="VARP" Aggregate="true" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Collection(Decimal)" Mode="In" />
    </Function>


      <!-- END AGGREGATES ############################################# -->

    <!-- BEGIN STRING FUNCTIONS ##################################### -->
    <!-- ASCII( arg ) 
                arg1: char, varchar (nvarchar is allowed by SQL server)
                returns: int   
        -->
    <Function Name="ASCII" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="String" Mode="In" />
    </Function>

    <!-- CHAR( arg )
                arg: tinyint, *smallint, *int, *bigint
                returns: char(1)
        -->
    <Function Name="CHAR" BuiltIn="true">
      <ReturnType Type="String"/>
      <Parameter Name="arg" Type="Int32" Mode="In" />
    </Function>

    <!-- CHARINDEX( strSearch, strTarget [, startLocation ] )
                strSearch: character expression
                strTarget: character expression
                startLocation: tinyint, smallint, int, bigint
                returns: int, bigint   
        -->
    <Function Name="CHARINDEX" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="strSearch" Type="String" Mode="In" />
      <Parameter Name="strTarget" Type="String" Mode="In" />
    </Function>
    <Function Name="CHARINDEX" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="strSearch" Type="Binary" Mode="In" />
      <Parameter Name="strTarget" Type="Binary" Mode="In" />
    </Function>
    <Function Name="CHARINDEX" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="strSearch" Type="String" Mode="In" />
      <Parameter Name="strTarget" Type="String" Mode="In" />
      <Parameter Name="startLocation" Type="Int32" Mode="In" />
    </Function>
    <Function Name="CHARINDEX" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="strSearch" Type="Binary" Mode="In" />
      <Parameter Name="strTarget" Type="Binary" Mode="In" />
      <Parameter Name="startLocation" Type="Int32" Mode="In" />
    </Function>
    <Function Name="CHARINDEX" BuiltIn="true">
      <ReturnType Type="Int64" />
      <Parameter Name="strSearch" Type="String" Mode="In" />
      <Parameter Name="strTarget" Type="String" Mode="In" />
      <Parameter Name="startLocation" Type="Int64" Mode="In" />
    </Function>
    <Function Name="CHARINDEX" BuiltIn="true">
      <ReturnType Type="Int64" />
      <Parameter Name="strSearch" Type="Binary" Mode="In" />
      <Parameter Name="strTarget" Type="Binary" Mode="In" />
      <Parameter Name="startLocation" Type="Int64" Mode="In" />
    </Function>

    <!-- DIFFERENCE( str1, str2 ) 
            str1: varchar
            str2: varchar
            returns: int   
        -->
    <Function Name="DIFFERENCE" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="str1" Type="String" Mode="In" />
      <Parameter Name="str2" Type="String" Mode="In" />
    </Function>
    <!-- LEFT( str, count ) 
                str: char, nchar, varchar, nvarchar, varchar(max), nvarchar(max)
                count: tinyint, smallint, int, bigint
                returns: varchar, nvarchar
        -->
    <Function Name="LEFT" BuiltIn="true">
      <ReturnType Type="String" />
      <Parameter Name="str" Type="String" Mode="In" />
      <Parameter Name="count" Type="Int64" Mode="In" />
    </Function>

    <!-- LEN( string_expression )
                string_expression: char, nchar, varchar, nvarchar, varchar(max), nvarchar(max)
                returns: int, bigint   
        -->
    <Function Name="LEN" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="string_expression" Type="String" Mode="In" />
    </Function>
    <Function Name="LEN" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="string_expression" Type="Binary" Mode="In" />
    </Function>

    <!-- LOWER( str ) 
            str: char, nchar, varchar, nvarchar, varchar(max), nvarchar(max)
            returns: varchar, nvarchar   
        -->
    <Function Name="LOWER" BuiltIn="true">
      <ReturnType Type="String" />
      <Parameter Name="str" Type="String" Mode="In" />
    </Function>


    <!-- LTRIM( str ) 
            str: char, nchar, varchar, nvarchar, varchar(max), nvarchar(max)
            returns: varchar, nvarchar
        -->
    <Function Name="LTRIM" BuiltIn="true">
      <ReturnType Type="String" />
      <Parameter Name="str" Type="String" Mode="In" />
    </Function>

    <!-- nchar( ncharCode ) 
                ncharCode: tinyint, smallint, int, bigint
                returns: nchar(1)
        -->
    <Function Name="NCHAR" BuiltIn="true">
      <ReturnType Type="String"/>
      <Parameter Name="arg" Type="Int32" Mode="In" />
    </Function>

    <!-- PATINDEX( strPattern, strTarget )
            strPattern: char, nchar, varchar, nvarchar
            strTarget: char, nchar, varchar, nvarchar, varchar(max), nvarchar(max)
            returns: int, bigint   
        -->
    <Function Name="PATINDEX" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="strPattern" Type="String" Mode="In" />
      <Parameter Name="strTarget" Type="String" Mode="In" />
    </Function>

    <!-- QUOTENAME( character_string [,quote_character] ) 
                character_string: nchar, nvarchar, nvarchar(max)
                quote_character: nchar, char, varchar, nvarchar
                returns: nvarchar   
        -->
    <Function Name="QUOTENAME" BuiltIn="true">
      <ReturnType Type="String"  />
      <Parameter Name="character_string" Type="String" Mode="In" />
    </Function>
    <Function Name="QUOTENAME" BuiltIn="true">
      <ReturnType Type="String"  />
      <Parameter Name="character_string" Type="String"  Mode="In" />
      <Parameter Name="quote_character" Type="String"  Mode="In" />
    </Function>

    <!-- REPLACE( strTarget, strSearch, strReplacement )
            strTarget: char, nchar, varchar, nvarchar, varchar(max), nvarchar(max)
            strSearch: char, nchar, varchar, nvarchar, varchar(max), nvarchar(max)
            strReplacement: char, nchar, varchar, nvarchar, varchar(max), nvarchar(max)
            returns: varchar, nvarchar   
        -->
    <Function Name="REPLACE" BuiltIn="true">
      <ReturnType Type="String" />
      <Parameter Name="strTarget" Type="String"  Mode="In" />
      <Parameter Name="strSearch" Type="String"  Mode="In" />
      <Parameter Name="strReplacement" Type="String"  Mode="In" />
    </Function>

    <!-- REPLICATE( strSource, count )
            strSource: varchar, nvarchar
            count: tinyint, smallint, int
            returns: varchar, nvarchar   
        -->
    <Function Name="REPLICATE" BuiltIn="true">
      <ReturnType Type="String"  />
      <Parameter Name="strTarget" Type="String" Mode="In" />
      <Parameter Name="count" Type="Int32" Mode="In" />
    </Function>

    <!-- REVERSE( arg ) 
            arg: char, nchar, varchar, nvarchar, varchar(max), nvarchar(max)
            returns: varchar, nvarchar
        -->
    <Function Name="REVERSE" BuiltIn="true">
      <ReturnType Type="String" />
      <Parameter Name="arg" Type="String" Mode="In" />
    </Function>

    <!-- RIGHT( atr, count ) 
                str: char, nchar, varchar, nvarchar, varchar(max), nvarchar(max)
                count: tinyint, smallint, int, bigint
                returns: varchar, nvarchar
        -->
    <Function Name="RIGHT" BuiltIn="true">
      <ReturnType Type="String" />
      <Parameter Name="str" Type="String" Mode="In" />
      <Parameter Name="count" Type="Int64" Mode="In" />
    </Function>

    <!-- RTRIM( arg1 ) 
            str: char, nchar, varchar, nvarchar, varchar(max), nvarchar(max)
            returns: varchar, nvarchar
        -->
    <Function Name="RTRIM" BuiltIn="true">
      <ReturnType Type="String" />
      <Parameter Name="str" Type="String" Mode="In" />
    </Function>

    <!-- SOUNDEX( arg ) 
            arg: char, nchar, varchar, nvarchar, varchar(max), nvarchar(max)
            returns: varchar   
        -->
    <Function Name="SOUNDEX" BuiltIn="true">
      <ReturnType Type="String" />
      <Parameter Name="arg" Type="String" Mode="In" />
    </Function>

    <!-- SPACE( arg ) 
            arg: tinyint, smallint, int
            returns: char   
        -->
    <Function Name="SPACE" BuiltIn="true">
      <ReturnType Type="String" />
      <Parameter Name="arg1" Type="Int32" Mode="In" />
    </Function>

    <!-- STR( number [,length [,decimal]] ) 
                number: float
                length: int
                decimal: int
                returns: char   
        -->
    <Function Name="STR" BuiltIn="true">
      <ReturnType Type="String"  />
      <Parameter Name="number" Type="Double" Mode="In" />
    </Function>
    <Function Name="STR" BuiltIn="true">
      <ReturnType Type="String"  />
      <Parameter Name="number" Type="Decimal" Mode="In" />
    </Function>
   <Function Name="STR" BuiltIn="true">
      <ReturnType Type="String"  />
      <Parameter Name="number" Type="Double" Mode="In" />
      <Parameter Name="length" Type="Int32" Mode="In" />
    </Function>
    <Function Name="STR" BuiltIn="true">
      <ReturnType Type="String"  />
      <Parameter Name="number" Type="Decimal" Mode="In" />
      <Parameter Name="length" Type="Int32" Mode="In" />
    </Function>
    <Function Name="STR" BuiltIn="true">
      <ReturnType Type="String" />
      <Parameter Name="number" Type="Double" Mode="In" />
      <Parameter Name="length" Type="Int32" Mode="In" />
      <Parameter Name="decimal" Type="Int32" Mode="In" />
    </Function>
    <Function Name="STR" BuiltIn="true">
      <ReturnType Type="String" />
      <Parameter Name="number" Type="Decimal" Mode="In" />
      <Parameter Name="length" Type="Int32" Mode="In" />
      <Parameter Name="decimal" Type="Int32" Mode="In" />
   </Function>

      <!-- STUFF( strInput, start, length, strReplacement )
                strInput: varchar, nvarchar
                start: int
                legth: int
                strReplacement: varchar, nvarchar
                returns: int, bigint   
        -->
    <Function Name="STUFF" BuiltIn="true">
      <ReturnType Type="String"  />
      <Parameter Name="strInput" Type="String"  Mode="In" />
      <Parameter Name="start" Type="Int32" Mode="In" />
      <Parameter Name="length" Type="Int32" Mode="In" />
      <Parameter Name="strReplacement" Type="String"  Mode="In" />
    </Function>

    <!-- SUBSTRING( str, start, length )
                str: char, nchar, varchar, nvarchar, varchar(max), nvarchar(max)
                start: tinyint, smallint, int, bigint
                length: tinyint, smallint, int, bigint
                returns: varchar, nvarchar
        -->
    <Function Name="SUBSTRING" BuiltIn="true">
      <ReturnType Type="String" />
      <Parameter Name="str" Type="String" Mode="In" />
      <Parameter Name="start" Type="Int64" Mode="In" />
      <Parameter Name="length" Type="Int64" Mode="In" />
    </Function>
    <Function Name="SUBSTRING" BuiltIn="true">
      <ReturnType Type="Binary" />
      <Parameter Name="str" Type="Binary" Mode="In" />
      <Parameter Name="start" Type="Int64" Mode="In" />
      <Parameter Name="length" Type="Int64" Mode="In" />
    </Function>

    <!-- UNICODE( arg ) 
            arg: nchar, nvarchar
            returns: int   
        -->
    <Function Name="UNICODE" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="String" Mode="In" />
    </Function>

    <!-- UPPER( arg ) 
                str: char, nchar, varchar, nvarchar, varchar(max), nvarchar(max)
                returns: varchar, nvarchar   
        -->
    <Function Name="UPPER" BuiltIn="true">
      <ReturnType Type="String" />
      <Parameter Name="str" Type="String" Mode="In" />
    </Function>

    <!-- END STRING FUNCTIONS ####################################### -->

    <!-- BEGIN MATH FUNCTIONS ####################################### -->
    <!-- ABS( arg )
                arg: tinyint, smallint, int, bigint, numeric, decimal, smallmoney, money, real, float
                returns: tinyint, smallint, int, bigint, numeric, decimal, smallmoney, money, real, float
        -->
    <Function Name="ABS" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="Int32" Mode="In" />
    </Function>
    <Function Name="ABS" BuiltIn="true">
      <ReturnType Type="Int64" />
      <Parameter Name="arg" Type="Int64" Mode="In" />
    </Function>
    <Function Name="ABS" BuiltIn="true">
      <ReturnType Type="Decimal" />
      <Parameter Name="arg" Type="Decimal" Mode="In" />
    </Function>
    <Function Name="ABS" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Double" Mode="In" />
    </Function>

      <!-- ACOS( arg )
                arg: float
                returns: float   
        -->
    <Function Name="ACOS" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg1" Type="Double" Mode="In" />
    </Function>
    <Function Name="ACOS" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg1" Type="Decimal" Mode="In" />
    </Function>

      <!-- ASIN( arg )
                arg: float
                returns: float   
        -->
    <Function Name="ASIN" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Double" Mode="In" />
    </Function>
    <Function Name="ASIN" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Decimal" Mode="In" />
    </Function>

      <!-- ATAN( arg )
                arg: float
                returns: float   
        -->
    <Function Name="ATAN" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Double" Mode="In" />
    </Function>

    <Function Name="ATAN" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Decimal" Mode="In" />
    </Function>

      <!-- ATN2( arg1, arg2 )
                arg1: float
                arg2: float
                returns: float   
        -->
    <Function Name="ATN2" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg1" Type="Double" Mode="In" />
      <Parameter Name="arg2" Type="Double" Mode="In" />
    </Function>

    <Function Name="ATN2" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg1" Type="Decimal" Mode="In" />
      <Parameter Name="arg2" Type="Decimal" Mode="In" />
    </Function>


      <!-- CEILING( arg )
                arg: smalldatetime, datetime
                returns: int   
        -->
    <Function Name="CEILING" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="Int32" Mode="In" />
    </Function>
    <Function Name="CEILING" BuiltIn="true">
      <ReturnType Type="Int64" />
      <Parameter Name="arg" Type="Int64" Mode="In" />
    </Function>
    <Function Name="CEILING" BuiltIn="true">
      <ReturnType Type="Decimal" />
      <Parameter Name="arg" Type="Decimal" Mode="In" />
    </Function>
    <Function Name="CEILING" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Double" Mode="In" />
    </Function>

      <!-- COS( arg )
                arg: float
                returns: float   
        -->
    <Function Name="COS" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Double" Mode="In" />
    </Function>

    <Function Name="COS" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Decimal" Mode="In" />
    </Function>

      <!-- COT( arg )
                arg: float
                returns: float   
        -->
    <Function Name="COT" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Double" Mode="In" />
    </Function>
    <Function Name="COT" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Decimal" Mode="In" />
    </Function>

      <!-- DEGREES( arg )
                arg: tinyint, smallint, int, bigint, numeric, decimal, smallmoney, money, real, float
                returns: tinyint, smallint, int, bigint, numeric, decimal, smallmoney, money, real, float
        -->
    <Function Name="DEGREES" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg1" Type="Int32" Mode="In" />
    </Function>
    <Function Name="DEGREES" BuiltIn="true">
      <ReturnType Type="Int64" />
      <Parameter Name="arg1" Type="Int64" Mode="In" />
    </Function>
    <Function Name="DEGREES" BuiltIn="true">
      <ReturnType Type="Decimal" />
      <Parameter Name="arg1" Type="Decimal" Mode="In" />
    </Function>
    <Function Name="DEGREES" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg1" Type="Double" Mode="In" />
    </Function>
    <!-- EXP( arg )
                arg: float
                returns: float   
        -->
    <Function Name="EXP" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Double" Mode="In" />
    </Function>

    <Function Name="EXP" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Decimal" Mode="In" />
    </Function>

      <!-- FLOOR( arg )
                arg: tinyint, smallint, int, bigint, numeric, decimal, smallmoney, money, real, float
                returns: tinyint, smallint, int, bigint, numeric, decimal, smallmoney, money, real, float
        -->
    <Function Name="FLOOR" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="Int32" Mode="In" />
    </Function>
    <Function Name="FLOOR" BuiltIn="true">
      <ReturnType Type="Int64" />
      <Parameter Name="arg" Type="Int64" Mode="In" />
    </Function>
    <Function Name="FLOOR" BuiltIn="true">
      <ReturnType Type="Decimal" />
      <Parameter Name="arg" Type="Decimal" Mode="In" />
    </Function>
    <Function Name="FLOOR" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Double" Mode="In" />
    </Function>
 
    <!-- LOG( arg )
            arg: float
            returns: float   
     -->
    <Function Name="LOG" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Double" Mode="In" />
    </Function>
    <Function Name="LOG" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Decimal" Mode="In" />
    </Function>

      <!-- LOG10( arg )
                arg: float
                returns: float   
        -->
    <Function Name="LOG10" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Double" Mode="In" />
    </Function>
    <Function Name="LOG10" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Decimal" Mode="In" />
    </Function>
    <!-- PI( )
                returns: float   
        -->
    <Function Name="PI" BuiltIn="true">
      <ReturnType Type="Double" />
    </Function>

    <!-- POWER( x, y )
                x: tinyint, smallint, int, bigint, numeric, decimal, smallmoney, money, real, float
                y: tinyint, smallint, int, bigint, numeric, decimal, smallmoney, money, real, float
                returns: tinyint, smallint, int, bigint, numeric, decimal, smallmoney, money, real, float
        -->
    <Function Name="POWER" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="x" Type="Int32" Mode="In" />
      <Parameter Name="y" Type="Double" Mode="In" />
    </Function>
    <Function Name="POWER" BuiltIn="true">
      <ReturnType Type="Int64" />
      <Parameter Name="x" Type="Int64" Mode="In" />
      <Parameter Name="y" Type="Double" Mode="In" />
    </Function>
    <Function Name="POWER" BuiltIn="true">
      <ReturnType Type="Decimal" />
      <Parameter Name="x" Type="Decimal" Mode="In" />
      <Parameter Name="y" Type="Double" Mode="In" />
    </Function>
    <Function Name="POWER" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="x" Type="Double" Mode="In" />
      <Parameter Name="y" Type="Decimal" Mode="In" />
    </Function>
    <Function Name="POWER" BuiltIn="true">
      <ReturnType Type="Decimal" />
      <Parameter Name="x" Type="Decimal" Mode="In" />
      <Parameter Name="y" Type="Decimal" Mode="In" />
    </Function>
    <Function Name="POWER" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="x" Type="Double" Mode="In" />
      <Parameter Name="y" Type="Double" Mode="In" />
    </Function>
    <Function Name="POWER" BuiltIn="true">
      <ReturnType Type="Int64" />
      <Parameter Name="x" Type="Int64" Mode="In" />
      <Parameter Name="y" Type="Decimal" Mode="In" />
    </Function>
    <Function Name="POWER" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="x" Type="Int32" Mode="In" />
      <Parameter Name="y" Type="Decimal" Mode="In" />
    </Function>
    <!-- RADIANS( arg )
                arg: tinyint, smallint, int, bigint, numeric, decimal, smallmoney, money, real, float
                returns: tinyint, smallint, int, bigint, numeric, decimal, smallmoney, money, real, float
        -->
    <Function Name="RADIANS" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="Int32" Mode="In" />
    </Function>
    <Function Name="RADIANS" BuiltIn="true">
      <ReturnType Type="Int64" />
      <Parameter Name="arg" Type="Int64" Mode="In" />
    </Function>
    <Function Name="RADIANS" BuiltIn="true">
      <ReturnType Type="Decimal" />
      <Parameter Name="arg" Type="Decimal" Mode="In" />
    </Function>
    <Function Name="RADIANS" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Double" Mode="In" />
    </Function>

    <!-- RAND( [seed] )
                seed: tinyint, smallint, int
                returns: float
        -->
    <Function Name="RAND" BuiltIn="true">
      <ReturnType Type="Double" />
    </Function>
    <Function Name="RAND" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="seed" Type="Int32" Mode="In" />
    </Function>

    <!-- ROUND( numeric_expression, length [ ,function ] )
                numeric_expression: tinyint, smallint, int, bigint, numeric, decimal, smallmoney, money, real, float
                length: tinyint, smallint, int
                function: tinyint, smallint, int
                returns: tinyint, smallint, int, bigint, numeric, decimal, smallmoney, money, real, float
        -->
    <Function Name="ROUND" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="numeric_expression" Type="Int32" Mode="In" />
      <Parameter Name="length" Type="Int32" Mode="In" />
    </Function>
    <Function Name="ROUND" BuiltIn="true">
      <ReturnType Type="Int64" />
      <Parameter Name="numeric_expression" Type="Int64" Mode="In" />
      <Parameter Name="length" Type="Int32" Mode="In" />
    </Function>
    <Function Name="ROUND" BuiltIn="true">
      <ReturnType Type="Decimal" />
      <Parameter Name="numeric_expression" Type="Decimal" Mode="In" />
      <Parameter Name="length" Type="Int32" Mode="In" />
    </Function>
    <Function Name="ROUND" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="numeric_expression" Type="Double" Mode="In" />
      <Parameter Name="length" Type="Int32" Mode="In" />
    </Function>
    <Function Name="ROUND" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="numeric_expression" Type="Int32" Mode="In" />
      <Parameter Name="length" Type="Int32" Mode="In" />
      <Parameter Name="function" Type="Int32" Mode="In" />
    </Function>
    <Function Name="ROUND" BuiltIn="true">
      <ReturnType Type="Int64" />
      <Parameter Name="numeric_expression" Type="Int64" Mode="In" />
      <Parameter Name="length" Type="Int32" Mode="In" />
      <Parameter Name="function" Type="Int32" Mode="In" />
    </Function>
    <Function Name="ROUND" BuiltIn="true">
      <ReturnType Type="Decimal" />
      <Parameter Name="numeric_expression" Type="Decimal" Mode="In" />
      <Parameter Name="length" Type="Int32" Mode="In" />
      <Parameter Name="function" Type="Int32" Mode="In" />
    </Function>
    <Function Name="ROUND" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="numeric_expression" Type="Double" Mode="In" />
      <Parameter Name="length" Type="Int32" Mode="In" />
      <Parameter Name="function" Type="Int32" Mode="In" />
    </Function>

    <!-- SIGN( arg )
            arg: tinyint, smallint, int, bigint, numeric, decimal, smallmoney, money, real, float
            returns: bigint, numeric, decimal, money, float
        -->
    <Function Name="SIGN" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="Int32" Mode="In" />
    </Function>
    <Function Name="SIGN" BuiltIn="true">
      <ReturnType Type="Int64" />
      <Parameter Name="arg" Type="Int64" Mode="In" />
    </Function>
    <Function Name="SIGN" BuiltIn="true">
      <ReturnType Type="Decimal" />
      <Parameter Name="arg" Type="Decimal" Mode="In" />
    </Function>
    <Function Name="SIGN" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Double" Mode="In" />
    </Function>

    <!-- SIN( arg )
                arg: float
                returns: float   
        -->
    <Function Name="SIN" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Decimal" Mode="In" />
    </Function>
    <Function Name="SIN" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Double" Mode="In" />
    </Function>

    <!-- SQRT( arg )
                arg: float
                returns: float   
        -->
    <Function Name="SQRT" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Double" Mode="In" />
    </Function>
    <Function Name="SQRT" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Decimal" Mode="In" />
    </Function>

    <!-- SQUARE( arg )
                arg: smalldatetime, datetime
                returns: int   
        -->
    <Function Name="SQUARE" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg1" Type="Double" Mode="In" />
    </Function>
    <Function Name="SQUARE" BuiltIn="true">
          <ReturnType Type="Double" />
          <Parameter Name="arg1" Type="Decimal" Mode="In" />
    </Function>
    <!-- TAN( arg )
                arg: float
                returns: float   
        -->
    <Function Name="TAN" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Double" Mode="In" />
    </Function>
    <Function Name="TAN" BuiltIn="true">
      <ReturnType Type="Double" />
      <Parameter Name="arg" Type="Decimal" Mode="In" />
    </Function>

      <!-- END MATH FUNCTIONS ######################################### -->


    <!-- BEGIN DATE FUNCTIONS ####################################### -->
    <!-- DATEADD 
                datepart: nvarchar
                number: tinyint, smallint, int, bigint, numeric, decimal, real, float
                date: smalldatetime, datetime, varchar, nvarchar, char, nchar
                returns: SMALLTIME, datetime   
        -->
    <Function Name="DATEADD" BuiltIn="true">
      <ReturnType Type="DateTime" />
      <Parameter Name="datepart" Type="String" Mode="In" />
      <Parameter Name="number" Type="Double" Mode="In" />
      <Parameter Name="date" Type="DateTime" Mode="In" />
    </Function>
    <Function Name="DATEADD" BuiltIn="true">
      <ReturnType Type="Time" />
      <Parameter Name="datepart" Type="String" Mode="In" />
      <Parameter Name="number" Type="Double" Mode="In" />
      <Parameter Name="time" Type="Time" Mode="In" />
    </Function>
    <Function Name="DATEADD" BuiltIn="true">
      <ReturnType Type="DateTimeOffset" />
      <Parameter Name="datepart" Type="String" Mode="In" />
      <Parameter Name="number" Type="Double" Mode="In" />
      <Parameter Name="datetimeoffset" Type="DateTimeOffset" Mode="In" />
    </Function>
    <Function Name="DATEADD" BuiltIn="true">
      <ReturnType Type="DateTime" />
      <Parameter Name="datepart" Type="String" Mode="In" />
      <Parameter Name="number" Type="Double" Mode="In" />
      <Parameter Name="date" Type="String" Mode="In" />
    </Function>

      <!-- DATEDIFF( datepart, startdate, enddate )
                datepart: nvarchar
                startdate: smalldatetime, datetime, char, nchar, varchar, nvarchar
                enddate: smalldatetime, datetime, char, nchar, varchar, nvarchar
                returns: int   
        -->
    <Function Name="DATEDIFF" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="datepart" Type="String" Mode="In" />
      <Parameter Name="startdate" Type="DateTime" Mode="In" />
      <Parameter Name="enddate" Type="DateTime" Mode="In" />
    </Function>
    <Function Name="DATEDIFF" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="datepart" Type="String" Mode="In" />
      <Parameter Name="startdate" Type="DateTimeOffset" Mode="In" />
      <Parameter Name="enddate" Type="DateTimeOffset" Mode="In" />
    </Function>
    <Function Name="DATEDIFF" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="datepart" Type="String" Mode="In" />
      <Parameter Name="startdate" Type="Time" Mode="In" />
      <Parameter Name="enddate" Type="Time" Mode="In" />
    </Function>
    <Function Name="DATEDIFF" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="datepart" Type="String" Mode="In" />
      <Parameter Name="startdate" Type="String" Mode="In" />
      <Parameter Name="enddate" Type="DateTime" Mode="In" />
    </Function>
    <Function Name="DATEDIFF" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="datepart" Type="String" Mode="In" />
      <Parameter Name="startdate" Type="String" Mode="In" />
      <Parameter Name="enddate" Type="DateTimeOffset" Mode="In" />
    </Function>
    <Function Name="DATEDIFF" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="datepart" Type="String" Mode="In" />
      <Parameter Name="startdate" Type="String" Mode="In" />
      <Parameter Name="enddate" Type="Time" Mode="In" />
    </Function>
    <Function Name="DATEDIFF" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="datepart" Type="String" Mode="In" />
      <Parameter Name="startdate" Type="Time" Mode="In" />
      <Parameter Name="enddate" Type="String" Mode="In" />
    </Function>
    <Function Name="DATEDIFF" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="datepart" Type="String" Mode="In" />
      <Parameter Name="startdate" Type="DateTime" Mode="In" />
      <Parameter Name="enddate" Type="String" Mode="In" />
    </Function>
    <Function Name="DATEDIFF" BuiltIn="true">
      <ReturnType Type="Int32" />
       <Parameter Name="datepart" Type="String" Mode="In" />
       <Parameter Name="startdate" Type="DateTimeOffset" Mode="In" />
       <Parameter Name="enddate" Type="String" Mode="In" />
    </Function>
    <Function Name="DATEDIFF" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="datepart" Type="String" Mode="In" />
      <Parameter Name="startdate" Type="String" Mode="In" />
      <Parameter Name="enddate" Type="String" Mode="In" />
    </Function>
    <Function Name="DATEDIFF" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="datepart" Type="String" Mode="In" />
      <Parameter Name="startdate" Type="Time" Mode="In" />
      <Parameter Name="enddate" Type="DateTime" Mode="In" />
    </Function>
    <Function Name="DATEDIFF" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="datepart" Type="String" Mode="In" />
      <Parameter Name="startdate" Type="Time" Mode="In" />
      <Parameter Name="enddate" Type="DateTimeOffset" Mode="In" />
    </Function>
    <Function Name="DATEDIFF" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="datepart" Type="String" Mode="In" />
      <Parameter Name="startdate" Type="DateTime" Mode="In" />
      <Parameter Name="enddate" Type="Time" Mode="In" />
    </Function>
    <Function Name="DATEDIFF" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="datepart" Type="String" Mode="In" />
      <Parameter Name="startdate" Type="DateTimeOffset" Mode="In" />
      <Parameter Name="enddate" Type="Time" Mode="In" />
    </Function>
    <Function Name="DATEDIFF" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="datepart" Type="String" Mode="In" />
      <Parameter Name="startdate" Type="DateTime" Mode="In" />
      <Parameter Name="enddate" Type="DateTimeOffset" Mode="In" />
    </Function>
    <Function Name="DATEDIFF" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="datepart" Type="String" Mode="In" />
      <Parameter Name="startdate" Type="DateTimeOffset" Mode="In" />
      <Parameter Name="enddate" Type="DateTime" Mode="In" />
    </Function>


      <!-- DATENAME( datepart, date )
            datepart: nvarchar
            date: smalldatetime, datetime, char, nchar, varchar, nvarchar
            returns: nvarchar   
        -->
    <Function Name="DATENAME" BuiltIn="true">
      <ReturnType Type="String" />
      <Parameter Name="datepart" Type="String" Mode="In" />
      <Parameter Name="date" Type="DateTime" Mode="In" />
    </Function>
    <Function Name="DATENAME" BuiltIn="true">
      <ReturnType Type="String" />
      <Parameter Name="datepart" Type="String" Mode="In" />
      <Parameter Name="date" Type="String" Mode="In" />
    </Function>
    <Function Name="DATENAME" BuiltIn="true">
      <ReturnType Type="String" />
      <Parameter Name="datepart" Type="String" Mode="In" />
      <Parameter Name="date" Type="Time" Mode="In" />
    </Function>
    <Function Name="DATENAME" BuiltIn="true">
      <ReturnType Type="String" />
      <Parameter Name="datepart" Type="String" Mode="In" />
      <Parameter Name="date" Type="DateTimeOffset" Mode="In" />
    </Function>
    <!-- DATEPART( datepart, date )
                datepart: nvarchar
                date: smalldatetime, datetime, char, nchar, varchar, nvarchar
                returns: int   
        -->
    <Function Name="DATEPART" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="datepart" Type="String" Mode="In" />
      <Parameter Name="date" Type="DateTime" Mode="In" />
    </Function>
    <Function Name="DATEPART" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="datepart" Type="String" Mode="In" />
      <Parameter Name="date" Type="DateTimeOffset" Mode="In" />
    </Function>
    <Function Name="DATEPART" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="datepart" Type="String" Mode="In" />
      <Parameter Name="date" Type="String" Mode="In" />
    </Function>
    <Function Name="DATEPART" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="datepart" Type="String" Mode="In" />
      <Parameter Name="date" Type="Time" Mode="In" />
    </Function>
    <!-- DAY( date )
            date: smalldatetime, datetime
            returns: int   
        -->
    <Function Name="DAY" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="date" Type="DateTime" Mode="In" />
    </Function>
    <Function Name="DAY" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="date" Type="DateTimeOffset" Mode="In" />
    </Function>
    <Function Name="DAY" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="date" Type="String" Mode="In" />
    </Function>
    <!-- GETDATE()
            returns: datetime   
        -->
    <Function Name="GETDATE" BuiltIn="true">
      <ReturnType Type="DateTime"/>
    </Function>

    <!-- SYSDATETIME()
            returns: datetime   
      -->
    <Function Name="SYSDATETIME" BuiltIn="true">
      <ReturnType Type="DateTime"/>
    </Function>

    <!-- SYSUTCDATETIME()
          returns: datetime   
    -->
    <Function Name="SYSUTCDATETIME" BuiltIn="true">
      <ReturnType Type="DateTime"/>
    </Function>
      
    <!-- SYSDATETIMEOFFSET()
            returns: datetime   
    -->
    <Function Name="SYSDATETIMEOFFSET" BuiltIn="true">
      <ReturnType Type="DateTimeOffset"/>
    </Function>

    <!-- GETUTCDATE()
         returns: datetime   
    -->
    <Function Name="GETUTCDATE" BuiltIn="true">
      <ReturnType Type="DateTime"/>
    </Function>

    <!-- MONTH( date )
                date: smalldatetime, datetime
                returns: int   
        -->
    <Function Name="MONTH" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="date" Type="DateTime" Mode="In" />
    </Function>
    <Function Name="MONTH" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="date" Type="DateTimeOffset" Mode="In" />
    </Function>
    <Function Name="MONTH" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="date" Type="String" Mode="In" />
    </Function>

    <!-- YEAR( date )
            date: smalldatetime, datetime
            returns: int   
        -->
    <Function Name="YEAR" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="date" Type="DateTime" Mode="In" />
    </Function>
    <Function Name="YEAR" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="date" Type="DateTimeOffset" Mode="In" />
    </Function>
    <Function Name="YEAR" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="date" Type="String" Mode="In" />
    </Function>
    <!-- END DATE FUNCTIONS ######################################### -->

    <!-- BEGIN SYSTEM FUNCTIONS ##################################### -->
    <!-- DATALENGTH( arg ) 
                arg: any
                returns: int, bigint  
        -->
    <Function Name="DATALENGTH" BuiltIn="true" ParameterTypeSemantics="AllowImplicitPromotion">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="Boolean" Mode="In" />
    </Function>
    <Function Name="DATALENGTH" BuiltIn="true" ParameterTypeSemantics="AllowImplicitPromotion">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="Double" Mode="In" />
    </Function>
    <Function Name="DATALENGTH" BuiltIn="true" ParameterTypeSemantics="AllowImplicitPromotion">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="Decimal" Mode="In" />
    </Function>
    <Function Name="DATALENGTH" BuiltIn="true" ParameterTypeSemantics="AllowImplicitPromotion">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="DateTime" Mode="In" />
    </Function>
    <Function Name="DATALENGTH" BuiltIn="true" ParameterTypeSemantics="AllowImplicitPromotion">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="Time" Mode="In" />
    </Function>
    <Function Name="DATALENGTH" BuiltIn="true" ParameterTypeSemantics="AllowImplicitPromotion">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="DateTimeOffset" Mode="In" />
    </Function>
    <Function Name="DATALENGTH" BuiltIn="true" ParameterTypeSemantics="AllowImplicitPromotion">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="String" Mode="In" />
    </Function>
    <Function Name="DATALENGTH" BuiltIn="true" ParameterTypeSemantics="AllowImplicitPromotion">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="Binary" Mode="In" />
    </Function>
    <Function Name="DATALENGTH" BuiltIn="true" ParameterTypeSemantics="AllowImplicitPromotion">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="Guid" Mode="In" />
    </Function>

    <!-- CHECKSUM -->
    <Function Name="CHECKSUM" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg1" Type="Boolean" Mode="In" />
    </Function>
    <Function Name="CHECKSUM" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg1" Type="Double" Mode="In" />
    </Function>
    <Function Name="CHECKSUM" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg1" Type="Decimal" Mode="In" />
    </Function>
    <Function Name="CHECKSUM" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg1" Type="String" Mode="In" />
    </Function>
    <Function Name="CHECKSUM" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg1" Type="DateTime" Mode="In" />
    </Function>
    <Function Name="CHECKSUM" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg1" Type="Time" Mode="In" />
    </Function>
    <Function Name="CHECKSUM" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg1" Type="DateTimeOffset" Mode="In" />
    </Function>
    <Function Name="CHECKSUM" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg1" Type="Binary" Mode="In" />
    </Function>
    <Function Name="CHECKSUM" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg1" Type="Guid" Mode="In" />
    </Function>
    <Function Name="CHECKSUM" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg1" Type="Boolean" Mode="In" />
      <Parameter Name="arg2" Type="Boolean" Mode="In" />
    </Function>
    <Function Name="CHECKSUM" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg1" Type="Double" Mode="In" />
      <Parameter Name="arg2" Type="Double" Mode="In" />
    </Function>
    <Function Name="CHECKSUM" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg1" Type="Decimal" Mode="In" />
      <Parameter Name="arg2" Type="Decimal" Mode="In" />
    </Function>
    <Function Name="CHECKSUM" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg1" Type="String" Mode="In" />
      <Parameter Name="arg2" Type="String" Mode="In" />
    </Function>
    <Function Name="CHECKSUM" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg1" Type="DateTime" Mode="In" />
      <Parameter Name="arg2" Type="DateTime" Mode="In" />
    </Function>
    <Function Name="CHECKSUM" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg1" Type="Time" Mode="In" />
      <Parameter Name="arg2" Type="Time" Mode="In" />
    </Function>
    <Function Name="CHECKSUM" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg1" Type="DateTimeOffset" Mode="In" />
      <Parameter Name="arg2" Type="DateTimeOffset" Mode="In" />
    </Function>
    <Function Name="CHECKSUM" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg1" Type="Binary" Mode="In" />
      <Parameter Name="arg2" Type="Binary" Mode="In" />
    </Function>
    <Function Name="CHECKSUM" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg1" Type="Guid" Mode="In" />
      <Parameter Name="arg2" Type="Guid" Mode="In" />
    </Function>
    <Function Name="CHECKSUM" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg1" Type="Boolean" Mode="In" />
      <Parameter Name="arg2" Type="Boolean" Mode="In" />
      <Parameter Name="arg3" Type="Boolean" Mode="In" />
    </Function>
    <Function Name="CHECKSUM" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg1" Type="Double" Mode="In" />
      <Parameter Name="arg2" Type="Double" Mode="In" />
      <Parameter Name="arg3" Type="Double" Mode="In" />
    </Function>
    <Function Name="CHECKSUM" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg1" Type="Decimal" Mode="In" />
      <Parameter Name="arg2" Type="Decimal" Mode="In" />
      <Parameter Name="arg3" Type="Decimal" Mode="In" />
    </Function>
    <Function Name="CHECKSUM" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg1" Type="String" Mode="In" />
      <Parameter Name="arg2" Type="String" Mode="In" />
      <Parameter Name="arg3" Type="String" Mode="In" />
    </Function>
    <Function Name="CHECKSUM" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg1" Type="DateTime" Mode="In" />
      <Parameter Name="arg2" Type="DateTime" Mode="In" />
      <Parameter Name="arg3" Type="DateTime" Mode="In" />
    </Function>
      <Function Name="CHECKSUM" BuiltIn="true">
          <ReturnType Type="Int32" />
          <Parameter Name="arg1" Type="DateTimeOffset" Mode="In" />
          <Parameter Name="arg2" Type="DateTimeOffset" Mode="In" />
          <Parameter Name="arg3" Type="DateTimeOffset" Mode="In" />
      </Function>
      <Function Name="CHECKSUM" BuiltIn="true">
          <ReturnType Type="Int32" />
          <Parameter Name="arg1" Type="Time" Mode="In" />
          <Parameter Name="arg2" Type="Time" Mode="In" />
          <Parameter Name="arg3" Type="Time" Mode="In" />
      </Function>
      <Function Name="CHECKSUM" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg1" Type="Binary" Mode="In" />
      <Parameter Name="arg2" Type="Binary" Mode="In" />
      <Parameter Name="arg3" Type="Binary" Mode="In" />
    </Function>
    <Function Name="CHECKSUM" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg1" Type="Guid" Mode="In" />
      <Parameter Name="arg2" Type="Guid" Mode="In" />
      <Parameter Name="arg3" Type="Guid" Mode="In" />
    </Function>

    <!-- NEWID() -->
    <Function Name="NEWID" BuiltIn="true">
      <ReturnType Type="Guid" />
    </Function>

    <!-- CURRENT_TIMESTAMP -->
    <Function Name="CURRENT_TIMESTAMP" BuiltIn="true" NiladicFunction="true">
      <ReturnType Type="DateTime" />
    </Function>

    <!-- CURRENT_USER -->
    <Function Name="CURRENT_USER" BuiltIn="true" NiladicFunction="true">
      <ReturnType Type="String" />
    </Function>

    <!-- HOST_NAME() -->
    <Function Name="HOST_NAME" BuiltIn="true">
      <ReturnType Type="String" />
    </Function>

    <!-- USER_NAME() -->
    <Function Name="USER_NAME" BuiltIn="true">
      <ReturnType Type="String" />
      <Parameter Name="arg" Type="Int32" Mode="In" />
    </Function>
    <Function Name="USER_NAME" BuiltIn="true">
      <ReturnType Type="String" />
    </Function>

    <!-- ISNUMERIC( arg ) //implicit conversion -->
    <Function Name="ISNUMERIC" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="String" Mode="In" />
    </Function>

    <!-- ISDATE( arg ) //implicit conversion -->
    <Function Name="ISDATE" BuiltIn="true">
      <ReturnType Type="Int32" />
      <Parameter Name="arg" Type="String" Mode="In" />
    </Function>
    <!-- END SYSTEM FUNCTIONS ####################################### -->
  </Functions>
</ProviderManifest>

Added System.Data.SQLite.Linq/Resources/SQLiteProviderServices.StoreSchemaDefinition.ssdl.











































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
<?xml version="1.0" encoding="utf-8"?>
<Schema Namespace="SQLite" Provider="System.Data.SQLite" ProviderManifestToken="SQLite" Alias="Self" xmlns="http://schemas.microsoft.com/ado/2006/04/edm/ssdl">
  <EntityContainer Name="Schema">
    <EntitySet Name="STables" EntityType="Self.Table">
      <DefiningQuery>
        SELECT
        '[' || TABLE_NAME || ']' [Id]
        ,   TABLE_CATALOG [CatalogName]
        ,   TABLE_SCHEMA [SchemaName]
        ,   TABLE_NAME    [Name]
        FROM
        TEMP.SCHEMATABLES
        WHERE
        TABLE_TYPE LIKE 'table'
      </DefiningQuery>
    </EntitySet>

    <EntitySet Name="STableColumns" EntityType="Self.TableColumn">
      <DefiningQuery>
        SELECT
        '[' || c.TABLE_NAME || ']' || '[' || c.COLUMN_NAME || ']' [Id]
        ,   '[' || c.TABLE_NAME || ']'                             [ParentId]
        ,   c.COLUMN_NAME   [Name]
        ,   c.ORDINAL_POSITION [Ordinal]
        ,   c.IS_NULLABLE [IsNullable]
        ,   c.EDM_TYPE [TypeName]
        ,   c.CHARACTER_MAXIMUM_LENGTH [MaxLength]
        ,   c.NUMERIC_PRECISION [Precision]
        ,   c.DATETIME_PRECISION [DateTimePrecision]
        ,   c.NUMERIC_SCALE [Scale]
        ,   c.COLLATION_CATALOG [CollationCatalog]
        ,   c.COLLATION_SCHEMA [CollationSchema]
        ,   c.COLLATION_NAME [CollationName]
        ,   c.CHARACTER_SET_CATALOG [CharacterSetCatalog]
        ,   c.CHARACTER_SET_SCHEMA [CharacterSetSchema]
        ,   c.CHARACTER_SET_NAME [CharacterSetName]
        ,   0 as [IsMultiSet]
        ,   c.PRIMARY_KEY as [IsIdentity]
        ,   0 as [IsStoreGenerated]
        , c.COLUMN_DEFAULT as [Default]
        FROM
        TEMP.SCHEMACOLUMNS c
      </DefiningQuery>
    </EntitySet>

    <EntitySet Name="SViews" EntityType="Self.View">
      <DefiningQuery>
        SELECT
        '[' || TABLE_NAME || ']' [Id]
        ,   TABLE_CATALOG             [CatalogName]
        ,   TABLE_SCHEMA              [SchemaName]
        ,   TABLE_NAME                [Name]
        ,   VIEW_DEFINITION           [ViewDefinition]
        ,   IS_UPDATABLE              [IsUpdatable]
        FROM
        TEMP.SCHEMAVIEWS
      </DefiningQuery>
    </EntitySet>

    <EntitySet Name="SViewColumns" EntityType="Self.ViewColumn">
      <DefiningQuery>
        SELECT
        '[' || c.TABLE_NAME || ']' || '[' || c.COLUMN_NAME || ']' [Id]
        ,   '[' || c.TABLE_NAME || ']'                             [ParentId]
        ,   c.COLUMN_NAME   [Name]
        ,   c.ORDINAL_POSITION [Ordinal]
        ,   c.IS_NULLABLE [IsNullable]
        ,   c.EDM_TYPE [TypeName]
        ,   c.CHARACTER_MAXIMUM_LENGTH [MaxLength]
        ,   c.NUMERIC_PRECISION [Precision]
        ,   c.DATETIME_PRECISION as [DateTimePrecision]
        ,   c.NUMERIC_SCALE [Scale]
        ,   c.COLLATION_CATALOG [CollationCatalog]
        ,   c.COLLATION_SCHEMA [CollationSchema]
        ,   c.COLLATION_NAME [CollationName]
        ,   c.CHARACTER_SET_CATALOG [CharacterSetCatalog]
        ,   c.CHARACTER_SET_SCHEMA [CharacterSetSchema]
        ,   c.CHARACTER_SET_NAME [CharacterSetName]
        ,   0 as [IsMultiSet]
        ,   c.PRIMARY_KEY as [IsIdentity]
        ,   0 as [IsStoreGenerated]
        ,   c.COLUMN_DEFAULT [Default]
        FROM
        TEMP.SCHEMAVIEWCOLUMNS c
      </DefiningQuery>
    </EntitySet>

    <EntitySet Name="SFunctions" EntityType="Self.Function">
      <DefiningQuery>
        SELECT
        NULL [Id]
        , NULL         [CatalogName]
        , NULL         [SchemaName]
        , NULL         [Name]
        , NULL         [ReturnTypeName]
        , NULL [ReturnMaxLength]
        , NULL        [ReturnPrecision]
        , NULL [ReturnDateTimePrecision]
        , NULL            [ReturnScale]
        , NULL        [ReturnCollationCatalog]
        , NULL         [ReturnCollationSchema]
        , NULL           [ReturnCollationName]
        , NULL    [ReturnCharacterSetCatalog]
        , NULL     [ReturnCharacterSetSchema]
        , NULL       [ReturnCharacterSetName]
        , NULL as        [ReturnIsMultiSet]
        , NULL as [IsAggregate]
        , NULL as [IsBuiltIn]
        , NULL as [IsNiladic]
        WHERE 1=2
      </DefiningQuery>
    </EntitySet>

    <EntitySet Name="SFunctionParameters" EntityType="Self.Parameter">
      <DefiningQuery>
        SELECT
        NULL [Id]
        , NULL [ParentId]
        , NULL [Name]
        , NULL [Ordinal]
        , NULL [TypeName]
        , NULL [MaxLength]
        , NULL [Precision]
        , NULL [DateTimePrecision]
        , NULL    [Scale]
        , NULL [CollationCatalog]
        , NULL [CollationSchema]
        , NULL [CollationName]
        , NULL [CharacterSetCatalog]
        , NULL [CharacterSetSchema]
        , NULL [CharacterSetName]
        , NULL [IsMultiSet]
        , NULL [Mode]
        , NULL [Default]
        WHERE 1=2
      </DefiningQuery>
    </EntitySet>

    <EntitySet Name="SProcedures" EntityType="Self.Procedure">
      <DefiningQuery>
        SELECT
        NULL [Id]
        , NULL         [CatalogName]
        , NULL          [SchemaName]
        , NULL            [Name]
        WHERE 1=2
      </DefiningQuery>
    </EntitySet>

    <EntitySet Name="SProcedureParameters" EntityType="Self.Parameter">
      <DefiningQuery>
        SELECT
        NULL [Id]
        , NULL [ParentId]
        , NULL [Name]
        , NULL [Ordinal]
        , NULL [TypeName]
        , NULL [MaxLength]
        , NULL [Precision]
        , NULL [DateTimePrecision]
        , NULL [Scale]
        , NULL [CollationCatalog]
        , NULL [CollationSchema]
        , NULL [CollationName]
        , NULL [CharacterSetCatalog]
        , NULL [CharacterSetSchema]
        , NULL [CharacterSetName]
        , NULL as [IsMultiSet]
        , NULL   [Mode]
        , NULL [Default]
        WHERE 1=2
      </DefiningQuery>
    </EntitySet>

    <EntitySet Name="SConstraints" EntityType="Self.Constraint">
      <DefiningQuery>
        SELECT
        '[' || tc.CONSTRAINT_NAME || ']' [Id]
        , '[' || tc.TABLE_NAME || ']' [ParentId]
        , tc.CONSTRAINT_NAME [Name]
        , tc.CONSTRAINT_TYPE [ConstraintType]
        , tc.IS_DEFERRABLE [IsDeferrable]
        , tc.INITIALLY_DEFERRED [IsInitiallyDeferred]
        FROM
        TEMP.SCHEMACONSTRAINTS tc
      </DefiningQuery>
    </EntitySet>

    <EntitySet Name="SCheckConstraints" EntityType="Self.CheckConstraint">
      <DefiningQuery>
        SELECT
        NULL [Id]
        , NULL [Expression]
        WHERE 1 = 2
      </DefiningQuery>
    </EntitySet>

    <EntitySet Name="SConstraintColumns" EntityType="Self.ConstraintColumn">
      <DefiningQuery>
        SELECT
        '[' || CONSTRAINT_NAME || ']' [ConstraintId]
        , '[' || TABLE_NAME || ']' || '[' || COLUMN_NAME    || ']' [ColumnId]
        FROM
        TEMP.SCHEMACONSTRAINTCOLUMNS
      </DefiningQuery>
    </EntitySet>

    <EntitySet Name="SForeignKeyConstraints" EntityType="Self.ForeignKeyConstraint">
      <DefiningQuery>
        SELECT
        '[' || rc.CONSTRAINT_NAME || ']' [Id]
        , 'NO ACTION' [UpdateRule]
        , 'NO ACTION' [DeleteRule]
        FROM
        TEMP.SCHEMAFOREIGNKEYS rc
      </DefiningQuery>
    </EntitySet>

    <EntitySet Name="SForeignKeys" EntityType="Self.ForeignKey">
      <DefiningQuery>
        SELECT
        '[' || FC.CONSTRAINT_NAME || ']' || '[' || FC.FKEY_FROM_ORDINAL_POSITION || ']' [Id]
        ,   '[' || FC.FKEY_TO_TABLE || ']' || '[' || FC.FKEY_TO_COLUMN || ']' [ToColumnId]
        ,   '[' || FC.TABLE_NAME || ']' || '[' || FC.FKEY_FROM_COLUMN || ']' [FromColumnId]
        ,   '[' || FC.CONSTRAINT_NAME || ']' [ConstraintId]
        ,   FC.FKEY_FROM_ORDINAL_POSITION [Ordinal]
        FROM
        TEMP.SCHEMAFOREIGNKEYS FC
      </DefiningQuery>
    </EntitySet>

    <EntitySet Name="SViewConstraints" EntityType="Self.ViewConstraint">
      <DefiningQuery>
        SELECT
        NULL   [Id]
        , NULL [ParentId]
        , NULL [Name]
        , NULL [ConstraintType]
        , NULL [IsDeferrable]
        , NULL [IsInitiallyDeferred]
        , NULL [Expression]
        , NULL  [UpdateRule]
        , NULL  [DeleteRule]
        WHERE 1=2
      </DefiningQuery>
    </EntitySet>

    <EntitySet Name="SViewConstraintColumns" EntityType="Self.ConstraintColumn">
      <DefiningQuery>
        SELECT
        NULL  [ConstraintId]
        , NULL [ColumnId]
        WHERE 1=2
      </DefiningQuery>
    </EntitySet>

    <EntitySet Name="SViewForeignKeys" EntityType="Self.ForeignKey">
      <DefiningQuery>
        SELECT
        NULL  [Id]
        ,  NULL [ToColumnId]
        ,  NULL [FromColumnId]
        ,  NULL  [ConstraintId]
        ,  0 [Ordinal]
        WHERE 1=2
      </DefiningQuery>
    </EntitySet>

    <AssociationSet Name="STableTableColumns" Association="Self.TableTableColumn" >
      <End Role="Parent" EntitySet="STables"/>
      <End Role="Column" EntitySet="STableColumns"/>
    </AssociationSet>
    <AssociationSet Name="STableConstraints" Association="Self.TableTableConstraint" >
      <End Role="Parent" EntitySet="STables"/>
      <End Role="Constraint" EntitySet="SConstraints"/>
    </AssociationSet>
    <AssociationSet Name="SConstraintConstraintColumns" Association="Self.ConstraintConstraintColumn" >
      <End Role="ConstraintColumn" EntitySet="SConstraintColumns"/>
      <End Role="Constraint" EntitySet="SConstraints"/>
    </AssociationSet>    
    <AssociationSet Name="SConstraintForeignKeys" Association="Self.ConstraintForeignKey" >
      <End Role="ForeignKey" EntitySet="SForeignKeys"/>
      <End Role="Constraint" EntitySet="SForeignKeyConstraints"/>
    </AssociationSet>
    <AssociationSet Name="SFromForeignKeyColumns" Association="Self.FromForeignKeyColumn" >
      <End Role="ForeignKey" EntitySet="SForeignKeys"/>
      <End Role="Column" EntitySet="STableColumns"/>
    </AssociationSet>
    <AssociationSet Name="SToForeignKeyColumns" Association="Self.ToForeignKeyColumn" >
      <End Role="ForeignKey" EntitySet="SForeignKeys"/>
      <End Role="Column" EntitySet="STableColumns"/>
    </AssociationSet>

    <AssociationSet Name="SViewViewColumns" Association="Self.ViewViewColumn" >
      <End Role="Parent" EntitySet="SViews"/>
      <End Role="Column" EntitySet="SViewColumns"/>
    </AssociationSet>
    <AssociationSet Name="SViewViewConstraints" Association="Self.ViewViewConstraint" >
      <End Role="Parent" EntitySet="SViews"/>
      <End Role="Constraint" EntitySet="SViewConstraints"/>
    </AssociationSet>
    <AssociationSet Name="SViewConstraintConstraintColumns" Association="Self.ViewConstraintConstraintColumn" >
      <End Role="ConstraintColumn" EntitySet="SViewConstraintColumns"/>
      <End Role="Constraint" EntitySet="SViewConstraints"/>
    </AssociationSet>
    <AssociationSet Name="SViewConstraintForeignKeys" Association="Self.ViewConstraintForeignKey" >
      <End Role="ForeignKey" EntitySet="SViewForeignKeys"/>
      <End Role="Constraint" EntitySet="SViewConstraints"/>
    </AssociationSet>
    <AssociationSet Name="SFromForeignKeyViewColumns" Association="Self.FromForeignKeyViewColumn" >
      <End Role="ForeignKey" EntitySet="SViewForeignKeys"/>
      <End Role="Column" EntitySet="SViewColumns"/>
    </AssociationSet>
    <AssociationSet Name="SToForeignKeyViewColumns" Association="Self.ToForeignKeyViewColumn" >
      <End Role="ForeignKey" EntitySet="SViewForeignKeys"/>
      <End Role="Column" EntitySet="SViewColumns"/>
    </AssociationSet>

    <AssociationSet Name="FunctionFunctionParameters" Association="Self.FunctionFunctionParameter">
      <End Role="Function" EntitySet="SFunctions"/>
      <End Role="Parameter" EntitySet="SFunctionParameters"/>
    </AssociationSet>
    <AssociationSet Name="ProcedureProcedureParameters" Association="Self.ProcedureProcedureParameter" >
      <End Role="Procedure" EntitySet="SProcedures"/>
      <End Role="Parameter" EntitySet="SProcedureParameters"/>
    </AssociationSet>

  </EntityContainer>

  <EntityType Name="Table">
    <Key>
      <PropertyRef Name="Id" />
    </Key>
    <Property Name="Id" Nullable="false" Type="nvarchar" />
    <Property Name="CatalogName" Type="nvarchar" />
    <Property Name="SchemaName" Type="nvarchar" />
    <Property Name="Name" Nullable="false" Type="nvarchar" />
  </EntityType>

  <EntityType Name="TableColumn" >
    <Key>
      <PropertyRef Name="Id" />
    </Key>
    <Property Name="Id" Nullable="false" Type="nvarchar"/>
    <Property Name="ParentId" Nullable="false" Type="nvarchar"/>
    <Property Name="Name" Nullable="false" Type="nvarchar"/>
    <Property Name="Ordinal" Nullable="false" Type="int" />
    <Property Name="IsNullable" Nullable="false" Type="bit" />
    <Property Name="TypeName" Nullable="false" Type="nvarchar" />
    <Property Name="MaxLength" Type="int" />
    <Property Name="Precision" Type="int" />
    <Property Name="DateTimePrecision" Type="int" />
    <Property Name="Scale" Type="int" />
    <Property Name="CollationCatalog" Type="nvarchar" />
    <Property Name="CollationSchema" Type="nvarchar" />
    <Property Name="CollationName" Type="nvarchar" />
    <Property Name="CharacterSetCatalog" Type="nvarchar" />
    <Property Name="CharacterSetSchema" Type="nvarchar" />
    <Property Name="CharacterSetName" Type="nvarchar" />
    <Property Name="IsMultiSet" Nullable="false" Type="bit" />
    <Property Name="IsIdentity" Nullable="false" Type="bit" />
    <Property Name="IsStoreGenerated" Nullable="false" Type="bit" />
    <Property Name="Default" Nullable="true" Type="nvarchar"/>
  </EntityType>

  <EntityType Name="View">
    <Key>
      <PropertyRef Name="Id" />
    </Key>
    <Property Name="Id" Nullable="false" Type="nvarchar" />
    <Property Name="CatalogName" Type="nvarchar" />
    <Property Name="SchemaName" Type="nvarchar" />
    <Property Name="Name" Nullable="false" Type="nvarchar" />
    <Property Name="ViewDefinition" Nullable="true" Type="nvarchar" />
    <Property Name="IsUpdatable" Nullable="false" Type="bit" />
  </EntityType>

  <EntityType Name="ViewColumn">
    <Key>
      <PropertyRef Name="Id" />
    </Key>
    <Property Name="Id" Nullable="false" Type="nvarchar"/>
    <Property Name="ParentId" Nullable="false" Type="nvarchar"/>
    <Property Name="Name" Nullable="false" Type="nvarchar"/>
    <Property Name="Ordinal" Nullable="false" Type="int" />
    <Property Name="IsNullable" Nullable="false" Type="bit" />
    <Property Name="TypeName" Nullable="false" Type="nvarchar" />
    <Property Name="MaxLength" Type="int" />
    <Property Name="Precision" Type="int" />
    <Property Name="DateTimePrecision" Type="int" />
    <Property Name="Scale" Type="int" />
    <Property Name="CollationCatalog" Type="nvarchar" />
    <Property Name="CollationSchema" Type="nvarchar" />
    <Property Name="CollationName" Type="nvarchar" />
    <Property Name="CharacterSetCatalog" Type="nvarchar" />
    <Property Name="CharacterSetSchema" Type="nvarchar" />
    <Property Name="CharacterSetName" Type="nvarchar" />
    <Property Name="IsMultiSet" Nullable="false" Type="bit" />
    <Property Name="IsIdentity" Nullable="false" Type="bit" />
    <Property Name="IsStoreGenerated" Nullable="false" Type="bit" />
    <Property Name="Default" Nullable="true" Type="nvarchar"/>
  </EntityType>

  <EntityType Name="Function">
    <Key>
      <PropertyRef Name="Id" />
    </Key>
    <Property Name="Id" Nullable="false" Type="nvarchar"/>
    <Property Name="CatalogName" Type="nvarchar"/>
    <Property Name="SchemaName" Type="nvarchar"/>
    <Property Name="Name" Nullable="false" Type="nvarchar"/>
    <Property Name="ReturnTypeName" Type="nvarchar" />
    <Property Name="ReturnMaxLength" Type="int" />
    <Property Name="ReturnPrecision" Type="int" />
    <Property Name="ReturnDateTimePrecision" Type="int" />
    <Property Name="ReturnScale" Type="int" />
    <Property Name="ReturnCollationCatalog" Type="nvarchar" />
    <Property Name="ReturnCollationSchema" Type="nvarchar" />
    <Property Name="ReturnCollationName" Type="nvarchar" />
    <Property Name="ReturnCharacterSetCatalog" Type="nvarchar" />
    <Property Name="ReturnCharacterSetSchema" Type="nvarchar" />
    <Property Name="ReturnCharacterSetName" Type="nvarchar" />
    <Property Name="ReturnIsMultiSet" Nullable="false" Type="bit" />
    <Property Name="IsAggregate" Type="bit" />
    <Property Name="IsBuiltIn" Type="bit" />
    <Property Name="IsNiladic" Type="bit" />
  </EntityType>

  <EntityType Name="Procedure">
    <Key>
      <PropertyRef Name="Id" />
    </Key>
    <Property Name="Id" Nullable="false" Type="nvarchar"/>
    <Property Name="CatalogName" Type="nvarchar"/>
    <Property Name="SchemaName" Type="nvarchar"/>
    <Property Name="Name" Nullable="false" Type="nvarchar"/>
  </EntityType>

  <EntityType Name="Parameter">
    <Key>
      <PropertyRef Name="Id" />
    </Key>
    <Property Name="Id" Nullable="false" Type="nvarchar"/>
    <Property Name="ParentId" Nullable="false" Type="nvarchar"/>
    <Property Name="Name" Nullable="false" Type="nvarchar" />
    <Property Name="Ordinal" Nullable="false" Type="int"/>
    <Property Name="TypeName" Nullable="false" Type="nvarchar" />
    <Property Name="MaxLength" Nullable="true" Type="int" />
    <Property Name="Precision" Nullable="true" Type="int" />
    <Property Name="DateTimePrecision" Type="int" />
    <Property Name="Scale" Nullable="true" Type="int" />
    <Property Name="CollationCatalog" Type="nvarchar" />
    <Property Name="CollationSchema" Type="nvarchar" />
    <Property Name="CollationName" Type="nvarchar" />
    <Property Name="CharacterSetCatalog" Type="nvarchar" />
    <Property Name="CharacterSetSchema" Type="nvarchar" />
    <Property Name="CharacterSetName" Type="nvarchar" />
    <Property Name="IsMultiSet" Nullable="false" Type="bit" />
    <Property Name="Mode" Type="nvarchar" />
    <Property Name="Default" Type="nvarchar" />
  </EntityType>

  <EntityType Name="Constraint">
    <Key>
      <PropertyRef Name="Id" />
    </Key>
    <Property Name="Id" Nullable="false" Type="nvarchar" />
    <Property Name="ParentId" Nullable="false" Type="nvarchar" />
    <Property Name="Name" Nullable="false" Type="nvarchar" />
    <Property Name="IsDeferrable" Nullable="false" Type="bit" />
    <Property Name="IsInitiallyDeferred" Nullable="false" Type="bit" />
    <Property Name="ConstraintType" Nullable="false" Type="nvarchar" />
  </EntityType>

  <EntityType Name="CheckConstraint">
    <Key>
      <PropertyRef Name="Id" />
    </Key>
    <Property Name="Id" Nullable="false" Type="nvarchar" />
    <Property Name="Expression" Nullable="true" Type="nvarchar" />
  </EntityType>
  
  <EntityType Name="ConstraintColumn">
    <Key>
      <PropertyRef Name="ConstraintId" />
      <PropertyRef Name="ColumnId" />
    </Key>
    <Property Name="ConstraintId" Nullable="false" Type="nvarchar" />
    <Property Name="ColumnId" Nullable="false" Type="nvarchar" />
  </EntityType>

  <EntityType Name="ForeignKeyConstraint">
    <Key>
      <PropertyRef Name="Id" />
    </Key>
    <Property Name="Id" Nullable="false" Type="nvarchar" />
    <Property Name="UpdateRule" Nullable="false" Type="nvarchar" />
    <Property Name="DeleteRule" Nullable="false" Type="nvarchar" />
  </EntityType>

  <EntityType Name="ForeignKey">
    <Key>
      <PropertyRef Name="Id" />
    </Key>
    <Property Name="Id" Nullable="false" Type="nvarchar" />
    <Property Name="Ordinal" Nullable="false" Type="int" />
    <Property Name="ConstraintId" Nullable="false" Type="nvarchar" />
    <Property Name="FromColumnId" Nullable="false" Type="nvarchar" />
    <Property Name="ToColumnId" Nullable="false" Type="nvarchar" />
  </EntityType>

  <EntityType Name="ViewConstraint">
    <Key>
      <PropertyRef Name="Id" />
    </Key>
    <Property Name="Id" Nullable="false" Type="nvarchar" />
    <Property Name="ParentId" Nullable="false" Type="nvarchar" />
    <Property Name="Name" Nullable="false" Type="nvarchar" />
    <Property Name="IsDeferrable" Nullable="false" Type="bit" />
    <Property Name="IsInitiallyDeferred" Nullable="false" Type="bit" />
    <Property Name="ConstraintType" Nullable="false" Type="nvarchar" />
    <Property Name="Expression" Nullable="true" Type="nvarchar" />
    <Property Name="UpdateRule" Nullable="true" Type="nvarchar" />
    <Property Name="DeleteRule" Nullable="true" Type="nvarchar" />
  </EntityType>

  <Association Name="TableTableConstraint">
    <End Type="Self.Table" Role="Parent" Multiplicity="1" />
    <End Type="Self.Constraint" Role="Constraint" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Parent">
        <PropertyRef Name="Id" />
      </Principal>
      <Dependent Role="Constraint">
        <PropertyRef Name="ParentId" />
      </Dependent>
    </ReferentialConstraint>
  </Association>

  <Association Name="ConstraintConstraintColumn">
    <End Type="Self.Constraint" Role="Constraint" Multiplicity="1" />
    <End Type="Self.ConstraintColumn" Role="ConstraintColumn" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Constraint">
        <PropertyRef Name="Id" />
      </Principal>
      <Dependent Role="ConstraintColumn">
        <PropertyRef Name="ConstraintId" />
      </Dependent>
    </ReferentialConstraint>
  </Association>

  <Association Name="ConstraintForeignKey">
    <End Type="Self.ForeignKeyConstraint" Role="Constraint" Multiplicity="1" />
    <End Type="Self.ForeignKey" Role="ForeignKey" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Constraint">
        <PropertyRef Name="Id" />
      </Principal>
      <Dependent Role="ForeignKey">
        <PropertyRef Name="ConstraintId" />
      </Dependent>
    </ReferentialConstraint>
  </Association>

  <Association Name="FromForeignKeyColumn">
    <End Type="Self.TableColumn" Role="Column" Multiplicity="1" />
    <End Type="Self.ForeignKey" Role="ForeignKey" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Column">
        <PropertyRef Name="Id" />
      </Principal>
      <Dependent Role="ForeignKey">
        <PropertyRef Name="FromColumnId" />
      </Dependent>
    </ReferentialConstraint>
  </Association>

  <Association Name="ToForeignKeyColumn">
    <End Type="Self.TableColumn" Role="Column" Multiplicity="1" />
    <End Type="Self.ForeignKey" Role="ForeignKey" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Column">
        <PropertyRef Name="Id" />
      </Principal>
      <Dependent Role="ForeignKey">
        <PropertyRef Name="ToColumnId" />
      </Dependent>
    </ReferentialConstraint>
  </Association>

  <Association Name="TableTableColumn">
    <End Type="Self.Table" Role="Parent" Multiplicity="1" />
    <End Type="Self.TableColumn" Role="Column" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Parent">
        <PropertyRef Name="Id" />
      </Principal>
      <Dependent Role="Column">
        <PropertyRef Name="ParentId" />
      </Dependent>
    </ReferentialConstraint>
  </Association>

  <Association Name="ViewViewColumn">
    <End Type="Self.View" Role="Parent" Multiplicity="1" />
    <End Type="Self.ViewColumn" Role="Column" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Parent">
        <PropertyRef Name="Id" />
      </Principal>
      <Dependent Role="Column">
        <PropertyRef Name="ParentId" />
      </Dependent>
    </ReferentialConstraint>
  </Association>

  <Association Name="FunctionFunctionParameter">
    <End Type="Self.Function" Role="Function" Multiplicity="1" />
    <End Type="Self.Parameter" Role="Parameter" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Function">
        <PropertyRef Name="Id" />
      </Principal>
      <Dependent Role="Parameter">
        <PropertyRef Name="ParentId" />
      </Dependent>
    </ReferentialConstraint>
  </Association>

  <Association Name="ProcedureProcedureParameter">
    <End Type="Self.Procedure" Role="Procedure" Multiplicity="1" />
    <End Type="Self.Parameter" Role="Parameter" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Procedure">
        <PropertyRef Name="Id" />
      </Principal>
      <Dependent Role="Parameter">
        <PropertyRef Name="ParentId" />
      </Dependent>
    </ReferentialConstraint>
  </Association>

  <Association Name="ViewViewConstraint">
    <End Type="Self.View" Role="Parent" Multiplicity="1" />
    <End Type="Self.ViewConstraint" Role="Constraint" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Parent">
        <PropertyRef Name="Id" />
      </Principal>
      <Dependent Role="Constraint">
        <PropertyRef Name="ParentId" />
      </Dependent>
    </ReferentialConstraint>
  </Association>

  <Association Name="ViewConstraintConstraintColumn">
    <End Type="Self.ViewConstraint" Role="Constraint" Multiplicity="1" />
    <End Type="Self.ConstraintColumn" Role="ConstraintColumn" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Constraint">
        <PropertyRef Name="Id" />
      </Principal>
      <Dependent Role="ConstraintColumn">
        <PropertyRef Name="ConstraintId" />
      </Dependent>
    </ReferentialConstraint>
  </Association>

  <Association Name="ViewConstraintForeignKey">
    <End Type="Self.ViewConstraint" Role="Constraint" Multiplicity="1" />
    <End Type="Self.ForeignKey" Role="ForeignKey" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Constraint">
        <PropertyRef Name="Id" />
      </Principal>
      <Dependent Role="ForeignKey">
        <PropertyRef Name="ConstraintId" />
      </Dependent>
    </ReferentialConstraint>
  </Association>

  <Association Name="FromForeignKeyViewColumn">
    <End Type="Self.ViewColumn" Role="Column" Multiplicity="1" />
    <End Type="Self.ForeignKey" Role="ForeignKey" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Column">
        <PropertyRef Name="Id" />
      </Principal>
      <Dependent Role="ForeignKey">
        <PropertyRef Name="FromColumnId" />
      </Dependent>
    </ReferentialConstraint>
  </Association>

  <Association Name="ToForeignKeyViewColumn">
    <End Type="Self.ViewColumn" Role="Column" Multiplicity="1" />
    <End Type="Self.ForeignKey" Role="ForeignKey" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Column">
        <PropertyRef Name="Id" />
      </Principal>
      <Dependent Role="ForeignKey">
        <PropertyRef Name="ToColumnId" />
      </Dependent>
    </ReferentialConstraint>
  </Association>

</Schema>

Added System.Data.SQLite.Linq/Resources/SQLiteProviderServices.StoreSchemaMapping.msl.









































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
<?xml version="1.0" encoding="utf-8"?>
<Mapping xmlns:cs="urn:schemas-microsoft-com:windows:storage:mapping:CS" Space="C-S" xmlns="urn:schemas-microsoft-com:windows:storage:mapping:CS">
  <cs:EntityContainerMapping StorageEntityContainer="Schema" CdmEntityContainer="SchemaInformation">

    <cs:EntitySetMapping Name="Tables" StoreEntitySet="STables" TypeName="Store.Table">
      <cs:ScalarProperty Name="Id" ColumnName="Id" />
      <cs:ScalarProperty Name="CatalogName" ColumnName="CatalogName" />
      <cs:ScalarProperty Name="SchemaName" ColumnName="SchemaName" />
      <cs:ScalarProperty Name="Name" ColumnName="Name" />
    </cs:EntitySetMapping>

    <cs:EntitySetMapping Name="TableColumns" StoreEntitySet="STableColumns" TypeName="Store.Column">
      <cs:ScalarProperty Name="Id" ColumnName="Id" />
      <cs:ScalarProperty Name="Name" ColumnName="Name" />
      <cs:ScalarProperty Name="Ordinal" ColumnName="Ordinal" />
      <cs:ScalarProperty Name="IsNullable" ColumnName="IsNullable" />
      <cs:ComplexProperty Name="ColumnType">
        <cs:ScalarProperty Name="TypeName" ColumnName="TypeName" />
        <cs:ScalarProperty Name="MaxLength" ColumnName="MaxLength" />
        <cs:ScalarProperty Name="DateTimePrecision" ColumnName="DateTimePrecision" />
        <cs:ScalarProperty Name="Precision" ColumnName="Precision" />
        <cs:ScalarProperty Name="Scale" ColumnName="Scale" />
        <cs:ComplexProperty Name="Collation">
          <cs:ScalarProperty Name="CatalogName" ColumnName="CollationCatalog" />
          <cs:ScalarProperty Name="SchemaName" ColumnName="CollationSchema" />
          <cs:ScalarProperty Name="Name" ColumnName="CollationName" />
        </cs:ComplexProperty>
        <cs:ComplexProperty Name="CharacterSet">
          <cs:ScalarProperty Name="CatalogName" ColumnName="CharacterSetCatalog" />
          <cs:ScalarProperty Name="SchemaName" ColumnName="CharacterSetSchema" />
          <cs:ScalarProperty Name="Name" ColumnName="CharacterSetName" />
        </cs:ComplexProperty>
        <cs:ScalarProperty Name="IsMultiSet" ColumnName="IsMultiSet" />
      </cs:ComplexProperty>
      <cs:ScalarProperty Name="IsIdentity" ColumnName="IsIdentity" />
      <cs:ScalarProperty Name="IsStoreGenerated" ColumnName="IsStoreGenerated" />
      <cs:ScalarProperty Name="Default" ColumnName="Default" />
    </cs:EntitySetMapping>

    <cs:EntitySetMapping Name="Views" StoreEntitySet="SViews" TypeName="Store.View">
      <cs:ScalarProperty Name="Id" ColumnName="Id" />
      <cs:ScalarProperty Name="CatalogName" ColumnName="CatalogName" />
      <cs:ScalarProperty Name="SchemaName" ColumnName="SchemaName" />
      <cs:ScalarProperty Name="Name" ColumnName="Name" />
      <cs:ScalarProperty Name="ViewDefinition" ColumnName="ViewDefinition" />
      <cs:ScalarProperty Name="IsUpdatable" ColumnName="IsUpdatable" />
    </cs:EntitySetMapping>

    <cs:EntitySetMapping Name="ViewColumns" StoreEntitySet="SViewColumns" TypeName="Store.Column">
      <cs:ScalarProperty Name="Id" ColumnName="Id" />
      <cs:ScalarProperty Name="Name" ColumnName="Name" />
      <cs:ScalarProperty Name="Ordinal" ColumnName="Ordinal" />
      <cs:ScalarProperty Name="IsNullable" ColumnName="IsNullable" />
      <cs:ComplexProperty Name="ColumnType">
        <cs:ScalarProperty Name="TypeName" ColumnName="TypeName" />
        <cs:ScalarProperty Name="MaxLength" ColumnName="MaxLength" />
        <cs:ScalarProperty Name="Precision" ColumnName="Precision" />
        <cs:ScalarProperty Name="DateTimePrecision" ColumnName="DateTimePrecision" />
        <cs:ScalarProperty Name="Scale" ColumnName="Scale" />
        <cs:ComplexProperty Name="Collation">
          <cs:ScalarProperty Name="CatalogName" ColumnName="CollationCatalog" />
          <cs:ScalarProperty Name="SchemaName" ColumnName="CollationSchema" />
          <cs:ScalarProperty Name="Name" ColumnName="CollationName" />
        </cs:ComplexProperty>
        <cs:ComplexProperty Name="CharacterSet">
          <cs:ScalarProperty Name="CatalogName" ColumnName="CharacterSetCatalog" />
          <cs:ScalarProperty Name="SchemaName" ColumnName="CharacterSetSchema" />
          <cs:ScalarProperty Name="Name" ColumnName="CharacterSetName" />
        </cs:ComplexProperty>
        <cs:ScalarProperty Name="IsMultiSet" ColumnName="IsMultiSet" />
      </cs:ComplexProperty>
      <cs:ScalarProperty Name="IsIdentity" ColumnName="IsIdentity" />
      <cs:ScalarProperty Name="IsStoreGenerated" ColumnName="IsStoreGenerated" />
      <cs:ScalarProperty Name="Default" ColumnName="Default" />
    </cs:EntitySetMapping>

    <cs:EntitySetMapping Name="Functions" TypeName="Store.ScalarFunction" StoreEntitySet="SFunctions">
      <cs:ScalarProperty Name="Id" ColumnName="Id" />
      <cs:ScalarProperty Name="CatalogName" ColumnName="CatalogName" />
      <cs:ScalarProperty Name="SchemaName" ColumnName="SchemaName" />
      <cs:ScalarProperty Name="Name" ColumnName="Name" />
      <cs:ComplexProperty Name="ReturnType">
        <cs:ScalarProperty Name="TypeName" ColumnName="ReturnTypeName" />
        <cs:ScalarProperty Name="MaxLength" ColumnName="ReturnMaxLength" />
        <cs:ScalarProperty Name="Precision" ColumnName="ReturnPrecision" />
        <cs:ScalarProperty Name="DateTimePrecision" ColumnName="ReturnDateTimePrecision" />
        <cs:ScalarProperty Name="Scale" ColumnName="ReturnScale" />
        <cs:ComplexProperty Name="Collation">
          <cs:ScalarProperty Name="CatalogName" ColumnName="ReturnCollationCatalog" />
          <cs:ScalarProperty Name="SchemaName" ColumnName="ReturnCollationSchema" />
          <cs:ScalarProperty Name="Name" ColumnName="ReturnCollationName" />
        </cs:ComplexProperty>
        <cs:ComplexProperty Name="CharacterSet">
          <cs:ScalarProperty Name="CatalogName" ColumnName="ReturnCharacterSetCatalog" />
          <cs:ScalarProperty Name="SchemaName" ColumnName="ReturnCharacterSetSchema" />
          <cs:ScalarProperty Name="Name" ColumnName="ReturnCharacterSetName" />
        </cs:ComplexProperty>
        <cs:ScalarProperty Name="IsMultiSet" ColumnName="ReturnIsMultiSet" />
      </cs:ComplexProperty>
      <cs:ScalarProperty Name="IsAggregate" ColumnName="IsAggregate" />
      <cs:ScalarProperty Name="IsBuiltIn" ColumnName="IsBuiltIn" />
      <cs:ScalarProperty Name="IsNiladic" ColumnName="IsNiladic" />
    </cs:EntitySetMapping>

    <cs:EntitySetMapping Name="FunctionParameters" TypeName="Store.Parameter" StoreEntitySet="SFunctionParameters">
      <cs:ScalarProperty Name="Id" ColumnName="Id" />
      <cs:ScalarProperty Name="Name" ColumnName="Name" />
      <cs:ScalarProperty Name="Ordinal" ColumnName="Ordinal" />
      <cs:ComplexProperty Name="ParameterType">
        <cs:ScalarProperty Name="TypeName" ColumnName="TypeName" />
        <cs:ScalarProperty Name="MaxLength" ColumnName="MaxLength" />
        <cs:ScalarProperty Name="DateTimePrecision" ColumnName="DateTimePrecision" />
        <cs:ScalarProperty Name="Precision" ColumnName="Precision" />
        <cs:ScalarProperty Name="Scale" ColumnName="Scale" />
        <cs:ComplexProperty Name="Collation">
          <cs:ScalarProperty Name="CatalogName" ColumnName="CollationCatalog" />
          <cs:ScalarProperty Name="SchemaName" ColumnName="CollationSchema" />
          <cs:ScalarProperty Name="Name" ColumnName="CollationName" />
        </cs:ComplexProperty>
        <cs:ComplexProperty Name="CharacterSet">
          <cs:ScalarProperty Name="CatalogName" ColumnName="CharacterSetCatalog" />
          <cs:ScalarProperty Name="SchemaName" ColumnName="CharacterSetSchema" />
          <cs:ScalarProperty Name="Name" ColumnName="CharacterSetName" />
        </cs:ComplexProperty>
        <cs:ScalarProperty Name="IsMultiSet" ColumnName="IsMultiSet" />
      </cs:ComplexProperty>
      <cs:ScalarProperty Name="Mode" ColumnName="Mode" />
      <cs:ScalarProperty Name="Default" ColumnName="Default" />
    </cs:EntitySetMapping>

    <cs:EntitySetMapping Name="Procedures" TypeName="Store.Procedure" StoreEntitySet="SProcedures">
      <cs:ScalarProperty Name="Id" ColumnName="Id" />
      <cs:ScalarProperty Name="CatalogName" ColumnName="CatalogName" />
      <cs:ScalarProperty Name="SchemaName" ColumnName="SchemaName" />
      <cs:ScalarProperty Name="Name" ColumnName="Name" />
    </cs:EntitySetMapping>

    <cs:EntitySetMapping Name="ProcedureParameters" TypeName="Store.Parameter" StoreEntitySet="SProcedureParameters">
      <cs:ScalarProperty Name="Id" ColumnName="Id" />
      <cs:ScalarProperty Name="Name" ColumnName="Name" />
      <cs:ScalarProperty Name="Ordinal" ColumnName="Ordinal" />
      <cs:ComplexProperty Name="ParameterType">
        <cs:ScalarProperty Name="TypeName" ColumnName="TypeName" />
        <cs:ScalarProperty Name="MaxLength" ColumnName="MaxLength" />
        <cs:ScalarProperty Name="DateTimePrecision" ColumnName="DateTimePrecision" />
        <cs:ScalarProperty Name="Precision" ColumnName="Precision" />
        <cs:ScalarProperty Name="Scale" ColumnName="Scale" />
        <cs:ComplexProperty Name="Collation">
          <cs:ScalarProperty Name="CatalogName" ColumnName="CollationCatalog" />
          <cs:ScalarProperty Name="SchemaName" ColumnName="CollationSchema" />
          <cs:ScalarProperty Name="Name" ColumnName="CollationName" />
        </cs:ComplexProperty>
        <cs:ComplexProperty Name="CharacterSet">
          <cs:ScalarProperty Name="CatalogName" ColumnName="CharacterSetCatalog" />
          <cs:ScalarProperty Name="SchemaName" ColumnName="CharacterSetSchema" />
          <cs:ScalarProperty Name="Name" ColumnName="CharacterSetName" />
        </cs:ComplexProperty>
        <cs:ScalarProperty Name="IsMultiSet" ColumnName="IsMultiSet" />
      </cs:ComplexProperty>
      <cs:ScalarProperty Name="Mode" ColumnName="Mode" />
      <cs:ScalarProperty Name="Default" ColumnName="Default" />
    </cs:EntitySetMapping>

    <cs:EntitySetMapping Name="TableConstraints" >
      <cs:EntityTypeMapping TypeName="IsTypeOf(Store.Constraint)">
        <cs:MappingFragment StoreEntitySet="SConstraints">
          <cs:ScalarProperty Name="Id" ColumnName="Id" />
          <cs:ScalarProperty Name="Name" ColumnName="Name" />
          <cs:ScalarProperty Name="IsDeferrable" ColumnName="IsDeferrable" />
          <cs:ScalarProperty Name="IsInitiallyDeferred" ColumnName="IsInitiallyDeferred" />
        </cs:MappingFragment>
      </cs:EntityTypeMapping>
      <cs:EntityTypeMapping TypeName="Store.UniqueConstraint">
          <cs:MappingFragment StoreEntitySet="SConstraints">
          <cs:ScalarProperty Name="Id" ColumnName="Id" />
          <cs:Condition ColumnName="ConstraintType" Value="UNIQUE"/>
        </cs:MappingFragment>
      </cs:EntityTypeMapping>
      <cs:EntityTypeMapping TypeName="Store.CheckConstraint">
        <cs:MappingFragment StoreEntitySet="SConstraints">
          <cs:ScalarProperty Name="Id" ColumnName="Id" />
          <cs:Condition ColumnName="ConstraintType" Value="CHECK"/>
        </cs:MappingFragment>
        <cs:MappingFragment StoreEntitySet="SCheckConstraints">
          <cs:ScalarProperty Name="Id" ColumnName="Id" />
          <cs:ScalarProperty Name="Expression" ColumnName="Expression" />
        </cs:MappingFragment>
      </cs:EntityTypeMapping>
      <cs:EntityTypeMapping TypeName="Store.PrimaryKeyConstraint">
        <cs:MappingFragment StoreEntitySet="SConstraints">
          <cs:ScalarProperty Name="Id" ColumnName="Id" />
          <cs:Condition ColumnName="ConstraintType" Value="PRIMARY KEY"/>
        </cs:MappingFragment>
      </cs:EntityTypeMapping>
      <cs:EntityTypeMapping TypeName="Store.ForeignKeyConstraint">
        <cs:MappingFragment StoreEntitySet="SConstraints">
          <cs:ScalarProperty Name="Id" ColumnName="Id" />
          <cs:Condition ColumnName="ConstraintType" Value="FOREIGN KEY"/>
        </cs:MappingFragment>
        <cs:MappingFragment StoreEntitySet="SForeignKeyConstraints">
          <cs:ScalarProperty Name="Id" ColumnName="Id" />
          <cs:ScalarProperty Name="UpdateRule" ColumnName="UpdateRule" />
          <cs:ScalarProperty Name="DeleteRule" ColumnName="DeleteRule" />
        </cs:MappingFragment>
      </cs:EntityTypeMapping>
    </cs:EntitySetMapping>

    <cs:EntitySetMapping Name="ViewConstraints" >
      <cs:EntityTypeMapping TypeName="Store.UniqueConstraint" >
        <cs:MappingFragment StoreEntitySet="SViewConstraints">
          <cs:ScalarProperty Name="Id" ColumnName="Id" />
          <cs:ScalarProperty Name="Name" ColumnName="Name" />
          <cs:ScalarProperty Name="IsDeferrable" ColumnName="IsDeferrable" />
          <cs:ScalarProperty Name="IsInitiallyDeferred" ColumnName="IsInitiallyDeferred" />
          <cs:Condition ColumnName="ConstraintType" Value="UNIQUE"/>
        </cs:MappingFragment>
      </cs:EntityTypeMapping>
      <cs:EntityTypeMapping TypeName="Store.CheckConstraint" >
        <cs:MappingFragment StoreEntitySet="SViewConstraints">
          <cs:ScalarProperty Name="Id" ColumnName="Id" />
          <cs:ScalarProperty Name="Name" ColumnName="Name" />
          <cs:ScalarProperty Name="IsDeferrable" ColumnName="IsDeferrable" />
          <cs:ScalarProperty Name="IsInitiallyDeferred" ColumnName="IsInitiallyDeferred" />
          <cs:ScalarProperty Name="Expression" ColumnName="Expression" />
          <cs:Condition ColumnName="ConstraintType" Value="CHECK"/>
        </cs:MappingFragment>
      </cs:EntityTypeMapping>
      <cs:EntityTypeMapping TypeName="Store.PrimaryKeyConstraint" >
        <cs:MappingFragment StoreEntitySet="SViewConstraints">
          <cs:ScalarProperty Name="Id" ColumnName="Id" />
          <cs:ScalarProperty Name="Name" ColumnName="Name" />
          <cs:ScalarProperty Name="IsDeferrable" ColumnName="IsDeferrable" />
          <cs:ScalarProperty Name="IsInitiallyDeferred" ColumnName="IsInitiallyDeferred" />
          <cs:Condition ColumnName="ConstraintType" Value="PRIMARY KEY"/>
        </cs:MappingFragment>
      </cs:EntityTypeMapping>
      <cs:EntityTypeMapping TypeName="Store.ForeignKeyConstraint" >
        <cs:MappingFragment StoreEntitySet="SViewConstraints">
          <cs:ScalarProperty Name="Id" ColumnName="Id" />
          <cs:ScalarProperty Name="Name" ColumnName="Name" />
          <cs:ScalarProperty Name="IsDeferrable" ColumnName="IsDeferrable" />
          <cs:ScalarProperty Name="IsInitiallyDeferred" ColumnName="IsInitiallyDeferred" />
          <cs:ScalarProperty Name="UpdateRule" ColumnName="UpdateRule" />
          <cs:ScalarProperty Name="DeleteRule" ColumnName="DeleteRule" />
          <cs:Condition ColumnName="ConstraintType" Value="FOREIGN KEY"/>
        </cs:MappingFragment>
      </cs:EntityTypeMapping>
    </cs:EntitySetMapping>

    <cs:EntitySetMapping Name="TableForeignKeys" StoreEntitySet="SForeignKeys" TypeName="Store.ForeignKey">
      <cs:ScalarProperty Name="Id" ColumnName="Id" />
      <cs:ScalarProperty Name="Ordinal" ColumnName="Ordinal" />
    </cs:EntitySetMapping>

    <cs:EntitySetMapping Name="ViewForeignKeys" StoreEntitySet="SViewForeignKeys" TypeName="Store.ForeignKey">
      <cs:ScalarProperty Name="Id" ColumnName="Id" />
      <cs:ScalarProperty Name="Ordinal" ColumnName="Ordinal" />
    </cs:EntitySetMapping>
    
    <cs:AssociationSetMapping Name="TableTableColumns" StoreEntitySet="STableColumns" TypeName="Store.TableOrViewColumn">
      <cs:EndProperty Name="Parent">
        <cs:ScalarProperty Name="Id" ColumnName="ParentId" />
      </cs:EndProperty>
      <cs:EndProperty Name="Column">
        <cs:ScalarProperty Name="Id" ColumnName="Id" />
      </cs:EndProperty>
    </cs:AssociationSetMapping>

    <cs:AssociationSetMapping Name="ViewViewColumns" StoreEntitySet="SViewColumns" TypeName="Store.TableOrViewColumn">
      <cs:EndProperty Name="Parent">
        <cs:ScalarProperty Name="Id" ColumnName="ParentId" />
      </cs:EndProperty>
      <cs:EndProperty Name="Column">
        <cs:ScalarProperty Name="Id" ColumnName="Id" />
      </cs:EndProperty>
    </cs:AssociationSetMapping>

    <cs:AssociationSetMapping Name="TableTableConstraints" StoreEntitySet="SConstraints" TypeName="Store.TableOrViewConstraint">
      <cs:EndProperty Name="Parent">
        <cs:ScalarProperty Name="Id" ColumnName="ParentId" />
      </cs:EndProperty>
      <cs:EndProperty Name="Constraint">
        <cs:ScalarProperty Name="Id" ColumnName="Id" />
      </cs:EndProperty>
    </cs:AssociationSetMapping>

    <cs:AssociationSetMapping Name="TableConstraintColumns" StoreEntitySet="SConstraintColumns" TypeName="Store.TableOrViewConstraintColumn">
      <cs:EndProperty Name="Constraint">
        <cs:ScalarProperty Name="Id" ColumnName="ConstraintId" />
      </cs:EndProperty>
      <cs:EndProperty Name="Column">
        <cs:ScalarProperty Name="Id" ColumnName="ColumnId" />
      </cs:EndProperty>
    </cs:AssociationSetMapping>

    <cs:AssociationSetMapping Name="TableConstraintForeignKeys" StoreEntitySet="SForeignKeys" TypeName="Store.ConstraintForeignKey">
      <cs:EndProperty Name="Constraint">
        <cs:ScalarProperty Name="Id" ColumnName="ConstraintId" />
      </cs:EndProperty>
      <cs:EndProperty Name="ForeignKey">
        <cs:ScalarProperty Name="Id" ColumnName="Id" />
      </cs:EndProperty>
    </cs:AssociationSetMapping>

    <cs:AssociationSetMapping Name="ToTableForeignKeyColumns" StoreEntitySet="SForeignKeys" TypeName="Store.ToForeignKeyColumn">
      <cs:EndProperty Name="ForeignKey">
        <cs:ScalarProperty Name="Id" ColumnName="Id" />
      </cs:EndProperty>
      <cs:EndProperty Name="Column">
        <cs:ScalarProperty Name="Id" ColumnName="ToColumnId" />
      </cs:EndProperty>
    </cs:AssociationSetMapping>

    <cs:AssociationSetMapping Name="FromTableForeignKeyColumns" StoreEntitySet="SForeignKeys" TypeName="Store.FromForeignKeyColumn">
      <cs:EndProperty Name="ForeignKey">
        <cs:ScalarProperty Name="Id" ColumnName="Id" />
      </cs:EndProperty>
      <cs:EndProperty Name="Column">
        <cs:ScalarProperty Name="Id" ColumnName="FromColumnId" />
      </cs:EndProperty>
    </cs:AssociationSetMapping>

    <cs:AssociationSetMapping Name="ViewViewConstraints" StoreEntitySet="SViewConstraints" TypeName="Store.TableOrViewConstraint">
      <cs:EndProperty Name="Parent">
        <cs:ScalarProperty Name="Id" ColumnName="ParentId" />
      </cs:EndProperty>
      <cs:EndProperty Name="Constraint">
        <cs:ScalarProperty Name="Id" ColumnName="Id" />
      </cs:EndProperty>
    </cs:AssociationSetMapping>

    <cs:AssociationSetMapping Name="ViewConstraintColumns" StoreEntitySet="SViewConstraintColumns" TypeName="Store.TableOrViewConstraintColumn">
      <cs:EndProperty Name="Constraint">
        <cs:ScalarProperty Name="Id" ColumnName="ConstraintId" />
      </cs:EndProperty>
      <cs:EndProperty Name="Column">
        <cs:ScalarProperty Name="Id" ColumnName="ColumnId" />
      </cs:EndProperty>
    </cs:AssociationSetMapping>

    <cs:AssociationSetMapping Name="ViewConstraintForeignKeys" StoreEntitySet="SViewForeignKeys" TypeName="Store.ConstraintForeignKey">
      <cs:EndProperty Name="Constraint">
        <cs:ScalarProperty Name="Id" ColumnName="ConstraintId" />
      </cs:EndProperty>
      <cs:EndProperty Name="ForeignKey">
        <cs:ScalarProperty Name="Id" ColumnName="Id" />
      </cs:EndProperty>
    </cs:AssociationSetMapping>

    <cs:AssociationSetMapping Name="ToViewForeignKeyColumns" StoreEntitySet="SViewForeignKeys" TypeName="Store.ToForeignKeyColumn">
      <cs:EndProperty Name="ForeignKey">
        <cs:ScalarProperty Name="Id" ColumnName="Id" />
      </cs:EndProperty>
      <cs:EndProperty Name="Column">
        <cs:ScalarProperty Name="Id" ColumnName="ToColumnId" />
      </cs:EndProperty>
    </cs:AssociationSetMapping>

    <cs:AssociationSetMapping Name="FromViewForeignKeyColumns" StoreEntitySet="SViewForeignKeys" TypeName="Store.FromForeignKeyColumn">
      <cs:EndProperty Name="ForeignKey">
        <cs:ScalarProperty Name="Id" ColumnName="Id" />
      </cs:EndProperty>
      <cs:EndProperty Name="Column">
        <cs:ScalarProperty Name="Id" ColumnName="FromColumnId" />
      </cs:EndProperty>
    </cs:AssociationSetMapping>

    <cs:AssociationSetMapping Name="FunctionFunctionParameters" StoreEntitySet="SFunctionParameters" TypeName="Store.RoutineParameter">
      <cs:EndProperty Name="Routine">
        <cs:ScalarProperty Name="Id" ColumnName="ParentId" />
      </cs:EndProperty>
      <cs:EndProperty Name="Parameter">
        <cs:ScalarProperty Name="Id" ColumnName="Id" />
      </cs:EndProperty>
    </cs:AssociationSetMapping>

    <cs:AssociationSetMapping Name="ProcedureProcedureParameters" StoreEntitySet="SProcedureParameters" TypeName="Store.RoutineParameter">
      <cs:EndProperty Name="Routine">
        <cs:ScalarProperty Name="Id" ColumnName="ParentId" />
      </cs:EndProperty>
      <cs:EndProperty Name="Parameter">
        <cs:ScalarProperty Name="Id" ColumnName="Id" />
      </cs:EndProperty>
    </cs:AssociationSetMapping>

  </cs:EntityContainerMapping>

</Mapping>

Added System.Data.SQLite.Linq/Resources/System.Data.Resources.CSDLSchema.xsd.







































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
<?xml version="1.0" encoding="utf-8"?>
<xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cg="http://schemas.microsoft.com/ado/2006/04/codegeneration" xmlns:edm="http://schemas.microsoft.com/ado/2006/04/edm" targetNamespace="http://schemas.microsoft.com/ado/2006/04/edm">
  <xs:annotation>
    <xs:documentation xml:lang="en">
            Common Data Model Schema Definition Language.
            Copyright (c) Microsoft Corp. All rights reserved.
        </xs:documentation>
  </xs:annotation>
  <xs:import namespace="http://schemas.microsoft.com/ado/2006/04/codegeneration" schemaLocation="System.Data.Resources.CodeGenerationSchema.xsd" />
  <xs:element name="Schema" type="edm:TSchema" />
  <xs:complexType name="TSchema">
    <xs:sequence>
      <xs:group ref="edm:GSchemaBodyElements" minOccurs="0" maxOccurs="unbounded" />
      <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
    <xs:attribute name="Namespace" type="edm:TNamespaceName" use="required" />
    <xs:attribute name="Alias" type="edm:TSimpleIdentifier" use="optional" />
    <xs:anyAttribute namespace="##other" processContents="lax" />
  </xs:complexType>
  <xs:group name="GSchemaBodyElements">
    <xs:choice>
      <xs:element name="Using" type="edm:TUsing" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="Association" type="edm:TAssociation" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="ComplexType" type="edm:TComplexType" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="EntityType" type="edm:TEntityType" minOccurs="0" maxOccurs="unbounded" />
      <xs:element ref="edm:EntityContainer" minOccurs="1" maxOccurs="1" />
    </xs:choice>
  </xs:group>
  <!-- EDM SimpleType instances for use by EDM Instance documents-->
  <xs:simpleType name="EDMSimpleType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Binary" />
      <xs:enumeration value="Boolean" />
      <xs:enumeration value="Byte" />
      <xs:enumeration value="DateTime" />
      <xs:enumeration value="DateTimeOffset" />
      <xs:enumeration value="Time" />
      <xs:enumeration value="Decimal" />
      <xs:enumeration value="Double" />
      <xs:enumeration value="Single" />
      <xs:enumeration value="Guid" />
      <xs:enumeration value="Int16" />
      <xs:enumeration value="Int32" />
      <xs:enumeration value="Int64" />
      <xs:enumeration value="String" />
      <xs:enumeration value="SByte" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="TMax">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Max" />
    </xs:restriction>
  </xs:simpleType>
  <!-- Facets for Primitive types -->
  <xs:simpleType name="TMaxLengthFacet">
    <xs:union memberTypes="edm:TMax xs:nonNegativeInteger  " />
  </xs:simpleType>
  <xs:simpleType name="TIsFixedLengthFacet">
    <xs:restriction base="xs:boolean" />
  </xs:simpleType>
  <xs:simpleType name="TPrecisionFacet">
    <xs:restriction base="xs:nonNegativeInteger" />
  </xs:simpleType>
  <xs:simpleType name="TScaleFacet">
    <xs:restriction base="xs:nonNegativeInteger" />
  </xs:simpleType>
  <xs:simpleType name="TIsUnicodeFacet">
    <xs:restriction base="xs:boolean" />
  </xs:simpleType>
  <xs:simpleType name="TCollationFacet">
    <xs:restriction base="xs:string" />
  </xs:simpleType>
  <!--
        types at all levels
    -->
  <xs:complexType name="TDocumentation">
    <xs:annotation>
      <xs:documentation>The Documentation element is used to provide documentation of comments on the contents of the XML file.  It is valid under Schema, Type, Index and Relationship elements.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="Summary" type="edm:TText" minOccurs="0" maxOccurs="1" />
      <xs:element name="LongDescription" type="edm:TText" minOccurs="0" maxOccurs="1" />
    </xs:sequence>
    <xs:anyAttribute processContents="lax" namespace="##other" />
  </xs:complexType>
  <xs:complexType name="TText" mixed="true">
    <xs:sequence>
      <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
    <xs:anyAttribute processContents="lax" namespace="##other" />
  </xs:complexType>
  <xs:complexType name="TXmlOrText" mixed="true">
    <xs:annotation>
      <xs:documentation>This type allows pretty much any content</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:any namespace="##any" processContents="skip" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
    <xs:anyAttribute processContents="skip" namespace="##any" />
  </xs:complexType>
  <!-- 
        types of the top level elements 
    -->
  <xs:complexType name="TUsing">
    <xs:sequence>
      <xs:group ref="edm:GEmptyElementExtensibility" minOccurs="0" maxOccurs="1" />
    </xs:sequence>
    <xs:attribute name="Namespace" type="edm:TNamespaceName" use="required" />
    <xs:attribute name="Alias" type="edm:TSimpleIdentifier" use="required" />
    <xs:anyAttribute namespace="##other" processContents="lax" />
  </xs:complexType>
  <xs:complexType name="TAssociation">
    <xs:sequence>
      <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
      <xs:element name="End" type="edm:TAssociationEnd" minOccurs="2" maxOccurs="2" />
      <xs:element name="ReferentialConstraint" type="edm:TConstraint" minOccurs="0" maxOccurs="1" />
      <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
    <xs:attribute name="Name" type="edm:TSimpleIdentifier" use="required" />
    <!--<xs:attribute name="Identifying" type="xs:boolean" use="optional" default="false" />-->
    <xs:anyAttribute namespace="##other" processContents="lax" />
  </xs:complexType>
  <xs:complexType name="TComplexType">
    <xs:sequence>
      <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
      <xs:element name="Property" type="edm:TComplexTypeProperty" minOccurs="0" maxOccurs="unbounded" />
      <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
    <xs:attributeGroup ref="edm:TTypeAttributes" />
    <xs:attribute ref="cg:TypeAccess" use="optional" />
    <xs:anyAttribute namespace="##other" processContents="lax" />
  </xs:complexType>
  <xs:complexType name="TConstraint">
    <xs:sequence>
      <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
      <xs:element name="Principal" type="edm:TReferentialConstraintRoleElement" minOccurs="1" maxOccurs="1" />
      <xs:element name="Dependent" type="edm:TReferentialConstraintRoleElement" minOccurs="1" maxOccurs="1" />
      <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
    <xs:anyAttribute namespace="##other" processContents="lax" />
  </xs:complexType>
  <xs:complexType name="TReferentialConstraintRoleElement">
    <xs:sequence>
      <xs:element name="PropertyRef" type="edm:TPropertyRef" minOccurs="1" maxOccurs="unbounded" />
    </xs:sequence>
    <xs:attribute name="Role" type="edm:TSimpleIdentifier" use="required" />
  </xs:complexType>
  <xs:complexType name="TNavigationProperty">
    <xs:sequence>
      <xs:group ref="edm:GEmptyElementExtensibility" minOccurs="0" maxOccurs="1" />
    </xs:sequence>
    <xs:attribute name="Name" type="edm:TSimpleIdentifier" use="required" />
    <xs:attribute name="Relationship" type="edm:TQualifiedName" use="required" />
    <xs:attribute name="ToRole" type="edm:TSimpleIdentifier" use="required" />
    <xs:attribute name="FromRole" type="edm:TSimpleIdentifier" use="required" />
    <xs:attribute ref="cg:GetterAccess" use="optional" />
    <xs:attribute ref="cg:SetterAccess" use="optional" />
    <xs:anyAttribute namespace="##other" processContents="lax" />
  </xs:complexType>
  <xs:complexType name="TEntityType">
    <xs:sequence>
      <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
      <xs:element name="Key" type="edm:TEntityKeyElement" minOccurs="0" maxOccurs="1" />
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="Property" type="edm:TEntityProperty" minOccurs="0" maxOccurs="unbounded" />
        <xs:element name="NavigationProperty" type="edm:TNavigationProperty" minOccurs="0" maxOccurs="unbounded" />
      </xs:choice>
      <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
    <xs:attributeGroup ref="edm:TDerivableTypeAttributes" />
    <xs:attribute ref="cg:TypeAccess" use="optional" />
    <xs:anyAttribute namespace="##other" processContents="lax" />
  </xs:complexType>
  <xs:complexType name="TEntityKeyElement">
    <xs:sequence>
      <xs:element name="PropertyRef" type="edm:TPropertyRef" minOccurs="1" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="TPropertyRef">
    <xs:attribute name="Name" type="edm:TSimpleIdentifier" use="required" />
  </xs:complexType>
  <xs:group name="GEmptyElementExtensibility">
    <xs:sequence>
      <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
      <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:group>
  <!-- 
        base types  
    -->
  <xs:complexType name="TAssociationEnd">
    <xs:sequence>
      <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
      <xs:group ref="edm:TOperations" minOccurs="0" maxOccurs="unbounded" />
      <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
    <xs:attribute name="Type" type="edm:TQualifiedName" use="required" />
    <xs:attribute name="Role" type="edm:TSimpleIdentifier" use="optional" />
    <xs:attribute name="Multiplicity" type="edm:TMultiplicity" use="required" />
    <xs:anyAttribute namespace="##other" processContents="lax" />
  </xs:complexType>
  <xs:group name="TOperations">
    <xs:choice>
      <xs:element name="OnDelete" type="edm:TOnAction" maxOccurs="1" minOccurs="0" />
    </xs:choice>
  </xs:group>
  <xs:complexType name="TOnAction">
    <xs:sequence>
      <xs:group ref="edm:GEmptyElementExtensibility" minOccurs="0" maxOccurs="1" />
    </xs:sequence>
    <xs:attribute name="Action" type="edm:TAction" use="required" />
    <xs:anyAttribute namespace="##other" processContents="lax" />
  </xs:complexType>
  <xs:complexType name="TEntityProperty">
    <xs:sequence>
      <xs:group ref="edm:GEmptyElementExtensibility" minOccurs="0" maxOccurs="1" />
    </xs:sequence>
    <xs:attributeGroup ref="edm:TCommonPropertyAttributes" />
    <xs:anyAttribute namespace="##other" processContents="lax" />
  </xs:complexType>
  <xs:complexType name="TComplexTypeProperty">
    <xs:sequence>
      <xs:group ref="edm:GEmptyElementExtensibility" minOccurs="0" maxOccurs="1" />
    </xs:sequence>
    <xs:attributeGroup ref="edm:TCommonPropertyAttributes" />
    <xs:anyAttribute namespace="##other" processContents="lax" />
  </xs:complexType>
  <xs:complexType name="TFunctionImportParameter">
    <xs:sequence>
      <xs:group ref="edm:GEmptyElementExtensibility" minOccurs="0" maxOccurs="1" />
    </xs:sequence>
    <xs:attributeGroup ref="edm:TFunctionImportParameterAttributes" />
    <xs:anyAttribute namespace="##other" processContents="lax" />
  </xs:complexType>
  <xs:attributeGroup name="TCommonPropertyAttributes">
    <xs:attribute name="Name" type="edm:TSimpleIdentifier" use="required" />
    <xs:attribute name="Type" type="edm:TPropertyType" use="required" />
    <xs:attribute name="Nullable" type="xs:boolean" default="true" use="optional" />
    <xs:attribute name="DefaultValue" type="xs:string" use="optional" />
    <!-- Start Facets -->
    <xs:attribute name="MaxLength" type="edm:TMaxLengthFacet" use="optional" />
    <xs:attribute name="FixedLength" type="edm:TIsFixedLengthFacet" use="optional" />
    <xs:attribute name="Precision" type="edm:TPrecisionFacet" use="optional" />
    <xs:attribute name="Scale" type="edm:TScaleFacet" use="optional" />
    <xs:attribute name="Unicode" type="edm:TIsUnicodeFacet" use="optional" />
    <xs:attribute name="Collation" type="edm:TCollationFacet" use="optional" />
    <!--End Facets -->
    <xs:attribute name="ConcurrencyMode" type="edm:TConcurrencyMode" use="optional" />
    <xs:attribute ref="cg:SetterAccess" use="optional" />
    <xs:attribute ref="cg:GetterAccess" use="optional" />
  </xs:attributeGroup>
  <xs:attributeGroup name="TFunctionImportParameterAttributes">
    <xs:attribute name="Name" type="edm:TSimpleIdentifier" use="required" />
    <xs:attribute name="Type" type="edm:TPropertyType" use="required" />
    <xs:attribute name="Mode" type="edm:TParameterMode" use="optional" />
    <xs:attribute name="MaxLength" type="edm:TMaxLengthFacet" use="optional" />
    <xs:attribute name="Precision" type="edm:TPrecisionFacet" use="optional" />
    <xs:attribute name="Scale" type="edm:TScaleFacet" use="optional" />
    <xs:anyAttribute namespace="##other" processContents="lax" />
  </xs:attributeGroup>
  <xs:attributeGroup name="TFunctionImportAttributes">
    <xs:attribute name="Name" type="edm:TSimpleIdentifier" use="required" />
    <xs:attribute name="ReturnType" type="edm:TFunctionType" use="optional" />
    <xs:attribute name="EntitySet" type="edm:TSimpleIdentifier" use="optional" />
    <xs:attribute ref="cg:MethodAccess" use="optional" />
    <xs:anyAttribute namespace="##other" processContents="lax" />
  </xs:attributeGroup>
  <xs:attributeGroup name="TTypeAttributes">
    <xs:attribute name="Name" type="edm:TSimpleIdentifier" use="required" />
    <!-- not in wave 4 -->
    <!--<xs:attribute name="FriendSchemas" type="TNameList" use="optional" />-->
    <!--<xs:attribute name="Visibility" type="TVisibility" use="optional" />-->
  </xs:attributeGroup>
  <xs:attributeGroup name="TDerivableTypeAttributes">
    <xs:attributeGroup ref="edm:TTypeAttributes" />
    <xs:attribute name="BaseType" type="edm:TQualifiedName" use="optional" />
    <xs:attribute name="Abstract" type="xs:boolean" use="optional" default="false" />
  </xs:attributeGroup>
  <xs:attributeGroup name="TEntitySetAttributes">
    <xs:attribute name="Name" type="edm:TSimpleIdentifier" use="required" />
    <xs:attribute name="EntityType" type="edm:TQualifiedName" use="required" />
    <xs:attribute ref="cg:GetterAccess" use="optional" />
  </xs:attributeGroup>
  <xs:element name="EntityContainer">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element name="FunctionImport">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
                <xs:element name="Parameter" type="edm:TFunctionImportParameter" minOccurs="0" maxOccurs="unbounded" />
              </xs:sequence>
              <xs:attributeGroup ref="edm:TFunctionImportAttributes" />
            </xs:complexType>
          </xs:element>
          <xs:element name="EntitySet">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
              </xs:sequence>
              <xs:attributeGroup ref="edm:TEntitySetAttributes" />
              <xs:anyAttribute processContents="lax" namespace="##other" />
            </xs:complexType>
          </xs:element>
          <xs:element name="AssociationSet">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
                <xs:element name="End" minOccurs="0" maxOccurs="2">
                  <!-- 1. The number of Ends has to match with ones defined in AssociationType 
                                         2. Value for attribute Name should match the defined ones and EntitySet should be of the 
                                            defined Entity Type in AssociationType 
                                    -->
                  <xs:complexType>
                    <xs:sequence>
                      <xs:group ref="edm:GEmptyElementExtensibility" minOccurs="0" maxOccurs="1" />
                    </xs:sequence>
                    <xs:attribute name="Role" type="edm:TSimpleIdentifier" use="optional" />
                    <xs:attribute name="EntitySet" type="edm:TSimpleIdentifier" use="required" />
                  </xs:complexType>
                </xs:element>
                <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
              </xs:sequence>
              <xs:attribute name="Name" type="edm:TSimpleIdentifier" use="required" />
              <xs:attribute name="Association" type="edm:TQualifiedName" use="required" />
              <xs:anyAttribute namespace="##other" processContents="lax" />
            </xs:complexType>
          </xs:element>
        </xs:choice>
      </xs:sequence>
      <xs:attribute name="Name" type="edm:TSimpleIdentifier" use="required" />
      <xs:attribute name="Extends" type ="edm:TSimpleIdentifier" use="optional" />
    </xs:complexType>
  </xs:element>
  <!-- 
    general  (more or less) purpose simple types 
    -->
  <xs:simpleType name="TParameterMode">
    <xs:restriction base="xs:token">
      <xs:enumeration value="In" />
      <xs:enumeration value="Out" />
      <xs:enumeration value="InOut" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="TNamespaceName">
    <xs:restriction base="edm:TQualifiedName">
      <xs:maxLength value="512" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="TQualifiedName">
    <xs:restriction base="xs:string">
      <!-- The below pattern represents the allowed identifiers in ECMA specification plus the '.' for namespace qualification  -->
      <xs:pattern value="[\p{L}\p{Nl}][\p{L}\p{Nl}\p{Nd}\p{Mn}\p{Mc}\p{Pc}\p{Cf}]{0,}(\.[\p{L}\p{Nl}][\p{L}\p{Nl}\p{Nd}\p{Mn}\p{Mc}\p{Pc}\p{Cf}]{0,}){0,}" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="TSimpleIdentifier">
    <xs:restriction base="xs:string">
      <xs:maxLength value="480" />
      <!-- The below pattern represents the allowed identifiers in ECMA specification -->
      <xs:pattern value="[\p{L}\p{Nl}][\p{L}\p{Nl}\p{Nd}\p{Mn}\p{Mc}\p{Pc}\p{Cf}]{0,}" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="TPropertyType">
    <xs:union memberTypes="edm:EDMSimpleType edm:TQualifiedName  ">
      <xs:simpleType>
        <xs:restriction base="xs:token">
          <!-- The below pattern represents the allowed identifiers in ECMA specification plus the '.' for namespace qualification  -->
          <xs:pattern value="[\p{L}\p{Nl}][\p{L}\p{Nl}\p{Nd}\p{Mn}\p{Mc}\p{Pc}\p{Cf}]{0,}(\.[\p{L}\p{Nl}][\p{L}\p{Nl}\p{Nd}\p{Mn}\p{Mc}\p{Pc}\p{Cf}]{0,}){0,}" />
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="TFunctionType">
    <xs:union memberTypes="edm:TQualifiedName    ">
      <xs:simpleType>
        <xs:restriction base="xs:token">
          <xs:pattern value="Collection\([^ \t]{1,}(\.[^ \t]{1,}){0,}\)" />
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="TAction">
    <xs:restriction base="xs:token">
      <xs:enumeration value="Cascade" />
      <xs:enumeration value="None" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="TMultiplicity">
    <xs:restriction base="xs:token">
      <xs:enumeration value="0..1" />
      <xs:enumeration value="1" />
      <xs:enumeration value="*" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="TConcurrencyMode">
    <xs:restriction base="xs:token">
      <xs:enumeration value="None" />
      <xs:enumeration value="Fixed" />
    </xs:restriction>
  </xs:simpleType>
</xs:schema>

Added System.Data.SQLite.Linq/Resources/System.Data.Resources.CSMSL.xsd.



















































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
<?xml version="1.0"?>
<!-- XSD for CS( CDM <-> Storage ) space mapping. -->
<xs:schema xmlns:tns="urn:schemas-microsoft-com:windows:storage:mapping:CS" 
           attributeFormDefault="unqualified" 
           elementFormDefault="qualified" 
           targetNamespace="urn:schemas-microsoft-com:windows:storage:mapping:CS" 
           xmlns:csmsl="urn:schemas-microsoft-com:windows:storage:mapping:CS" 
           xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:annotation>
    <xs:documentation xml:lang="en">
      Common Data Model Schema Definition Language.
      Copyright (c) Microsoft Corp. All rights reserved.
    </xs:documentation>
  </xs:annotation>
  
  <!-- Root Level element for CS Mapping -->
  <xs:element name="Mapping" type="csmsl:TMapping"/>

  <!-- Type of Root level mapping elements-->
  <xs:complexType name="TMapping">
    <!-- Top level Mapping element can have Alias elements followed by 
         EntityContainer Mapping element-->
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="Alias" type="csmsl:TAlias"/>
      <!-- For now we will allow only one EntityContainerMapping to be mapped per MSL File.-->
      <xs:element name="EntityContainerMapping" type="csmsl:TEntityContainerMapping"/>
    </xs:sequence>
    <!-- Space represents the space that the mapping occurs. For CS Mapping
         it always has to be "C-S"-->
    <xs:attribute name="Space" type="csmsl:TSpace" use="required" fixed="C-S" />
  </xs:complexType>

  <!-- Type for QueryView Element -->
  <xs:complexType name="TQueryView">
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="TypeName" type="xs:string" use="optional" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>




  <!-- Type for Alias Element-->
  <xs:complexType name="TAlias">
    <xs:attribute name="Key" type="csmsl:TSimpleIdentifier" use="required" />
    <xs:attribute name="Value" type="xs:string" use="required" />
  </xs:complexType>

  <!-- Type for EntityContainerMapping Element-->
  <xs:complexType name="TEntityContainerMapping">
    <xs:sequence>
      <xs:choice maxOccurs="unbounded">
        <xs:element minOccurs="0" name="EntitySetMapping" type="csmsl:TEntitySetMapping"/>
        <xs:element minOccurs="0" name="AssociationSetMapping" type="csmsl:TAssociationSetMapping"/>
        <xs:element minOccurs="0" name="FunctionImportMapping" type="csmsl:TFunctionImportMapping"/>
      </xs:choice>
    </xs:sequence>
    <xs:attribute name="CdmEntityContainer" type="csmsl:TSimpleIdentifier" use="required" />
    <xs:attribute name="StorageEntityContainer" type="xs:string" use="required" />
  </xs:complexType>

  <!-- Type for FunctionImport Mapping element -->
  <xs:complexType name="TFunctionImportMapping">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="1" name="ResultMapping" type="csmsl:TFunctionImportMappingResultMapping"/>
    </xs:sequence>
    <xs:attribute name="FunctionName" type="xs:string" use="required"/>
    <xs:attribute name="FunctionImportName" type="csmsl:TSimpleIdentifier" use="required"/>
  </xs:complexType>
  
  <!-- Type for FunctionImport/ResultMapping element -->
  <xs:complexType name="TFunctionImportMappingResultMapping">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="EntityTypeMapping" type="csmsl:TFunctionImportEntityTypeMapping"/>
    </xs:sequence>    
  </xs:complexType>

  <!-- Type for EntitySet Mapping element-->
  <xs:complexType name="TEntitySetMapping">
    <xs:choice>
      <xs:choice>
        <xs:sequence>
          <xs:element name="QueryView" type="csmsl:TQueryView" minOccurs="0" maxOccurs="unbounded"/>
    
          <xs:element name="EntityTypeMapping" type="csmsl:TEntityTypeMapping" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:sequence>
          <xs:element name="MappingFragment" type="csmsl:TMappingFragment" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:choice>
      <xs:group ref="csmsl:TPropertyGroup"/>
    </xs:choice>
    <xs:attribute name="Name" type="csmsl:TSimpleIdentifier" use="required" />
    <xs:attribute name="TypeName" type="xs:string" use="optional" />
    <xs:attribute name="StoreEntitySet" type="xs:string" use="optional" />
  </xs:complexType>

  <!-- Type for AssociationSetMapping element-->
  <xs:complexType name="TAssociationSetMapping">
    <xs:sequence>
      <xs:element name="QueryView" type="xs:string" minOccurs="0" maxOccurs="1"/>          
      <xs:element name="EndProperty" type="csmsl:TEndProperty" minOccurs="0" maxOccurs="2"/>
      <xs:element name="Condition" type="csmsl:TCondition" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element name="ModificationFunctionMapping" type="csmsl:TAssociationSetModificationFunctionMapping" minOccurs="0" maxOccurs="1"/>
    </xs:sequence>
    <xs:attribute name="Name" type="csmsl:TSimpleIdentifier" use="required" />
    <xs:attribute name="TypeName" type="csmsl:TQualifiedName" use="optional" />
    <xs:attribute name="StoreEntitySet" type="xs:string" use="optional" />
  </xs:complexType>

  <!-- Type for EntityTypeMapping element-->
  <xs:complexType name="TEntityTypeMapping">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="MappingFragment" type="csmsl:TMappingFragment"/>
      <xs:element minOccurs="0" maxOccurs="1" name="ModificationFunctionMapping" type="csmsl:TEntityTypeModificationFunctionMapping"/>
    </xs:sequence>
    <xs:attribute name="TypeName" type="xs:string" use="required" />
  </xs:complexType>
  
  <!-- Type for FunctionImport EntityTypeMapping element-->
  <xs:complexType name="TFunctionImportEntityTypeMapping">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="Condition" type="csmsl:TFunctionImportCondition"/>
    </xs:sequence>
    <xs:attribute name="TypeName" type="xs:string" use="required" />
  </xs:complexType>

  <!-- Type for MappingFragment Element-->
  <xs:complexType name="TMappingFragment">
    <xs:group ref="csmsl:TPropertyGroup" minOccurs="1" maxOccurs="1"/>
    <xs:attribute name="StoreEntitySet" type="xs:string" use="required" />
  </xs:complexType>

  <!-- Type for EntityTypeMapping/ModificationFunctionMapping element -->
  <xs:complexType name="TEntityTypeModificationFunctionMapping">
    <xs:all>
      <xs:element minOccurs="1" maxOccurs="1" name="DeleteFunction" type="csmsl:TEntityTypeModificationFunction"/>
      <xs:element minOccurs="1" maxOccurs="1" name="InsertFunction" type="csmsl:TEntityTypeModificationFunctionWithResult"/>
      <xs:element minOccurs="1" maxOccurs="1" name="UpdateFunction" type="csmsl:TEntityTypeModificationFunctionWithResult"/>
    </xs:all>
  </xs:complexType>
  
  <!-- Type for AssociationSetMapping/ModificationFunctionMapping element -->
  <xs:complexType name="TAssociationSetModificationFunctionMapping">
    <xs:all>
      <xs:element minOccurs="1" maxOccurs="1" name="DeleteFunction" type="csmsl:TAssociationSetModificationFunction"/>
      <xs:element minOccurs="1" maxOccurs="1" name="InsertFunction" type="csmsl:TAssociationSetModificationFunction"/>
    </xs:all>
  </xs:complexType>

  <!-- Type for entity type DeleteFunction -->
  <xs:complexType name="TEntityTypeModificationFunction">
    <xs:group ref="csmsl:TEntityTypeFunctionMappingPropertyGroup" minOccurs="1" maxOccurs="1"/>
    <xs:attribute name="FunctionName" type="xs:string" use="required"/>
    <xs:attribute name="RowsAffectedParameter" type="xs:string" use="optional"/>
  </xs:complexType>

  <!-- Extensions to modification function for entity type InsertFunction and UpdateFunction -->
  <xs:complexType name="TEntityTypeModificationFunctionWithResult">
    <xs:complexContent>
      <xs:extension base="csmsl:TEntityTypeModificationFunction">
        <xs:group ref="csmsl:TResultBindingGroup" minOccurs="1" maxOccurs="1"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Type for association set DeleteFunction and InsertFunction -->
  <xs:complexType name="TAssociationSetModificationFunction">
    <xs:group ref="csmsl:TAssociationSetFunctionMappingPropertyGroup" minOccurs="1" maxOccurs="1"/>
    <xs:attribute name="FunctionName" type="xs:string" use="required"/>
    <xs:attribute name="RowsAffectedParameter" type="xs:string" use="optional"/>
  </xs:complexType>

  <!-- Grouping for entity type function mappings -->
  <xs:group name="TEntityTypeFunctionMappingPropertyGroup">
    <xs:sequence>
      <xs:choice maxOccurs="unbounded">
        <xs:element minOccurs="0" name="ScalarProperty" type="csmsl:TFunctionMappingScalarProperty"/>
        <xs:element minOccurs="0" name="AssociationEnd" type="csmsl:TFunctionMappingAssociationEnd"/>
        <xs:element minOccurs="0" name="ComplexProperty" type="csmsl:TFunctionMappingComplexProperty"/>
      </xs:choice>
    </xs:sequence>
  </xs:group>

  <!-- Grouping for entity type function mappings -->
  <xs:group name="TAssociationSetFunctionMappingPropertyGroup">
    <xs:sequence>
      <xs:choice maxOccurs="unbounded">
        <xs:element minOccurs="1" name="EndProperty" type="csmsl:TFunctionMappingEndProperty"/>
      </xs:choice>
    </xs:sequence>
  </xs:group>

  <!-- Type for function mapping end property -->
  <xs:complexType name="TFunctionMappingEndProperty">
    <xs:group ref="csmsl:TFunctionMappingAssociationEndPropertyGroup" minOccurs="1" maxOccurs="1"/>
    <xs:attribute name="Name" type="csmsl:TSimpleIdentifier" use="required"/>
  </xs:complexType>

  <!-- Type for function mapping scalar property -->
  <xs:complexType name="TFunctionMappingScalarProperty">
    <xs:attribute name="ParameterName" type="xs:string" use="required"/>
    <xs:attribute name="Name" type="csmsl:TSimpleIdentifier" use="required"/>
    <xs:attribute name="Version" type="csmsl:TVersion" use="optional"/>
  </xs:complexType>

  <!-- Type for function mapping result binding -->
  <xs:complexType name="TResultBinding">
    <xs:attribute name="ColumnName" type="xs:string" use="required"/>
    <xs:attribute name="Name" type="csmsl:TSimpleIdentifier" use="required"/>
  </xs:complexType>

  <!-- Type for function mapping association end -->
  <xs:complexType name="TFunctionMappingAssociationEnd">
    <xs:group ref="csmsl:TFunctionMappingAssociationEndPropertyGroup" minOccurs="1" maxOccurs="1"/>
    <xs:attribute name="AssociationSet" type="csmsl:TSimpleIdentifier" use="required"/>
    <xs:attribute name="From" type="csmsl:TSimpleIdentifier" use="required"/>
    <xs:attribute name="To" type="csmsl:TSimpleIdentifier" use="required"/>
  </xs:complexType>

  <!-- Grouping for property bindings in function mapping end property -->
  <xs:group name="TFunctionMappingAssociationEndPropertyGroup">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="ScalarProperty" type="csmsl:TFunctionMappingScalarProperty"/>
    </xs:sequence>
  </xs:group>

  <!-- Type for function mapping complex property -->
  <xs:complexType name="TFunctionMappingComplexProperty">
    <xs:group ref="csmsl:TFunctionMappingComplexPropertyPropertyGroup" minOccurs="1" maxOccurs="1"/>
    <xs:attribute name="Name" type="csmsl:TSimpleIdentifier" use="required"/>
    <xs:attribute name="TypeName" type="xs:string" use="required"/>
  </xs:complexType>  

  <!-- Grouping for result bindings in function mappings -->
  <xs:group name="TResultBindingGroup">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="ResultBinding" type="csmsl:TResultBinding"/>
    </xs:sequence>
  </xs:group>

  <!-- Grouping for property bindings in function mapping association end -->
  <xs:group name="TFunctionMappingComplexPropertyPropertyGroup">
    <xs:sequence>
      <xs:choice maxOccurs="unbounded">
        <xs:element minOccurs="0" name="ScalarProperty" type="csmsl:TFunctionMappingScalarProperty"/>
        <xs:element minOccurs="0" name="ComplexProperty" type="csmsl:TFunctionMappingComplexProperty"/>
      </xs:choice>
    </xs:sequence>
  </xs:group>

  <!-- Grouping these elements so that they can be reused
       These elements represent the property group
       that can either directly reside unser EntitySet, EntityType
       or MappingFragment-->
  <xs:group name="TPropertyGroup">
    <xs:sequence>
      <xs:choice maxOccurs="unbounded">
        <xs:element minOccurs="0" name="ComplexProperty" type="csmsl:TComplexProperty"/>
        <xs:element minOccurs="0" name="ScalarProperty" type="csmsl:TScalarProperty"/>
        <xs:element minOccurs="0" name="Condition" type="csmsl:TCondition"/>
      </xs:choice>
    </xs:sequence>
  </xs:group>

  <!-- Type for Condition Element-->
  <xs:complexType name="TCondition">
    <xs:attribute name="Value" type="xs:string" use="optional" />
    <xs:attribute name="Name" type="csmsl:TSimpleIdentifier" use="optional" />
    <xs:attribute name="ColumnName" type="xs:string" use="optional" />
    <xs:attribute name="IsNull" type="xs:boolean" use="optional" />
  </xs:complexType>

  <!-- Type for FunctionImport Condition element-->
  <xs:complexType name="TFunctionImportCondition">
    <xs:attribute name="Value" type="xs:string" use="optional" />
    <xs:attribute name="ColumnName" type="xs:string" use="required" />
    <xs:attribute name="IsNull" type="xs:boolean" use="optional" />
  </xs:complexType>

  <!-- Type for End Property Elements in Association Maps -->
  <xs:complexType name="TEndProperty">
    <xs:sequence>
      <xs:element maxOccurs="unbounded" name="ScalarProperty" type="csmsl:TScalarProperty"/>
    </xs:sequence>
    <xs:attribute name="Name" type="csmsl:TSimpleIdentifier" use="required" />
  </xs:complexType>

  <!-- Type for Complex Property Map elements-->
  <xs:complexType name="TComplexProperty">
    <xs:sequence>
      <xs:choice maxOccurs="unbounded">
        <xs:element name="ScalarProperty" type="csmsl:TScalarProperty"/>
        <xs:element name="ComplexProperty" type="csmsl:TComplexProperty"/>
        <xs:element name="ComplexTypeMapping" type="csmsl:TComplexTypeMapping"/>
        <xs:element name="Condition" type="csmsl:TCondition"/>
      </xs:choice>
    </xs:sequence>
    <xs:attribute name="Name" type="csmsl:TSimpleIdentifier" use="required" />
    <xs:attribute name="TypeName" type="xs:string" use="optional" />
    <xs:attribute name="IsPartial" type="xs:boolean" use="optional" />
  </xs:complexType>

  <!-- Type for Complex Type mapping element-->
  <xs:complexType name="TComplexTypeMapping">
    <xs:sequence>
      <xs:choice maxOccurs="unbounded">
        <xs:element name="ScalarProperty" type="csmsl:TScalarProperty"/>
        <xs:element name="ComplexProperty" type="csmsl:TComplexProperty"/>
        <xs:element name="Condition" type="csmsl:TCondition"/>
      </xs:choice>
    </xs:sequence>
    <xs:attribute name="TypeName" type="xs:string" use="optional" />
    <xs:attribute name="IsPartial" type="xs:boolean" use="optional" />
  </xs:complexType>
  
  <!-- Type for ScalarProperty Element-->
  <xs:complexType name="TScalarProperty">
    <xs:attribute name="Name" type="csmsl:TSimpleIdentifier" use="required" />
    <xs:attribute name="ColumnName" type="xs:string" use="required" />
  </xs:complexType>

  <!--Definition for SimpleIdentifier
      This is the same definition that is being used in the CSDL XSD
      -->
  <xs:simpleType name="TSimpleIdentifier">
    <xs:restriction base="xs:token">
        <!-- The below pattern represents the allowed identifiers in ECMA specification -->
        <xs:pattern value="[\p{L}\p{Nl}][\p{L}\p{Nl}\p{Nd}\p{Mn}\p{Mc}\p{Pc}\p{Cf}]{0,}"/>
    </xs:restriction>
  </xs:simpleType>


  <!--Definition for QualifiedName. QualifiedName is SimpleIdentifiers with '.'
      allowed. This is the same definition that is being used in the CSDL XSD
      -->
  <xs:simpleType name="TQualifiedName">
    <xs:restriction base="xs:token">
        <!-- The below pattern represents the allowed identifiers in ECMA specification plus the '.' for namespace qualification  -->
         <xs:pattern value="[\p{L}\p{Nl}][\p{L}\p{Nl}\p{Nd}\p{Mn}\p{Mc}\p{Pc}\p{Cf}]{0,}(\.[\p{L}\p{Nl}][\p{L}\p{Nl}\p{Nd}\p{Mn}\p{Mc}\p{Pc}\p{Cf}]{0,}){0,}"/>
    </xs:restriction>
  </xs:simpleType>

  <!--Definition for Version, which can 'original' or 'current' as its value-->
  <xs:simpleType name="TVersion">
    <xs:restriction base="xs:token">
      <xs:enumeration value="Original"/>
      <xs:enumeration value="Current"/>
    </xs:restriction>
  </xs:simpleType>

  <!-- Type fopr Space or Type Attribute -->
  <xs:simpleType name="TSpace">
    <xs:restriction base="xs:token">
      <xs:enumeration value="C-S" />
    </xs:restriction>
  </xs:simpleType>
</xs:schema>

Added System.Data.SQLite.Linq/Resources/System.Data.Resources.EntityStoreSchemaGenerator.xsd.



















































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
<?xml version="1.0" encoding="utf-8"?>
<xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:source="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator"
           targetNamespace="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator">
    <xs:annotation>
        <xs:documentation xml:lang="en">
            Common Data Model Schema Definition Language.
            Copyright (c) Microsoft Corp. All rights reserved.
        </xs:documentation>
    </xs:annotation>


  <xs:attribute name="Type" type="source:TSourceType"/>
  <xs:attribute name="Schema" type="xs:string"/>
  <xs:attribute name="Name" type="xs:string"/>

    <xs:simpleType name="TSourceType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="Tables" />
            <xs:enumeration value="Views" />
        </xs:restriction>
    </xs:simpleType>

</xs:schema>

Added System.Data.SQLite.Linq/Resources/System.Data.Resources.SSDLSchema.xsd.























































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
<?xml version="1.0" encoding="utf-8"?>
<xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:edm="http://schemas.microsoft.com/ado/2006/04/edm/ssdl"
           xmlns:gen="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" 
           targetNamespace="http://schemas.microsoft.com/ado/2006/04/edm/ssdl">
    <xs:annotation>
        <xs:documentation xml:lang="en">
            Common Data Model Schema Definition Language.
            Copyright (c) Microsoft Corp. All rights reserved.
        </xs:documentation>
    </xs:annotation>
  <xs:import namespace="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" schemaLocation="System.Data.Resources.EntityStoreSchemaGenerator.xsd" />
  <xs:element name="Schema" type="edm:TSchema"/>
    <xs:complexType name="TSchema">
        <xs:sequence>
            <xs:group ref="edm:GSchemaBodyElements" minOccurs="0" maxOccurs="unbounded"/>
            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
        </xs:sequence>
        <xs:attribute name="Namespace" type="edm:TQualifiedName" use="required" />
        <xs:attribute name="Alias" type="edm:TSimpleIdentifier" use="optional" />
        <xs:attribute name="Provider" type="edm:TSimpleIdentifier" use="required" />
        <xs:attribute name="ProviderManifestToken" type="edm:TSimpleIdentifier" use="required" />      
        <xs:anyAttribute namespace="##other" processContents="lax" />
    </xs:complexType>

    <xs:group name="GSchemaBodyElements">
        <xs:choice>
            <xs:element name="Association" type="edm:TAssociation" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element name="EntityType" type="edm:TEntityType" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element ref="edm:EntityContainer" minOccurs="1" maxOccurs="1"/>
            <xs:element name="Function" type="edm:TFunction" minOccurs="0" maxOccurs="unbounded" />
        </xs:choice>
    </xs:group>

    <xs:simpleType name="TMax">
        <xs:restriction base="xs:string">
            <xs:enumeration value="Max"/>
        </xs:restriction>
    </xs:simpleType>

    <!-- Facets for Primitive types -->
    <xs:simpleType name="TMaxLengthFacet">
        <xs:union memberTypes="edm:TMax xs:nonNegativeInteger"/>
    </xs:simpleType>

    <xs:simpleType name="TIsFixedLengthFacet">
        <xs:restriction base="xs:boolean"/>
    </xs:simpleType>

    <xs:simpleType name="TKindFacet">
        <xs:restriction base="xs:string">
            <xs:enumeration value="Utc"/>
            <xs:enumeration value="Local"/>
            <xs:enumeration value="Unspecified"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="TPrecisionFacet">
        <xs:restriction base="xs:nonNegativeInteger"/>
    </xs:simpleType>

    <xs:simpleType name="TScaleFacet">
        <xs:restriction base="xs:nonNegativeInteger"/>
    </xs:simpleType>

    <xs:simpleType name="TIsUnicodeFacet">
        <xs:restriction base="xs:boolean"/>
    </xs:simpleType>

    <xs:simpleType name="TCollationFacet">
        <xs:restriction base="xs:string"/>
    </xs:simpleType>

    <!-- 
        types of the top level elements 
    -->
   <xs:complexType name="TDocumentation">
    <xs:annotation>
      <xs:documentation>The Documentation element is used to provide documentation of comments on the contents of the XML file. It is valid under Schema, Type, Index and Relationship elements.
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="Summary" type="edm:TText" minOccurs="0" maxOccurs="1" />
      <xs:element name="LongDescription" type="edm:TText" minOccurs="0" maxOccurs="1" />
    </xs:sequence>
    <xs:anyAttribute processContents="lax" namespace="##other" />
  </xs:complexType>

  <xs:complexType name="TText" mixed="true">
    <xs:sequence>
      <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
    <xs:anyAttribute processContents="lax" namespace="##other" />
  </xs:complexType>


    <xs:complexType name="TUsing">
        <xs:sequence>
            <xs:group ref="edm:GEmptyElementExtensibility" minOccurs="0" maxOccurs="1"/>
        </xs:sequence>
        <xs:attribute name="Namespace" type="edm:TQualifiedName" use="required" />
        <xs:attribute name="Alias" type="edm:TSimpleIdentifier" use="required" />
        <xs:anyAttribute namespace="##other" processContents="lax" />
    </xs:complexType>

    <xs:complexType name="TAssociation">
        <xs:sequence>
            <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
            <xs:element name="End" type="edm:TAssociationEnd" minOccurs="2" maxOccurs="2"/>
            <xs:element name="ReferentialConstraint" type="edm:TConstraint" minOccurs="0" maxOccurs="1" />
            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
        </xs:sequence>
        <xs:attribute name="Name" type="edm:TSimpleIdentifier" use="required" />
        <!--<xs:attribute name="Identifying" type="xs:boolean" use="optional" default="false" />-->
        <xs:anyAttribute namespace="##other" processContents="lax" />
    </xs:complexType>

    <xs:complexType name="TConstraint">
        <xs:sequence>
            <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
            <xs:element name="Principal" type="edm:TReferentialConstraintRoleElement" minOccurs="1" maxOccurs="1" />
            <xs:element name="Dependent" type="edm:TReferentialConstraintRoleElement" minOccurs="1" maxOccurs="1" />
            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
        </xs:sequence>
        <xs:anyAttribute namespace="##other" processContents="lax"/>
    </xs:complexType>

    <xs:complexType name="TNavigationProperty">
        <xs:sequence>
            <xs:group ref="edm:GEmptyElementExtensibility" minOccurs="0" maxOccurs="1"/>
        </xs:sequence>
        <xs:attribute name="Name" type="edm:TSimpleIdentifier" use="required" />
        <xs:attribute name="Relationship" type="edm:TQualifiedName" use ="required" />
        <xs:attribute name="ToRole" type="edm:TSimpleIdentifier" use="required" />
        <xs:attribute name="FromRole" type="edm:TSimpleIdentifier" use="required" />
        <xs:anyAttribute namespace="##other" processContents="lax" />
    </xs:complexType>

    <xs:complexType name="TReferentialConstraintRoleElement">
        <xs:sequence>
            <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
            <xs:element name="PropertyRef" type="edm:TPropertyRef" minOccurs="1" maxOccurs="unbounded" />
            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
        </xs:sequence>
        <xs:attribute name="Role" type="edm:TSimpleIdentifier" use="required" />
        <xs:anyAttribute namespace="##other" processContents="lax"/>
    </xs:complexType>

    <xs:complexType name="TEntityType">
        <xs:sequence>
            <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
            <xs:element name="Key" type="edm:TEntityKeyElement" minOccurs="0" maxOccurs="1"/>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:element name="Property" type="edm:TEntityProperty" minOccurs="0" maxOccurs="unbounded" />
                <xs:element name="NavigationProperty" type="edm:TNavigationProperty" minOccurs="0" maxOccurs="unbounded"/>
            </xs:choice>
            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
        </xs:sequence>
        <xs:attribute name="Name" type="edm:TSimpleIdentifier" use="required" />
        <xs:anyAttribute namespace="##other" processContents="lax"/>
    </xs:complexType>

    <xs:complexType name ="TEntityKeyElement">
        <xs:sequence>
            <xs:element name="PropertyRef" type="edm:TPropertyRef" minOccurs="1" maxOccurs="unbounded" />
            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="TPropertyRef">
        <xs:sequence>
            <xs:group ref="edm:GEmptyElementExtensibility" minOccurs="0" maxOccurs="1" />
        </xs:sequence>
        <xs:attribute name="Name" type="edm:TSimpleIdentifier" use="required" />
        <xs:anyAttribute namespace="##other" processContents="lax" />
    </xs:complexType>

    <xs:group name="GEmptyElementExtensibility">
        <xs:sequence>
            <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
        </xs:sequence>
    </xs:group>

    <!-- 
        base types  
    -->
    <xs:complexType name="TAssociationEnd">
        <xs:sequence>
            <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
            <xs:group ref="edm:TOperations" minOccurs="0" maxOccurs="unbounded" />
            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
        </xs:sequence>
        <xs:attribute name="Type" type="edm:TQualifiedName" use="required" />
        <xs:attribute name="Role" type="edm:TSimpleIdentifier" use="optional" />
        <xs:attribute name="Multiplicity" type="edm:TMultiplicity" use="required" />
        <xs:anyAttribute namespace="##other" processContents="lax" />
    </xs:complexType>

    <xs:group name="TOperations">
        <xs:choice>
            <xs:element name="OnDelete" type="edm:TOnAction" maxOccurs="1" minOccurs="0" />
        </xs:choice>
    </xs:group>

    <xs:complexType name="TOnAction">
        <xs:sequence>
            <xs:group ref="edm:GEmptyElementExtensibility" minOccurs="0" maxOccurs="1"/>
        </xs:sequence>
        <xs:attribute name="Action" type="edm:TAction" use="required" />
        <xs:anyAttribute namespace="##other" processContents="lax" />
    </xs:complexType>

    <xs:complexType name="TEntityProperty">
        <xs:sequence>
            <xs:group ref="edm:GEmptyElementExtensibility" minOccurs="0" maxOccurs="1"/>
        </xs:sequence>
        <xs:attributeGroup ref="edm:TCommonPropertyAttributes"/>
        <xs:attribute name="StoreGeneratedPattern" type="edm:TStoreGeneratedPattern" use="optional" />
        <xs:anyAttribute namespace="##other" processContents="lax" />
    </xs:complexType>

    <xs:attributeGroup name="TCommonPropertyAttributes">
        <xs:attribute name="Name" type="edm:TSimpleIdentifier" use="required" />
        <xs:attribute name="Type" type="edm:TPropertyType" use="required" />
        <xs:attribute name="Nullable" type="xs:boolean" default="true" use="optional" />
        <xs:attribute name="DefaultValue" type="xs:string" use="optional" />

        <!-- Start Facets -->
        <xs:attribute name="MaxLength" type="edm:TMaxLengthFacet" use="optional" />
        <xs:attribute name="FixedLength" type="edm:TIsFixedLengthFacet" use="optional" />
        <xs:attribute name="Precision" type="edm:TPrecisionFacet" use="optional" />
        <xs:attribute name="Scale" type="edm:TScaleFacet" use="optional" />
        <xs:attribute name="Unicode" type="edm:TIsUnicodeFacet" use="optional" />
        <xs:attribute name="Collation" type="edm:TCollationFacet" use="optional" />
        <!--End Facets -->
    </xs:attributeGroup>

    <xs:attributeGroup name="TEntitySetAttributes">
        <xs:attribute name="Name" type="edm:TSimpleIdentifier" use="required" />
        <xs:attribute name="EntityType" type="edm:TQualifiedName" use="required" />
        <xs:attribute name="Schema" type="edm:TSimpleIdentifier" use="optional" />
        <xs:attribute name="Table" type="edm:TSimpleIdentifier" use="optional" />

    </xs:attributeGroup>

    <xs:element name="EntityContainer">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
                <xs:choice minOccurs="0" maxOccurs="unbounded">
                    <xs:element name="EntitySet">
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
                                <xs:element name="DefiningQuery" type="edm:TCommandText" minOccurs="0" maxOccurs="1"/>
                                <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
                            </xs:sequence>
                            <xs:attributeGroup ref="edm:TEntitySetAttributes"/>
                          <xs:attribute ref="gen:Type" use="optional"/>
                          <xs:attribute ref="gen:Schema" use="optional"/>
                          <xs:attribute ref="gen:Name" use="optional"/>
                          <xs:anyAttribute processContents="lax" namespace="##other" />
                        </xs:complexType>
                    </xs:element>

                    <xs:element name="AssociationSet">
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
                                <xs:element name="End" minOccurs="0" maxOccurs="2">
                                    <!-- 1. The number of Ends has to match with ones defined in AssociationType 
                                         2. Value for attribute Name should match the defined ones and EntitySet should be of the 
                                            defined Entity Type in AssociationType 
                                    -->
                                    <xs:complexType>
                                        <xs:sequence>
                                            <xs:group ref="edm:GEmptyElementExtensibility" minOccurs="0" maxOccurs="1"/>
                                        </xs:sequence>
                                        <xs:attribute name="Role" type="edm:TSimpleIdentifier" use="optional" />
                                        <xs:attribute name="EntitySet" type="edm:TSimpleIdentifier" use="required" />
                                    </xs:complexType>
                                </xs:element>
                                <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
                            </xs:sequence>
                            <xs:attribute name="Name" type="edm:TSimpleIdentifier" use="required" />
                            <xs:attribute name="Association" type="edm:TQualifiedName" use="required" />
                            <xs:anyAttribute namespace="##other" processContents="lax" />
                        </xs:complexType>
                    </xs:element>
                </xs:choice>
            </xs:sequence>
            <xs:attribute name="Name" type="edm:TSimpleIdentifier" use="required" />
        </xs:complexType>
    </xs:element>

    <xs:complexType name="TFunction">
        <xs:sequence>
            <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
            <xs:element name="CommandText" type="edm:TCommandText" minOccurs="0" maxOccurs="1" />
            <xs:element name="Parameter" type="edm:TParameter" minOccurs="0" maxOccurs="unbounded" />
            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
        </xs:sequence>
        <xs:attribute name="Name" type="xs:string" use="required" />
        <xs:attribute name="ReturnType" type="edm:TFunctionType" use="optional" />
        <xs:attribute name="Aggregate" type="xs:boolean" use="optional" />
        <xs:attribute name="BuiltIn" type="xs:boolean" use="optional" />
        <xs:attribute name="StoreFunctionName" type="xs:string" use="optional" />
        <xs:attribute name="NiladicFunction" type="xs:boolean" use="optional" />
        <xs:attribute name="IsComposable" type="xs:boolean" use="optional" default="true" />
        <xs:attribute name="ParameterTypeSemantics" type="edm:TParameterTypeSemantics" use="optional" default="AllowImplicitConversion" />
        <xs:attribute name="Schema" type="edm:TSimpleIdentifier" use="optional" />
        <xs:anyAttribute namespace="##other" processContents="lax" />
    </xs:complexType>

    <xs:complexType name="TParameter">
        <xs:sequence>
            <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
        </xs:sequence>
        <xs:attribute name="Name" type="xs:string" use="required" />
        <xs:attribute name="Type" type="edm:TFunctionType" use="required" />
        <xs:attribute name="Mode" type="edm:TParameterMode" use="optional" />
        <!-- Start Facets -->
        <xs:attribute name="MaxLength" type="edm:TMaxLengthFacet" use="optional" />
        <xs:attribute name="Precision" type="edm:TPrecisionFacet" use="optional" />
        <xs:attribute name="Scale" type="edm:TScaleFacet" use="optional" />
        <!--End Facets -->
        <xs:anyAttribute namespace="##other" processContents="lax" />
    </xs:complexType>

    <!-- 
    general (more or less) purpose simple types 
    -->

  <xs:simpleType name="TCommandText">
    <xs:restriction base="xs:string">
      <xs:whiteSpace value="preserve"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="TQualifiedName">
        <xs:restriction base="xs:string"/>
    </xs:simpleType>

    <xs:simpleType name="TSimpleIdentifier">
        <xs:restriction base="xs:string"/>
    </xs:simpleType>

    <xs:simpleType name="TPropertyType">
        <xs:union memberTypes="edm:TQualifiedName">
            <xs:simpleType>
                <xs:restriction base="xs:token">
                    <!-- The below pattern represents the allowed identifiers in ECMA specification plus the '.' for namespace qualification -->
                    <xs:pattern value="[\p{L}\p{Nl}][\p{L}\p{Nl}\p{Nd}\p{Mn}\p{Mc}\p{Pc}\p{Cf}]{0,}(\.[\p{L}\p{Nl}][\p{L}\p{Nl}\p{Nd}\p{Mn}\p{Mc}\p{Pc}\p{Cf}]{0,}){0,}" />
                </xs:restriction>
            </xs:simpleType>
        </xs:union>
    </xs:simpleType>

    <xs:simpleType name="TAction">
        <xs:restriction base="xs:token">
            <xs:enumeration value="Cascade" />
            <xs:enumeration value="Restrict" />
            <xs:enumeration value="None" />
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="TMultiplicity">
    <xs:restriction base="xs:token">
      <xs:enumeration value="0..1" />
      <xs:enumeration value="1" />
      <xs:enumeration value="*" />
    </xs:restriction>
  </xs:simpleType>

    <xs:simpleType name="TStoreGeneratedPattern">
        <xs:restriction base="xs:token">
            <xs:enumeration value="None" />
            <xs:enumeration value="Identity" />
            <xs:enumeration value="Computed" />
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="TParameterMode">
        <xs:restriction base="xs:token">
            <xs:enumeration value="In" />
            <xs:enumeration value="Out" />
            <xs:enumeration value="InOut" />
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="TFunctionType">
        <xs:union memberTypes="edm:TQualifiedName ">
            <xs:simpleType>
                <xs:restriction base="xs:token">
                    <xs:pattern value="Collection\([^ \t]{1,}(\.[^ \t]{1,}){0,}\)" />
                </xs:restriction>
            </xs:simpleType>
        </xs:union>
    </xs:simpleType>
    <xs:simpleType name="TParameterTypeSemantics">
        <xs:restriction base="xs:token">
            <xs:enumeration value="ExactMatchOnly" />
            <xs:enumeration value="AllowImplicitPromotion" />
            <xs:enumeration value="AllowImplicitConversion" />
        </xs:restriction>
    </xs:simpleType>


</xs:schema>

Added System.Data.SQLite.Linq/SQL.

























































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//---------------------------------------------------------------------
// <copyright file="TopClause.cs" company="Microsoft">
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
//---------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Text;
using System.Data.Metadata.Edm;
using System.Data.Common.CommandTrees;

namespace System.Data.SQLite
{
    /// <summary>
    /// TopClause represents the a TOP expression in a SqlSelectStatement. 
    /// It has a count property, which indicates how many TOP rows should be selected and a 
    /// boolen WithTies property.
    /// </summary>
    class TopClause : ISqlFragment
    {
        ISqlFragment topCount;
        bool withTies;

        /// <summary>
        /// Do we need to add a WITH_TIES to the top statement
        /// </summary>
        internal bool WithTies
        {
            get { return withTies; }
        }

        /// <summary>
        /// How many top rows should be selected.
        /// </summary>
        internal ISqlFragment TopCount
        {
            get { return topCount; }
        }

        /// <summary>
        /// Creates a TopClause with the given topCount and withTies.
        /// </summary>
        /// <param name="topCount"></param>
        /// <param name="withTies"></param>
        internal TopClause(ISqlFragment topCount, bool withTies)
        {
            this.topCount = topCount;
            this.withTies = withTies;
        }

        /// <summary>
        /// Creates a TopClause with the given topCount and withTies.
        /// </summary>
        /// <param name="topCount"></param>
        /// <param name="withTies"></param>
        internal TopClause(int topCount, bool withTies)
        {
            SqlBuilder sqlBuilder = new SqlBuilder();
            sqlBuilder.Append(topCount.ToString(CultureInfo.InvariantCulture));
            this.topCount = sqlBuilder;
            this.withTies = withTies;
        }

        #region ISqlFragment Members

        /// <summary>
        /// Write out the TOP part of sql select statement 
        /// It basically writes TOP (X) [WITH TIES].
        /// </summary>
        /// <param name="writer"></param>
        /// <param name="sqlGenerator"></param>
        public void WriteSql(SqlWriter writer, SqlGenerator sqlGenerator)
        {
            writer.Write("TOP (");
            this.TopCount.WriteSql(writer, sqlGenerator);
            writer.Write(")");

            writer.Write(" ");

            if (this.WithTies)
            {
                writer.Write("WITH TIES ");
            }
        }

        #endregion
    }
}

Added System.Data.SQLite.Linq/SQLiteProviderManifest.cs.























































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
//---------------------------------------------------------------------
// <copyright file="SampleProviderManifest.cs" company="Microsoft">
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
//---------------------------------------------------------------------

using System.Collections.Generic;
using System.Xml;
using System.Collections.ObjectModel;
using System.Data.EntityModel.SchemaObjectModel;
using System.Data.EntityModel;
using System.Data.Common;
using System.Diagnostics;
using System.Data.Entity;
using System.Data.Metadata.Edm;
using System;
using System.Data;
using System.Reflection;
using System.IO;

namespace System.Data.SQLite
{
  /// <summary>
  /// The Provider Manifest for SQL Server
  /// </summary>
  internal class SQLiteProviderManifest : DbXmlEnabledProviderManifest
  {
    #region Private Fields

    /// <summary>
    /// maximum size of sql server unicode 
    /// </summary>
    private const int varcharMaxSize = Int32.MaxValue;
    private const int nvarcharMaxSize = Int32.MaxValue;
    private const int binaryMaxSize = Int32.MaxValue;

    private System.Collections.ObjectModel.ReadOnlyCollection<PrimitiveType> _primitiveTypes = null;
    private System.Collections.ObjectModel.ReadOnlyCollection<EdmFunction> _functions = null;

    #endregion

    #region Constructors

    /// <summary>
    /// Constructor
    /// </summary>
    /// <param name="manifestToken">A token used to infer the capabilities of the store</param>
    public SQLiteProviderManifest()
      : base(SQLiteProviderManifest.GetProviderManifest())
    {
    }

    #endregion

    #region Properties

    /// <summary>
    /// Provider Invariant Name - this property will be removed in Entity Framework v1
    /// Entity Framework SP1Beta does not use it, but it must be defined.
    /// </summary>
    public override string Provider
    {
      get { throw new NotImplementedException(); }
    }

    /// <summary>
    /// Provider Manifest Token - this property will be removed in Entity Framework v1
    /// Entity Framework SP1Beta does not use it, but it must be defined.
    /// </summary>
    public override string Token
    {
      get { throw new NotImplementedException(); }
    }

    #endregion

    internal static XmlReader GetProviderManifest()
    {
      return GetXmlResource("System.Data.SQLite.Resources.SQLiteProviderServices.ProviderManifest.xml");
    }

    /// <summary>
    /// Providers should override this to return information specific to their provider.  
    /// 
    /// This method should never return null.
    /// </summary>
    /// <param name="informationType">The name of the information to be retrieved.</param>
    /// <returns>An XmlReader at the begining of the information requested.</returns>
    protected override XmlReader GetDbInformation(string informationType)
    {
      if (informationType == DbProviderManifest.StoreSchemaDefinition)
      {
        return GetStoreSchemaDescription();
      }

      if (informationType == DbProviderManifest.StoreSchemaMapping)
      {
        return GetStoreSchemaMapping();
      }

      throw new ProviderIncompatibleException(String.Format("The provider returned null for the informationType '{0}'.", informationType));
    }

    public override System.Collections.ObjectModel.ReadOnlyCollection<PrimitiveType> GetStoreTypes()
    {
      if (_primitiveTypes == null)
      {
        List<PrimitiveType> primitiveTypes = new List<PrimitiveType>(base.GetStoreTypes());
        PrimitiveType newt;

        newt = PrimitiveType.GetEdmPrimitiveType(PrimitiveTypeKind.Int64);

        _primitiveTypes = primitiveTypes.AsReadOnly();
      }
      return _primitiveTypes;
    }

    public override System.Collections.ObjectModel.ReadOnlyCollection<EdmFunction> GetStoreFunctions()
    {
      if (this._functions == null)
      {
        this._functions = base.GetStoreFunctions();
      }
      return this._functions;
    }

    /// <summary>
    /// This method takes a type and a set of facets and returns the best mapped equivalent type 
    /// in EDM.
    /// </summary>
    /// <param name="storeType">A TypeUsage encapsulating a store type and a set of facets</param>
    /// <returns>A TypeUsage encapsulating an EDM type and a set of facets</returns>
    public override TypeUsage GetEdmType(TypeUsage storeType)
    {
      if (storeType == null)
      {
        throw new ArgumentNullException("storeType");
      }

      string storeTypeName = storeType.EdmType.Name.ToLowerInvariant();
      if (!base.StoreTypeNameToEdmPrimitiveType.ContainsKey(storeTypeName))
      {
        switch (storeTypeName)
        {
          case "integer":
            return TypeUsage.CreateDefaultTypeUsage(PrimitiveType.GetEdmPrimitiveType(PrimitiveTypeKind.Int64));
          default:
            throw new ArgumentException(String.Format("The underlying provider does not support the type '{0}'.", storeTypeName));
        }
      }

      PrimitiveType edmPrimitiveType = base.StoreTypeNameToEdmPrimitiveType[storeTypeName];

      int maxLength = 0;
      bool isUnicode = true;
      bool isFixedLen = false;
      bool isUnbounded = true;

      PrimitiveTypeKind newPrimitiveTypeKind;

      switch (storeTypeName)
      {
        // for some types we just go with simple type usage with no facets
        case "tinyint":
        case "smallint":
        case "integer":
        case "bit":
        case "uniqueidentifier":
        case "int":
          return TypeUsage.CreateDefaultTypeUsage(edmPrimitiveType);

        case "varchar":
          newPrimitiveTypeKind = PrimitiveTypeKind.String;
          isUnbounded = !TypeHelpers.TryGetMaxLength(storeType, out maxLength);
          isUnicode = false;
          isFixedLen = false;
          break;

        case "char":
          newPrimitiveTypeKind = PrimitiveTypeKind.String;
          isUnbounded = !TypeHelpers.TryGetMaxLength(storeType, out maxLength);
          isUnicode = false;
          isFixedLen = true;
          break;

        case "nvarchar":
          newPrimitiveTypeKind = PrimitiveTypeKind.String;
          isUnbounded = !TypeHelpers.TryGetMaxLength(storeType, out maxLength);
          isUnicode = true;
          isFixedLen = false;
          break;

        case "nchar":
          newPrimitiveTypeKind = PrimitiveTypeKind.String;
          isUnbounded = !TypeHelpers.TryGetMaxLength(storeType, out maxLength);
          isUnicode = true;
          isFixedLen = true;
          break;

        case "blob":
          newPrimitiveTypeKind = PrimitiveTypeKind.Binary;
          isUnbounded = !TypeHelpers.TryGetMaxLength(storeType, out maxLength);
          isFixedLen = false;
          break;

        case "float":
        case "real":
          return TypeUsage.CreateDefaultTypeUsage(edmPrimitiveType);

        case "decimal":
          {
            byte precision;
            byte scale;
            if (TypeHelpers.TryGetPrecision(storeType, out precision) && TypeHelpers.TryGetScale(storeType, out scale))
            {
              return TypeUsage.CreateDecimalTypeUsage(edmPrimitiveType, precision, scale);
            }
            else
            {
              return TypeUsage.CreateDecimalTypeUsage(edmPrimitiveType);
            }
          }

        case "datetime":
          return TypeUsage.CreateDateTimeTypeUsage(edmPrimitiveType, null);

        default:
          throw new NotSupportedException(String.Format("The underlying provider does not support the type '{0}'.", storeTypeName));
      }

      Debug.Assert(newPrimitiveTypeKind == PrimitiveTypeKind.String || newPrimitiveTypeKind == PrimitiveTypeKind.Binary, "at this point only string and binary types should be present");

      switch (newPrimitiveTypeKind)
      {
        case PrimitiveTypeKind.String:
          if (!isUnbounded)
          {
            return TypeUsage.CreateStringTypeUsage(edmPrimitiveType, isUnicode, isFixedLen, maxLength);
          }
          else
          {
            return TypeUsage.CreateStringTypeUsage(edmPrimitiveType, isUnicode, isFixedLen);
          }
        case PrimitiveTypeKind.Binary:
          if (!isUnbounded)
          {
            return TypeUsage.CreateBinaryTypeUsage(edmPrimitiveType, isFixedLen, maxLength);
          }
          else
          {
            return TypeUsage.CreateBinaryTypeUsage(edmPrimitiveType, isFixedLen);
          }
        default:
          throw new NotSupportedException(String.Format("The underlying provider does not support the type '{0}'.", storeTypeName));
      }
    }

    /// <summary>
    /// This method takes a type and a set of facets and returns the best mapped equivalent type 
    /// in SQL Server, taking the store version into consideration.
    /// </summary>
    /// <param name="storeType">A TypeUsage encapsulating an EDM type and a set of facets</param>
    /// <returns>A TypeUsage encapsulating a store type and a set of facets</returns>
    public override TypeUsage GetStoreType(TypeUsage edmType)
    {
      if (edmType == null)
      {
        throw new ArgumentNullException("edmType");
      }
      System.Diagnostics.Debug.Assert(edmType.EdmType.BuiltInTypeKind == BuiltInTypeKind.PrimitiveType);

      PrimitiveType primitiveType = edmType.EdmType as PrimitiveType;
      if (primitiveType == null)
      {
        throw new ArgumentException(String.Format("The underlying provider does not support the type '{0}'.", edmType));
      }

      ReadOnlyMetadataCollection<Facet> facets = edmType.Facets;

      switch (primitiveType.PrimitiveTypeKind)
      {
        case PrimitiveTypeKind.Boolean:
          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["bit"]);

        case PrimitiveTypeKind.Byte:
          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["tinyint"]);

        case PrimitiveTypeKind.Int16:
          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["smallint"]);

        case PrimitiveTypeKind.Int32:
          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["int"]);

        case PrimitiveTypeKind.Int64:
          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["integer"]);

        case PrimitiveTypeKind.Guid:
          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["uniqueidentifier"]);

        case PrimitiveTypeKind.Double:
          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["float"]);

        case PrimitiveTypeKind.Single:
          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["real"]);

        case PrimitiveTypeKind.Decimal: // decimal, numeric, smallmoney, money
          {
            byte precision;
            if (!TypeHelpers.TryGetPrecision(edmType, out precision))
            {
              precision = 18;
            }

            byte scale;
            if (!TypeHelpers.TryGetScale(edmType, out scale))
            {
              scale = 0;
            }

            return TypeUsage.CreateDecimalTypeUsage(StoreTypeNameToStorePrimitiveType["extDecimal"], precision, scale);
          }

        case PrimitiveTypeKind.Binary: // binary, varbinary, varbinary(max), image, timestamp, rowversion
          {
            bool isFixedLength = null != facets["FixedLength"].Value && (bool)facets["FixedLength"].Value;
            Facet f = facets["MaxLength"];

            bool isMaxLength = f.IsUnbounded || null == f.Value || (int)f.Value > binaryMaxSize;
            int maxLength = !isMaxLength ? (int)f.Value : Int32.MinValue;

            TypeUsage tu;
            if (isFixedLength)
            {
              tu = TypeUsage.CreateBinaryTypeUsage(StoreTypeNameToStorePrimitiveType["binary"], true, maxLength);
            }
            else
            {
              if (isMaxLength)
              {
                tu = TypeUsage.CreateBinaryTypeUsage(StoreTypeNameToStorePrimitiveType["blob"], false);
                System.Diagnostics.Debug.Assert(tu.Facets["MaxLength"].Description.IsConstant, "varbinary(max) is not constant!");
              }
              else
              {
                tu = TypeUsage.CreateBinaryTypeUsage(StoreTypeNameToStorePrimitiveType["blob"], false, maxLength);
              }
            }
            return tu;
          }

        case PrimitiveTypeKind.String:
          // char, nchar, varchar, nvarchar, varchar(max), nvarchar(max), ntext, text, xml
          {
            bool isUnicode = null == facets["Unicode"].Value || (bool)facets["Unicode"].Value;
            bool isFixedLength = null != facets["FixedLength"].Value && (bool)facets["FixedLength"].Value;
            Facet f = facets["MaxLength"];
            // maxlen is true if facet value is unbounded, the value is bigger than the limited string sizes *or* the facet
            // value is null. this is needed since functions still have maxlength facet value as null
            bool isMaxLength = f.IsUnbounded || null == f.Value || (int)f.Value > (isUnicode ? nvarcharMaxSize : varcharMaxSize);
            int maxLength = !isMaxLength ? (int)f.Value : Int32.MinValue;

            TypeUsage tu;

            if (isUnicode)
            {
              if (isFixedLength)
              {
                tu = TypeUsage.CreateStringTypeUsage(StoreTypeNameToStorePrimitiveType["nchar"], true, true, maxLength);
              }
              else
              {
                if (isMaxLength)
                {
                  tu = TypeUsage.CreateStringTypeUsage(StoreTypeNameToStorePrimitiveType["nvarchar"], true, false);
                }
                else
                {
                  tu = TypeUsage.CreateStringTypeUsage(StoreTypeNameToStorePrimitiveType["nvarchar"], true, false, maxLength);
                }
              }
            }
            else
            {
              if (isFixedLength)
              {
                tu = TypeUsage.CreateStringTypeUsage(StoreTypeNameToStorePrimitiveType["char"], false, true, maxLength);
              }
              else
              {
                if (isMaxLength)
                {
                  tu = TypeUsage.CreateStringTypeUsage(StoreTypeNameToStorePrimitiveType["varchar"], false, false);
                }
                else
                {
                  tu = TypeUsage.CreateStringTypeUsage(StoreTypeNameToStorePrimitiveType["varchar"], false, false, maxLength);
                }
              }
            }
            return tu;
          }

        case PrimitiveTypeKind.DateTime: // datetime, smalldatetime

          Facet preserveSecondsFacet;
          bool preserveSeconds;
          if (edmType.Facets.TryGetValue("PreserveSeconds", true, out preserveSecondsFacet) && null != preserveSecondsFacet.Value)
          {
            preserveSeconds = (bool)preserveSecondsFacet.Value;
          }
          else
          {
            preserveSeconds = true;
          }

          return TypeUsage.CreateDefaultTypeUsage(preserveSeconds ? StoreTypeNameToStorePrimitiveType["datetime"] : StoreTypeNameToStorePrimitiveType["smalldatetime"]);

        default:
          throw new NotSupportedException(String.Format("There is no store type corresponding to the EDM type '{0}' of primitive type '{1}'.", edmType, primitiveType.PrimitiveTypeKind));
      }
    }

    private XmlReader GetStoreSchemaMapping()
    {
      return GetXmlResource("System.Data.SQLite.Resources.SQLiteProviderServices.StoreSchemaMapping.msl");
    }

    private XmlReader GetStoreSchemaDescription()
    {
      return GetXmlResource("System.Data.SQLite.Resources.SQLiteProviderServices.StoreSchemaDefinition.ssdl");
    }

    internal static XmlReader GetXmlResource(string resourceName)
    {
      Assembly executingAssembly = Assembly.GetExecutingAssembly();
      Stream stream = executingAssembly.GetManifestResourceStream(resourceName);
      return XmlReader.Create(stream);
    }

    class TypeHelpers
    {
      public static bool TryGetPrecision(TypeUsage tu, out byte precision)
      {
        Facet f;

        precision = 0;
        if (tu.Facets.TryGetValue("Precision", false, out f))
        {
          if (!f.IsUnbounded && f.Value != null)
          {
            precision = (byte)f.Value;
            return true;
          }
        }
        return false;
      }

      public static bool TryGetMaxLength(TypeUsage tu, out int maxLength)
      {
        Facet f;

        maxLength = 0;
        if (tu.Facets.TryGetValue("MaxLength", false, out f))
        {
          if (!f.IsUnbounded && f.Value != null)
          {
            maxLength = (int)f.Value;
            return true;
          }
        }
        return false;
      }

      public static bool TryGetScale(TypeUsage tu, out byte scale)
      {
        Facet f;

        scale = 0;
        if (tu.Facets.TryGetValue("Scale", false, out f))
        {
          if (!f.IsUnbounded && f.Value != null)
          {
            scale = (byte)f.Value;
            return true;
          }
        }
        return false;
      }
    }
  }
}

Added System.Data.SQLite.Linq/SQLiteProviderServices.cs.



















































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
namespace System.Data.SQLite
{
  using System;
  using System.Data.Common;
  using System.Data.Common.CommandTrees;
  using System.Data.Metadata.Edm;
  using System.Diagnostics;
  using System.Collections.Generic;
  using System.Data.SQLite;
  using System.Text;
  using System.Globalization;

  internal class SQLiteProviderServices : DbProviderServices, ISQLiteSchemaExtensions
  {
    internal static readonly SQLiteProviderServices Instance = new SQLiteProviderServices();

    protected override DbCommandDefinition CreateDbCommandDefinition(DbProviderManifest manifest, DbCommandTree commandTree)
    {
      DbCommand prototype = CreateCommand(manifest, commandTree);
      DbCommandDefinition result = this.CreateCommandDefinition(prototype);
      return result;
    }

    private DbCommand CreateCommand(DbProviderManifest manifest, DbCommandTree commandTree)
    {
      if (manifest == null)
        throw new ArgumentNullException("manifest");

      if (commandTree == null)
        throw new ArgumentNullException("commandTree");

      SQLiteCommand command = new SQLiteCommand();
      try
      {
        List<DbParameter> parameters;
        CommandType commandType;

        command.CommandText = SqlGenerator.GenerateSql(commandTree, out parameters, out commandType);
        command.CommandType = commandType;

        // Get the function (if any) implemented by the command tree since this influences our interpretation of parameters
        EdmFunction function = null;
        if (commandTree is DbFunctionCommandTree)
        {
          function = ((DbFunctionCommandTree)commandTree).Function;
        }

        // Now make sure we populate the command's parameters from the CQT's parameters:
        foreach (KeyValuePair<string, TypeUsage> queryParameter in commandTree.Parameters)
        {
          SQLiteParameter parameter;

          // Use the corresponding function parameter TypeUsage where available (currently, the SSDL facets and 
          // type trump user-defined facets and type in the EntityCommand).
          FunctionParameter functionParameter;
          if (null != function && function.Parameters.TryGetValue(queryParameter.Key, false, out functionParameter))
          {
            parameter = CreateSqlParameter(functionParameter.Name, functionParameter.TypeUsage, functionParameter.Mode, DBNull.Value);
          }
          else
          {
            parameter = CreateSqlParameter(queryParameter.Key, queryParameter.Value, ParameterMode.In, DBNull.Value);
          }

          command.Parameters.Add(parameter);
        }

        // Now add parameters added as part of SQL gen (note: this feature is only safe for DML SQL gen which
        // does not support user parameters, where there is no risk of name collision)
        if (null != parameters && 0 < parameters.Count)
        {
          if (!(commandTree is DbInsertCommandTree) &&
            !(commandTree is DbUpdateCommandTree) &&
            !(commandTree is DbDeleteCommandTree))
          {
            throw new InvalidOperationException("SqlGenParametersNotPermitted");
          }

          foreach (DbParameter parameter in parameters)
          {
            command.Parameters.Add(parameter);
          }
        }

        return command;
      }
      catch
      {
        command.Dispose();
        throw;
      }
    }

    protected override string GetDbProviderManifestToken(DbConnection connection)
    {
      return "SQLite";
    }

    protected override DbProviderManifest GetDbProviderManifest(string versionHint)
    {
      return new SQLiteProviderManifest();
    }

    /// <summary>
    /// Creates a SQLiteParameter given a name, type, and direction
    /// </summary>
    internal static SQLiteParameter CreateSqlParameter(string name, TypeUsage type, ParameterMode mode, object value)
    {
      int? size;

      SQLiteParameter result = new SQLiteParameter(name, value);

      // .Direction
      ParameterDirection direction = MetadataHelpers.ParameterModeToParameterDirection(mode);
      if (result.Direction != direction)
      {
        result.Direction = direction;
      }

      // .Size and .DbType
      // output parameters are handled differently (we need to ensure there is space for return
      // values where the user has not given a specific Size/MaxLength)
      bool isOutParam = mode != ParameterMode.In;
      DbType sqlDbType = GetSqlDbType(type, isOutParam, out size);
      if (result.DbType != sqlDbType)
      {
        result.DbType = sqlDbType;
      }

      // Note that we overwrite 'facet' parameters where either the value is different or
      // there is an output parameter.
      if (size.HasValue && (isOutParam || result.Size != size.Value))
      {
        result.Size = size.Value;
      }

      // .IsNullable
      bool isNullable = MetadataHelpers.IsNullable(type);
      if (isOutParam || isNullable != result.IsNullable)
      {
        result.IsNullable = isNullable;
      }

      return result;
    }


    /// <summary>
    /// Determines DbType for the given primitive type. Extracts facet
    /// information as well.
    /// </summary>
    private static DbType GetSqlDbType(TypeUsage type, bool isOutParam, out int? size)
    {
      // only supported for primitive type
      PrimitiveTypeKind primitiveTypeKind = MetadataHelpers.GetPrimitiveTypeKind(type);

      size = default(int?);


      // TODO add logic for Xml here
      switch (primitiveTypeKind)
      {
        case PrimitiveTypeKind.Binary:
          // for output parameters, ensure there is space...
          size = GetParameterSize(type, isOutParam);
          return GetBinaryDbType(type);

        case PrimitiveTypeKind.Boolean:
          return DbType.Boolean;

        case PrimitiveTypeKind.Byte:
          return DbType.Byte;

        case PrimitiveTypeKind.Time:
          return DbType.Time;

        case PrimitiveTypeKind.DateTimeOffset:
          return DbType.DateTimeOffset;

        case PrimitiveTypeKind.DateTime:
          return DbType.DateTime;

        case PrimitiveTypeKind.Decimal:
          return DbType.Decimal;

        case PrimitiveTypeKind.Double:
          return DbType.Double;

        case PrimitiveTypeKind.Guid:
          return DbType.Guid;

        case PrimitiveTypeKind.Int16:
          return DbType.Int16;

        case PrimitiveTypeKind.Int32:
          return DbType.Int32;

        case PrimitiveTypeKind.Int64:
          return DbType.Int64;

        case PrimitiveTypeKind.SByte:
          return DbType.SByte;

        case PrimitiveTypeKind.Single:
          return DbType.Single;

        case PrimitiveTypeKind.String:
          size = GetParameterSize(type, isOutParam);
          return GetStringDbType(type);

        default:
          Debug.Fail("unknown PrimitiveTypeKind " + primitiveTypeKind);
          return DbType.Object;
      }
    }

    /// <summary>
    /// Determines preferred value for SqlParameter.Size. Returns null
    /// where there is no preference.
    /// </summary>
    private static int? GetParameterSize(TypeUsage type, bool isOutParam)
    {
      int maxLength;
      if (MetadataHelpers.TryGetMaxLength(type, out maxLength))
      {
        // if the MaxLength facet has a specific value use it
        return maxLength;
      }
      else if (isOutParam)
      {
        // if the parameter is a return/out/inout parameter, ensure there 
        // is space for any value
        return int.MaxValue;
      }
      else
      {
        // no value
        return default(int?);
      }
    }

    /// <summary>
    /// Chooses the appropriate DbType for the given string type.
    /// </summary>
    private static DbType GetStringDbType(TypeUsage type)
    {
      Debug.Assert(type.EdmType.BuiltInTypeKind == BuiltInTypeKind.PrimitiveType &&
        PrimitiveTypeKind.String == ((PrimitiveType)type.EdmType).PrimitiveTypeKind, "only valid for string type");

      DbType dbType;
      if (type.EdmType.Name.ToLowerInvariant() == "xml")
      {
        dbType = DbType.Xml;
      }
      else
      {
        // Specific type depends on whether the string is a unicode string and whether it is a fixed length string.
        // By default, assume widest type (unicode) and most common type (variable length)
        bool unicode;
        bool fixedLength;
        if (!MetadataHelpers.TryGetIsFixedLength(type, out fixedLength))
        {
          fixedLength = false;
        }

        if (!MetadataHelpers.TryGetIsUnicode(type, out unicode))
        {
          unicode = true;
        }

        if (fixedLength)
        {
          dbType = (unicode ? DbType.StringFixedLength : DbType.AnsiStringFixedLength);
        }
        else
        {
          dbType = (unicode ? DbType.String : DbType.AnsiString);
        }
      }
      return dbType;
    }

    /// <summary>
    /// Chooses the appropriate DbType for the given binary type.
    /// </summary>
    private static DbType GetBinaryDbType(TypeUsage type)
    {
      Debug.Assert(type.EdmType.BuiltInTypeKind == BuiltInTypeKind.PrimitiveType &&
        PrimitiveTypeKind.Binary == ((PrimitiveType)type.EdmType).PrimitiveTypeKind, "only valid for binary type");

      // Specific type depends on whether the binary value is fixed length. By default, assume variable length.
      bool fixedLength;
      if (!MetadataHelpers.TryGetIsFixedLength(type, out fixedLength))
      {
        fixedLength = false;
      }

      return DbType.Binary;
      //            return fixedLength ? DbType.Binary : DbType.VarBinary;
    }

    #region ISQLiteSchemaExtensions Members

    void ISQLiteSchemaExtensions.BuildTempSchema(SQLiteConnection cnn)
    {
      string[] arr = new string[] { "TABLES", "COLUMNS", "VIEWS", "VIEWCOLUMNS", "INDEXES", "INDEXCOLUMNS", "FOREIGNKEYS", "CATALOGS" };

      using (DataTable table = cnn.GetSchema("Tables", new string[] { "TEMP", null, String.Format("SCHEMA{0}", arr[0]) }))
      {
        if (table.Rows.Count > 0) return;
      }

      for (int n = 0; n < arr.Length; n++)
      {
        using (DataTable table = cnn.GetSchema(arr[n]))
        {
          DataTableToTable(cnn, table, String.Format("SCHEMA{0}", arr[n]));
        }
      }
      using (SQLiteCommand cmd = cnn.CreateCommand())
      {
        cmd.CommandText = @"
CREATE TEMP TABLE SCHEMACONSTRAINTS (CONSTRAINT_CATALOG NVARCHAR, CONSTRAINT_SCHEMA NVARCHAR, CONSTRAINT_NAME NVARCHAR, TABLE_CATALOG NVARCHAR, TABLE_SCHEMA NVARCHAR, TABLE_NAME NVARCHAR, CONSTRAINT_TYPE NVARCHAR, IS_DEFERRABLE BIT, INITIALLY_DEFERRED BIT, CHECK_CLAUSE NVARCHAR);

INSERT INTO TEMP.SCHEMACONSTRAINTS
SELECT INDEX_CATALOG, NULL, INDEX_NAME, TABLE_CATALOG, NULL, TABLE_NAME, 'PRIMARY KEY', 0, 0, NULL 
FROM TEMP.SCHEMAINDEXES WHERE PRIMARY_KEY = 1;

INSERT INTO TEMP.SCHEMACONSTRAINTS
SELECT INDEX_CATALOG, NULL, INDEX_NAME, TABLE_CATALOG, NULL, TABLE_NAME, 'UNIQUE', 0, 0, NULL 
FROM TEMP.SCHEMAINDEXES WHERE PRIMARY_KEY = 0 AND [UNIQUE] = 1;

INSERT INTO TEMP.SCHEMACONSTRAINTS
SELECT CONSTRAINT_CATALOG, NULL, CONSTRAINT_NAME, TABLE_CATALOG, NULL, TABLE_NAME, CONSTRAINT_TYPE, IS_DEFERRABLE, INITIALLY_DEFERRED, NULL 
FROM TEMP.SCHEMAFOREIGNKEYS;
";
        cmd.ExecuteNonQuery();

        cmd.CommandText = @"
CREATE TEMP TABLE SCHEMACONSTRAINTCOLUMNS (CONSTRAINT_CATALOG NVARCHAR, CONSTRAINT_SCHEMA NVARCHAR, CONSTRAINT_NAME NVARCHAR, TABLE_CATALOG NVARCHAR, TABLE_SCHEMA NVARCHAR, TABLE_NAME NVARCHAR, COLUMN_NAME NVARCHAR);

INSERT INTO TEMP.SCHEMACONSTRAINTCOLUMNS
SELECT CONSTRAINT_CATALOG, NULL, CONSTRAINT_NAME, TABLE_CATALOG, NULL, TABLE_NAME, COLUMN_NAME 
FROM TEMP.SCHEMAINDEXCOLUMNS;

INSERT INTO TEMP.SCHEMACONSTRAINTCOLUMNS
SELECT CONSTRAINT_CATALOG, NULL, CONSTRAINT_NAME, TABLE_CATALOG, NULL, TABLE_NAME, FKEY_FROM_COLUMN
FROM TEMP.SCHEMAFOREIGNKEYS;
";
        cmd.ExecuteNonQuery();
      }
    }

    private void DataTableToTable(SQLiteConnection cnn, DataTable table, string dest)
    {
      StringBuilder sql = new StringBuilder();
      SQLiteCommandBuilder builder = new SQLiteCommandBuilder();

      using (SQLiteCommand cmd = cnn.CreateCommand())
      using (DataTable source = new DataTable())
      {
        sql.AppendFormat(CultureInfo.InvariantCulture, "CREATE TEMP TABLE {0} (", builder.QuoteIdentifier(dest));
        string separator = String.Empty;
        foreach (DataColumn dc in table.Columns)
        {
          sql.AppendFormat(CultureInfo.InvariantCulture, "{2}{0} {1}", builder.QuoteIdentifier(dc.ColumnName), SQLiteConvert.DbTypeToTypeName(SQLiteConvert.TypeToDbType(dc.DataType)), separator);
          separator = ", ";
        }
        sql.Append(")");

        cmd.CommandText = sql.ToString();
        cmd.ExecuteNonQuery();

        cmd.CommandText = String.Format("SELECT * FROM TEMP.{0} WHERE 1=2", builder.QuoteIdentifier(dest));
        using (SQLiteDataAdapter adp = new SQLiteDataAdapter(cmd))
        {
          builder.DataAdapter = adp;

          adp.Fill(source);

          foreach (DataRow row in table.Rows)
          {
            source.Rows.Add(row.ItemArray);
          }
          adp.Update(source);
        }
      }
    }

    #endregion
  }
}

Added System.Data.SQLite.Linq/System.Data.SQLite.Linq.csproj.



































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.30428</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{E6BF9F74-58E2-413B-A7CE-EA653ECB728D}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>System.Data.SQLite</RootNamespace>
    <AssemblyName>System.Data.SQLite.Linq</AssemblyName>
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <TargetFrameworkSubset>Full</TargetFrameworkSubset>
    <SignAssembly>true</SignAssembly>
    <AssemblyOriginatorKeyFile>..\System.Data.SQLite\System.Data.SQLite.snk</AssemblyOriginatorKeyFile>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>..\bin\Designer\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <PlatformTarget>x86</PlatformTarget>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>..\bin\Designer\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <PlatformTarget>x86</PlatformTarget>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Core">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
    <Reference Include="System.Data" />
    <Reference Include="System.Data.Entity">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="AssemblyInfo.cs" />
    <Compile Include="SQL Generation\DmlSqlGenerator.cs" />
    <Compile Include="SQL Generation\ISqlFragment.cs" />
    <Compile Include="SQL Generation\JoinSymbol.cs" />
    <Compile Include="SQL Generation\MetadataHelpers.cs" />
    <Compile Include="SQL Generation\SqlBuilder.cs" />
    <Compile Include="SQL Generation\SqlGenerator.cs" />
    <Compile Include="SQL Generation\SqlSelectStatement.cs" />
    <Compile Include="SQL Generation\SqlWriter.cs" />
    <Compile Include="SQL Generation\Symbol.cs" />
    <Compile Include="SQL Generation\SymbolPair.cs" />
    <Compile Include="SQL Generation\SymbolTable.cs" />
    <Compile Include="SQL Generation\TopClause.cs" />
    <Compile Include="SQLiteProviderManifest.cs" />
    <Compile Include="SQLiteProviderServices.cs" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\System.Data.SQLite\System.Data.SQLite - Full.csproj">
      <Project>{AC139952-261A-4463-B6FA-AEBC25283A66}</Project>
      <Name>System.Data.SQLite - Full</Name>
      <Private>False</Private>
    </ProjectReference>
  </ItemGroup>
  <ItemGroup>
    <None Include="Resources\Common.ConceptualSchemaDefinition.csdl" />
    <None Include="Resources\Common.ProviderManifest.xsd" />
    <EmbeddedResource Include="Resources\SQLiteProviderServices.StoreSchemaDefinition.ssdl" />
    <EmbeddedResource Include="Resources\SQLiteProviderServices.StoreSchemaMapping.msl" />
    <None Include="Resources\System.Data.Resources.CSDLSchema.xsd" />
    <None Include="Resources\System.Data.Resources.CSMSL.xsd" />
    <None Include="Resources\System.Data.Resources.EntityStoreSchemaGenerator.xsd" />
    <None Include="Resources\System.Data.Resources.SSDLSchema.xsd" />
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="Resources\SQLiteProviderServices.ProviderManifest.xml" />
  </ItemGroup>
  <ItemGroup>
    <Folder Include="Properties\" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>