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 Side-by-Side Diffs Show Whitespace Changes Patch

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

            1  +using System.Reflection;
            2  +using System.Runtime.CompilerServices;
            3  +using System.Runtime.InteropServices;
            4  +
            5  +// General Information about an assembly is controlled through the following 
            6  +// set of attributes. Change these attribute values to modify the information
            7  +// associated with an assembly.
            8  +[assembly: AssemblyTitle("System.Data.SQLite.Linq")]
            9  +[assembly: AssemblyDescription("ADO.NET 2.0 Data Provider for SQLite")]
           10  +[assembly: AssemblyConfiguration("")]
           11  +[assembly: AssemblyCompany("http://sqlite.phxsoftware.com")]
           12  +[assembly: AssemblyProduct("System.Data.SQLite")]
           13  +[assembly: AssemblyCopyright("Public Domain")]
           14  +[assembly: AssemblyTrademark("")]
           15  +[assembly: AssemblyCulture("")]
           16  +
           17  +// Setting ComVisible to false makes the types in this assembly not visible 
           18  +// to COM components.  If you need to access a type in this assembly from 
           19  +// COM, set the ComVisible attribute to true on that type.
           20  +[assembly: ComVisible(false)]
           21  +
           22  +// The following GUID is for the ID of the typelib if this project is exposed to COM
           23  +[assembly: Guid("d9d0877d-53d0-4ba6-962e-66b7e1663478")]
           24  +
           25  +// Version information for an assembly consists of the following four values:
           26  +//
           27  +//      Major Version
           28  +//      Minor Version 
           29  +//      Build Number
           30  +//      Revision
           31  +//
           32  +// You can specify all the values or you can default the Build and Revision Numbers 
           33  +// by using the '*' as shown below:
           34  +// [assembly: AssemblyVersion("1.0.*")]
           35  +[assembly: AssemblyVersion("2.0.34.0")]
           36  +[assembly: AssemblyFileVersion("1.0.0.0")]

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

            1  +<?xml version="1.0" encoding="utf-8"?>
            2  +<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">
            3  +
            4  +  <EntityContainer Name="SchemaInformation">
            5  +
            6  +    <EntitySet Name="Tables" EntityType="Self.Table" />
            7  +    <EntitySet Name="TableColumns" EntityType="Self.Column" />
            8  +    <EntitySet Name="TableConstraints" EntityType="Self.Constraint" />
            9  +    <EntitySet Name="TableForeignKeys" EntityType="Self.ForeignKey" />
           10  +    
           11  +    <EntitySet Name="Views" EntityType="Self.View" />
           12  +    <EntitySet Name="ViewColumns" EntityType="Self.Column" />
           13  +    <EntitySet Name="ViewConstraints" EntityType="Self.Constraint" />
           14  +    <EntitySet Name="ViewForeignKeys" EntityType="Self.ForeignKey" />
           15  +    
           16  +    <EntitySet Name="Functions" EntityType="Self.Function" />
           17  +    <EntitySet Name="FunctionParameters" EntityType="Self.Parameter" />
           18  +    <EntitySet Name="Procedures" EntityType="Self.Procedure" />
           19  +    <EntitySet Name="ProcedureParameters" EntityType="Self.Parameter" />
           20  + 
           21  +    <AssociationSet Name="TableTableColumns" Association="Self.TableOrViewColumn" >
           22  +      <End Role="Parent" EntitySet="Tables"/>
           23  +      <End Role="Column" EntitySet="TableColumns"/>
           24  +    </AssociationSet>
           25  +    <AssociationSet Name="TableTableConstraints" Association="Self.TableOrViewConstraint" >
           26  +      <End Role="Parent" EntitySet="Tables"/>
           27  +      <End Role="Constraint" EntitySet="TableConstraints"/>
           28  +    </AssociationSet>
           29  +    <AssociationSet Name="TableConstraintColumns" Association="Self.TableOrViewConstraintColumn" >
           30  +      <End Role="Column" EntitySet="TableColumns"/>
           31  +      <End Role="Constraint" EntitySet="TableConstraints"/>
           32  +    </AssociationSet>
           33  +    <AssociationSet Name="TableConstraintForeignKeys" Association="Self.ConstraintForeignKey" >
           34  +      <End Role="ForeignKey" EntitySet="TableForeignKeys"/>
           35  +      <End Role="Constraint" EntitySet="TableConstraints"/>
           36  +    </AssociationSet>
           37  +    <AssociationSet Name="FromTableForeignKeyColumns" Association="Self.FromForeignKeyColumn" >
           38  +      <End Role="Column" EntitySet="TableColumns"/>
           39  +      <End Role="ForeignKey" EntitySet="TableForeignKeys"/>
           40  +    </AssociationSet>
           41  +    <AssociationSet Name="ToTableForeignKeyColumns" Association="Self.ToForeignKeyColumn" >
           42  +      <End Role="Column" EntitySet="TableColumns"/>
           43  +      <End Role="ForeignKey" EntitySet="TableForeignKeys"/>
           44  +    </AssociationSet>
           45  +    
           46  +    <AssociationSet Name="ViewViewColumns" Association="Self.TableOrViewColumn" >
           47  +      <End Role="Parent" EntitySet="Views"/>
           48  +      <End Role="Column" EntitySet="ViewColumns"/>
           49  +    </AssociationSet>
           50  +    <AssociationSet Name="ViewViewConstraints" Association="Self.TableOrViewConstraint" >
           51  +      <End Role="Parent" EntitySet="Views"/>
           52  +      <End Role="Constraint" EntitySet="ViewConstraints"/>
           53  +    </AssociationSet>
           54  +    <AssociationSet Name="ViewConstraintColumns" Association="Self.TableOrViewConstraintColumn" >
           55  +      <End Role="Column" EntitySet="ViewColumns"/>
           56  +      <End Role="Constraint" EntitySet="ViewConstraints"/>
           57  +    </AssociationSet>
           58  +    <AssociationSet Name="ViewConstraintForeignKeys" Association="Self.ConstraintForeignKey" >
           59  +      <End Role="ForeignKey" EntitySet="ViewForeignKeys"/>
           60  +      <End Role="Constraint" EntitySet="ViewConstraints"/>
           61  +    </AssociationSet>
           62  +    <AssociationSet Name="FromViewForeignKeyColumns" Association="Self.FromForeignKeyColumn" >
           63  +      <End Role="Column" EntitySet="ViewColumns"/>
           64  +      <End Role="ForeignKey" EntitySet="ViewForeignKeys"/>
           65  +    </AssociationSet>
           66  +    <AssociationSet Name="ToViewForeignKeyColumns" Association="Self.ToForeignKeyColumn" >
           67  +      <End Role="Column" EntitySet="ViewColumns"/>
           68  +      <End Role="ForeignKey" EntitySet="ViewForeignKeys"/>
           69  +    </AssociationSet>
           70  +    
           71  +    <AssociationSet Name="FunctionFunctionParameters" Association="Self.RoutineParameter" >
           72  +      <End Role="Routine" EntitySet="Functions"/>
           73  +      <End Role="Parameter" EntitySet="FunctionParameters"/>
           74  +    </AssociationSet>
           75  +    
           76  +    <AssociationSet Name="ProcedureProcedureParameters" Association="Self.RoutineParameter" >
           77  +      <End Role="Routine" EntitySet="Procedures"/>
           78  +      <End Role="Parameter" EntitySet="ProcedureParameters"/>
           79  +    </AssociationSet>
           80  +
           81  +  </EntityContainer>
           82  +
           83  +  <ComplexType Name="TypeSpecification">
           84  +    <Property Name="TypeName" Nullable="false" Type="String"  />
           85  +    <Property Name="MaxLength" Nullable="true" Type="Int32" />
           86  +    <Property Name="Precision" Nullable="true" Type="Int16" />
           87  +    <Property Name="DateTimePrecision" Nullable="true" Type="Int32" />
           88  +    <Property Name="Scale" Nullable="true" Type="Int32" />
           89  +    <Property Name="Collation" Nullable="false" Type="Self.Collation" />
           90  +    <Property Name="CharacterSet" Nullable="false" Type="Self.CharacterSet" />
           91  +    <Property Name="IsMultiSet" Nullable="false" Type="Boolean"/>
           92  +  </ComplexType>
           93  +
           94  +  <ComplexType Name="Collation">
           95  +    <Property Name="CatalogName" Nullable="true" Type="String"  />
           96  +    <Property Name="SchemaName" Nullable="true" Type="String" />
           97  +    <Property Name="Name" Nullable="true" Type="String" />
           98  +  </ComplexType>
           99  +
          100  +  <ComplexType Name="CharacterSet">
          101  +    <Property Name="CatalogName" Nullable="true" Type="String"  />
          102  +    <Property Name="SchemaName" Nullable="true" Type="String" />
          103  +    <Property Name="Name" Nullable="true" Type="String" />
          104  +  </ComplexType>
          105  +
          106  +  <EntityType Name="TableOrView" Abstract="true">
          107  +    <Key>
          108  +      <PropertyRef Name="Id" />
          109  +    </Key>
          110  +    <Property Name="Id" Nullable="false" Type="String"  />
          111  +    <Property Name="Name" Nullable="false" Type="String"  />
          112  +    <Property Name="CatalogName" Type="String"  />
          113  +    <Property Name="SchemaName" Type="String"  />
          114  +    <NavigationProperty Relationship="Self.TableOrViewColumn" Name="Columns" FromRole="Parent" ToRole="Column" />
          115  +    <NavigationProperty Relationship="Self.TableOrViewConstraint" Name="Constraints" FromRole="Parent" ToRole="Constraint" />
          116  +  </EntityType>
          117  +
          118  +  <EntityType Name="Table" BaseType="Self.TableOrView">
          119  +  </EntityType>
          120  +
          121  +  <EntityType Name="Column">
          122  +    <Key>
          123  +      <PropertyRef Name="Id" />
          124  +    </Key>
          125  +    <Property Name="Id" Nullable="false" Type="String"  />
          126  +    <Property Name="Name" Nullable="false" Type="String" />
          127  +    <Property Name="Ordinal" Nullable="false" Type="Int32" />
          128  +    <Property Name="IsNullable" Nullable="false" Type="Boolean" />
          129  +    <Property Name="ColumnType" Nullable="false" Type="Self.TypeSpecification"/>
          130  +    <Property Name="IsIdentity" Nullable="false" Type="Boolean" />
          131  +    <Property Name="IsStoreGenerated" Nullable="false" Type="Boolean" />
          132  +    <Property Name="Default" Type="String" />
          133  +    <NavigationProperty Relationship="Self.TableOrViewColumn" Name="Parent" FromRole="Column" ToRole="Parent" />
          134  +  </EntityType>
          135  +  
          136  +  <EntityType Name="View" BaseType="Self.TableOrView">
          137  +    <Property Name="IsUpdatable" Nullable="false" Type="Boolean" />
          138  +    <Property Name="ViewDefinition" Nullable="true" Type="String"  />
          139  +  </EntityType>
          140  +  
          141  +  <EntityType Name="Routine" Abstract="true">
          142  +    <Key>
          143  +      <PropertyRef Name="Id" />
          144  +    </Key>
          145  +    <Property Name="Id" Nullable="false" Type="String"  />
          146  +    <Property Name="CatalogName" Type="String"  />
          147  +    <Property Name="SchemaName" Type="String"  />
          148  +    <Property Name="Name" Nullable="false" Type="String"  />
          149  +    <NavigationProperty Relationship="Self.RoutineParameter" Name="Parameters" FromRole="Routine" ToRole="Parameter" />
          150  +  </EntityType>
          151  +  
          152  +  <EntityType Name="Parameter">
          153  +    <Key>
          154  +      <PropertyRef Name="Id" />
          155  +    </Key>
          156  +    <Property Name="Id" Nullable="false" Type="String"  />
          157  +    <Property Name="Name" Nullable="false" Type="String"  />
          158  +    <Property Name="Ordinal" Nullable="false" Type="Int32" />
          159  +    <Property Name="ParameterType" Nullable="false" Type="Self.TypeSpecification"/>
          160  +    <Property Name="Mode" Type="String"  />
          161  +    <Property Name="Default" Type="String"  />
          162  +    <NavigationProperty Relationship="Self.RoutineParameter" Name="Routine" FromRole="Parameter" ToRole="Routine" />
          163  +  </EntityType>
          164  +
          165  +  <EntityType Name="Function" BaseType="Self.Routine" Abstract="true">
          166  +    <Property Name="IsBuiltIn" Type="Boolean" />
          167  +    <Property Name="IsNiladic" Type="Boolean" />
          168  +  </EntityType>
          169  +
          170  +  <EntityType Name="ScalarFunction" BaseType="Self.Function">
          171  +    <Property Name="ReturnType" Type="Self.TypeSpecification" Nullable="false"/>
          172  +    <Property Name="IsAggregate" Type="Boolean" />
          173  +  </EntityType>
          174  +
          175  +  <EntityType Name="Procedure" BaseType="Self.Routine">
          176  +  </EntityType>
          177  +
          178  +  <EntityType Name="Constraint" Abstract="true">
          179  +    <Key>
          180  +      <PropertyRef Name="Id" />
          181  +    </Key>
          182  +    <Property Name="Id" Nullable="false" Type="String"  />
          183  +    <Property Name="Name" Nullable="false" Type="String"  />
          184  +    <Property Name="IsDeferrable" Nullable="false" Type="Boolean"  />
          185  +    <Property Name="IsInitiallyDeferred" Nullable="false" Type="Boolean"  />
          186  +    <NavigationProperty Relationship="Self.TableOrViewConstraint" Name="Parent" FromRole="Constraint" ToRole="Parent" />
          187  +  </EntityType>
          188  +
          189  +  <EntityType Name="CheckConstraint" BaseType="Self.Constraint">
          190  +    <Property Name="Expression" Nullable="false" Type="String" />
          191  +  </EntityType>
          192  +  
          193  +  <EntityType Name="TableOrViewColumnConstraint" BaseType="Self.Constraint" Abstract="true">
          194  +    <NavigationProperty Relationship="Self.TableOrViewConstraintColumn" Name="Columns" FromRole="Constraint" ToRole="Column" />
          195  +  </EntityType>
          196  +
          197  +  <EntityType Name="PrimaryKeyConstraint" BaseType="Self.TableOrViewColumnConstraint">
          198  +  </EntityType>
          199  +
          200  +  <EntityType Name="UniqueConstraint" BaseType="Self.TableOrViewColumnConstraint">
          201  +  </EntityType>
          202  +
          203  +  <EntityType Name="ForeignKeyConstraint" BaseType="Self.Constraint">
          204  +    <Property Name="UpdateRule" Nullable="false" Type="String"  />
          205  +    <Property Name="DeleteRule" Nullable="false" Type="String"  />
          206  +    <NavigationProperty Relationship="Self.ConstraintForeignKey" Name="ForeignKeys" FromRole="Constraint" ToRole="ForeignKey" />
          207  +  </EntityType>
          208  +
          209  +  <EntityType Name="ForeignKey">
          210  +    <Key>
          211  +      <PropertyRef Name="Id" />
          212  +    </Key>
          213  +    <Property Name="Id" Nullable="false" Type="String"  />
          214  +    <Property Name="Ordinal" Nullable="false" Type="Int32" />
          215  +    <NavigationProperty Relationship="Self.ConstraintForeignKey" Name="Constraint" FromRole="ForeignKey" ToRole="Constraint" />
          216  +    <NavigationProperty Relationship="Self.FromForeignKeyColumn" Name="FromColumn" FromRole="ForeignKey" ToRole="Column" />
          217  +    <NavigationProperty Relationship="Self.ToForeignKeyColumn" Name="ToColumn" FromRole="ForeignKey" ToRole="Column" />
          218  +  </EntityType>
          219  +  
          220  +  <Association Name="TableOrViewColumn">
          221  +    <End Type="Self.TableOrView" Role="Parent" Multiplicity="1" />
          222  +    <End Type="Self.Column" Role="Column" Multiplicity="*" />
          223  +  </Association>
          224  +  
          225  +  <Association Name="TableOrViewConstraint">
          226  +    <End Type="Self.TableOrView" Role="Parent" Multiplicity="1" />
          227  +    <End Type="Self.Constraint" Role="Constraint" Multiplicity="*" />
          228  +  </Association>
          229  +
          230  +  <Association Name="TableOrViewConstraintColumn">
          231  +    <End Type="Self.TableOrViewColumnConstraint" Role="Constraint" Multiplicity="*" />
          232  +    <End Type="Self.Column" Role="Column" Multiplicity="*" />
          233  +  </Association>
          234  +
          235  +  <Association Name="ConstraintForeignKey">
          236  +    <End Type="Self.ForeignKeyConstraint" Role="Constraint" Multiplicity="1" />
          237  +    <End Type="Self.ForeignKey" Role="ForeignKey" Multiplicity="*" />
          238  +  </Association>
          239  +
          240  +  <Association Name="ToForeignKeyColumn">
          241  +    <End Type="Self.ForeignKey" Role="ForeignKey" Multiplicity="*" />
          242  +    <End Type="Self.Column" Role="Column" Multiplicity="1" />
          243  +  </Association>
          244  +
          245  +  <Association Name="FromForeignKeyColumn">
          246  +    <End Type="Self.ForeignKey" Role="ForeignKey" Multiplicity="*" />
          247  +    <End Type="Self.Column" Role="Column" Multiplicity="1" />
          248  +  </Association>
          249  +  
          250  +  <Association Name="RoutineParameter">
          251  +    <End Type="Self.Routine" Role="Routine" Multiplicity="1" />
          252  +    <End Type="Self.Parameter" Role="Parameter" Multiplicity="*" />
          253  +  </Association>
          254  +
          255  +</Schema>

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

            1  +<?xml version="1.0" encoding="utf-8"?>
            2  +<xs:schema elementFormDefault="qualified"
            3  +		   xmlns:xs="http://www.w3.org/2001/XMLSchema"
            4  +		   targetNamespace="http://schemas.microsoft.com/ado/2006/04/edm/providermanifest"
            5  +		   xmlns:pm="http://schemas.microsoft.com/ado/2006/04/edm/providermanifest">
            6  +
            7  +  <xs:element name="ProviderManifest">
            8  +    <xs:complexType>
            9  +      <xs:sequence>
           10  +        <xs:element name="Types" type="pm:TTypes" minOccurs="1" maxOccurs="1" />
           11  +        <xs:element name="Functions" type="pm:TFunctions" minOccurs="0" maxOccurs="1"/>
           12  +      </xs:sequence>
           13  +      <xs:attribute name="Namespace" type="xs:string" use="required"/>
           14  +    </xs:complexType>
           15  +  </xs:element>
           16  +  <xs:complexType name="TVersion">
           17  +    <xs:attribute name="Major" type="xs:int" use="required" />
           18  +    <xs:attribute name="Minor" type="xs:int" use="required" />
           19  +    <xs:attribute name="Build" type="xs:int" use="required" />
           20  +    <xs:attribute name="Revision" type="xs:int" use="required" />
           21  +  </xs:complexType>
           22  +
           23  +  <xs:complexType name="TIntegerFacetDescription">
           24  +    <xs:attribute name="Minimum" type="xs:int" use="optional" />
           25  +    <xs:attribute name="Maximum" type="xs:int" use="optional" />
           26  +    <xs:attribute name="DefaultValue" type="xs:int" use="optional" />
           27  +    <xs:attribute name="Constant" type="xs:boolean" default="false" />
           28  +  </xs:complexType>
           29  +
           30  +  <xs:complexType name="TBooleanFacetDescription">
           31  +    <xs:attribute name="DefaultValue" type="xs:boolean" use="optional" />
           32  +    <xs:attribute name="Constant" type="xs:boolean" default="true" />
           33  +  </xs:complexType>
           34  +
           35  +  <xs:complexType name="TDateTimeFacetDescription">
           36  +    <xs:attribute name="Constant" type="xs:boolean" default="false" />
           37  +  </xs:complexType>
           38  +
           39  +  <xs:complexType name="TFacetDescriptions">
           40  +    <xs:choice maxOccurs="unbounded">
           41  +      <xs:element name="Precision" minOccurs="0" maxOccurs="1" type="pm:TIntegerFacetDescription"/>
           42  +      <xs:element name="Scale" minOccurs="0" maxOccurs="1" type="pm:TIntegerFacetDescription"/>
           43  +      <xs:element name="MaxLength" minOccurs="0" maxOccurs="1" type="pm:TIntegerFacetDescription"/>
           44  +      <xs:element name="Unicode" minOccurs="0" maxOccurs="1" type="pm:TBooleanFacetDescription"/>
           45  +      <xs:element name="FixedLength" minOccurs="0" maxOccurs="1" type="pm:TBooleanFacetDescription"/>
           46  +    </xs:choice>
           47  +  </xs:complexType>
           48  +
           49  +  <xs:complexType name="TType">
           50  +    <xs:sequence>
           51  +      <xs:element name="FacetDescriptions" type="pm:TFacetDescriptions" minOccurs="0" maxOccurs="1"/>
           52  +    </xs:sequence>
           53  +    <xs:attribute name="Name" type="xs:string" use="required"/>
           54  +    <xs:attribute name="PrimitiveTypeKind" type="pm:TPrimitiveTypeKind" use="required" />
           55  +  </xs:complexType>
           56  +
           57  +  <xs:complexType name="TTypes">
           58  +    <xs:sequence>
           59  +      <xs:element name="Type" type="pm:TType" minOccurs="0" maxOccurs="unbounded"/>
           60  +    </xs:sequence>
           61  +  </xs:complexType>
           62  +
           63  +  <xs:attributeGroup name="TFacetAttribute">
           64  +    <xs:attribute name="Precision" type="xs:int" use="optional"/>
           65  +    <xs:attribute name="Scale" type="xs:int" use="optional"/>
           66  +    <xs:attribute name="MaxLength" type="xs:int" use="optional"/>
           67  +    <xs:attribute name="Unicode" type="xs:boolean" use="optional"/>
           68  +    <xs:attribute name="FixedLength" type="xs:boolean" use="optional"/>
           69  +  </xs:attributeGroup>
           70  +
           71  +  <xs:complexType name="TFunctionParameter">
           72  +    <xs:attribute name="Name" type="xs:string" use="required" />
           73  +    <xs:attribute name="Type" type="xs:string" use="required" />
           74  +    <xs:attributeGroup ref="pm:TFacetAttribute" />
           75  +    <xs:attribute name="Mode" type="pm:TParameterDirection" use="required" />
           76  +  </xs:complexType>
           77  +
           78  +  <xs:complexType name="TReturnType">
           79  +    <xs:attribute name="Type" type="xs:string" use="required" />
           80  +    <xs:attributeGroup ref="pm:TFacetAttribute" />
           81  +  </xs:complexType>
           82  +
           83  +  <xs:complexType name="TFunction">
           84  +    <xs:choice minOccurs="0" maxOccurs ="unbounded">
           85  +      <xs:element name ="ReturnType" type="pm:TReturnType" minOccurs="0" maxOccurs="1" />
           86  +      <xs:element name="Parameter" type="pm:TFunctionParameter" minOccurs="0" maxOccurs="unbounded"/>
           87  +    </xs:choice>
           88  +    <xs:attribute name="Name" type="xs:string" use="required" />
           89  +    <xs:attribute name="Aggregate" type="xs:boolean" use="optional" />
           90  +    <xs:attribute name="BuiltIn" type="xs:boolean" use="optional" />
           91  +    <xs:attribute name="StoreFunctionName" type="xs:string" use="optional" />
           92  +    <xs:attribute name="NiladicFunction" type="xs:boolean" use="optional" />
           93  +    <xs:attribute name="ParameterTypeSemantics" type="pm:TParameterTypeSemantics" use="optional" default="AllowImplicitConversion" />
           94  +  </xs:complexType>
           95  +
           96  +  <xs:complexType name="TFunctions">
           97  +    <xs:sequence>
           98  +      <xs:element name="Function" type="pm:TFunction" minOccurs="0" maxOccurs="unbounded"/>
           99  +    </xs:sequence>
          100  +  </xs:complexType>
          101  +
          102  +  <xs:simpleType name="TPrimitiveTypeKind">
          103  +    <xs:restriction base="xs:string">
          104  +      <xs:enumeration value="Binary"/>
          105  +      <xs:enumeration value="Boolean"/>
          106  +      <xs:enumeration value="Byte"/>
          107  +      <xs:enumeration value="Decimal"/>
          108  +      <xs:enumeration value="DateTime"/>
          109  +      <xs:enumeration value="Time"/>
          110  +      <xs:enumeration value="DateTimeOffset"/>        
          111  +      <xs:enumeration value="Double"/>
          112  +      <xs:enumeration value="Guid"/>
          113  +      <xs:enumeration value="Single"/>
          114  +      <xs:enumeration value="SByte"/>
          115  +      <xs:enumeration value="Int16"/>
          116  +      <xs:enumeration value="Int32"/>
          117  +      <xs:enumeration value="Int64"/>
          118  +      <xs:enumeration value="String"/>
          119  +    </xs:restriction>
          120  +  </xs:simpleType>
          121  +
          122  +
          123  +  <xs:simpleType name="TParameterDirection">
          124  +    <xs:restriction base="xs:string">
          125  +      <xs:enumeration value="In"/>
          126  +      <xs:enumeration value="Out"/>
          127  +      <xs:enumeration value="InOut"/>
          128  +    </xs:restriction>
          129  +  </xs:simpleType>
          130  +
          131  +  <xs:simpleType name="TParameterTypeSemantics">
          132  +    <xs:restriction base="xs:string">
          133  +      <xs:enumeration value="ExactMatchOnly" />
          134  +      <xs:enumeration value="AllowImplicitPromotion" />
          135  +      <xs:enumeration value="AllowImplicitConversion" />
          136  +    </xs:restriction>
          137  +  </xs:simpleType>
          138  +</xs:schema>

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

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

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

            1  +<?xml version="1.0" encoding="utf-8"?>
            2  +<Schema Namespace="SQLite" Provider="System.Data.SQLite" ProviderManifestToken="SQLite" Alias="Self" xmlns="http://schemas.microsoft.com/ado/2006/04/edm/ssdl">
            3  +  <EntityContainer Name="Schema">
            4  +    <EntitySet Name="STables" EntityType="Self.Table">
            5  +      <DefiningQuery>
            6  +        SELECT
            7  +        '[' || TABLE_NAME || ']' [Id]
            8  +        ,   TABLE_CATALOG [CatalogName]
            9  +        ,   TABLE_SCHEMA [SchemaName]
           10  +        ,   TABLE_NAME    [Name]
           11  +        FROM
           12  +        TEMP.SCHEMATABLES
           13  +        WHERE
           14  +        TABLE_TYPE LIKE 'table'
           15  +      </DefiningQuery>
           16  +    </EntitySet>
           17  +
           18  +    <EntitySet Name="STableColumns" EntityType="Self.TableColumn">
           19  +      <DefiningQuery>
           20  +        SELECT
           21  +        '[' || c.TABLE_NAME || ']' || '[' || c.COLUMN_NAME || ']' [Id]
           22  +        ,   '[' || c.TABLE_NAME || ']'                             [ParentId]
           23  +        ,   c.COLUMN_NAME   [Name]
           24  +        ,   c.ORDINAL_POSITION [Ordinal]
           25  +        ,   c.IS_NULLABLE [IsNullable]
           26  +        ,   c.EDM_TYPE [TypeName]
           27  +        ,   c.CHARACTER_MAXIMUM_LENGTH [MaxLength]
           28  +        ,   c.NUMERIC_PRECISION [Precision]
           29  +        ,   c.DATETIME_PRECISION [DateTimePrecision]
           30  +        ,   c.NUMERIC_SCALE [Scale]
           31  +        ,   c.COLLATION_CATALOG [CollationCatalog]
           32  +        ,   c.COLLATION_SCHEMA [CollationSchema]
           33  +        ,   c.COLLATION_NAME [CollationName]
           34  +        ,   c.CHARACTER_SET_CATALOG [CharacterSetCatalog]
           35  +        ,   c.CHARACTER_SET_SCHEMA [CharacterSetSchema]
           36  +        ,   c.CHARACTER_SET_NAME [CharacterSetName]
           37  +        ,   0 as [IsMultiSet]
           38  +        ,   c.PRIMARY_KEY as [IsIdentity]
           39  +        ,   0 as [IsStoreGenerated]
           40  +        , c.COLUMN_DEFAULT as [Default]
           41  +        FROM
           42  +        TEMP.SCHEMACOLUMNS c
           43  +      </DefiningQuery>
           44  +    </EntitySet>
           45  +
           46  +    <EntitySet Name="SViews" EntityType="Self.View">
           47  +      <DefiningQuery>
           48  +        SELECT
           49  +        '[' || TABLE_NAME || ']' [Id]
           50  +        ,   TABLE_CATALOG             [CatalogName]
           51  +        ,   TABLE_SCHEMA              [SchemaName]
           52  +        ,   TABLE_NAME                [Name]
           53  +        ,   VIEW_DEFINITION           [ViewDefinition]
           54  +        ,   IS_UPDATABLE              [IsUpdatable]
           55  +        FROM
           56  +        TEMP.SCHEMAVIEWS
           57  +      </DefiningQuery>
           58  +    </EntitySet>
           59  +
           60  +    <EntitySet Name="SViewColumns" EntityType="Self.ViewColumn">
           61  +      <DefiningQuery>
           62  +        SELECT
           63  +        '[' || c.TABLE_NAME || ']' || '[' || c.COLUMN_NAME || ']' [Id]
           64  +        ,   '[' || c.TABLE_NAME || ']'                             [ParentId]
           65  +        ,   c.COLUMN_NAME   [Name]
           66  +        ,   c.ORDINAL_POSITION [Ordinal]
           67  +        ,   c.IS_NULLABLE [IsNullable]
           68  +        ,   c.EDM_TYPE [TypeName]
           69  +        ,   c.CHARACTER_MAXIMUM_LENGTH [MaxLength]
           70  +        ,   c.NUMERIC_PRECISION [Precision]
           71  +        ,   c.DATETIME_PRECISION as [DateTimePrecision]
           72  +        ,   c.NUMERIC_SCALE [Scale]
           73  +        ,   c.COLLATION_CATALOG [CollationCatalog]
           74  +        ,   c.COLLATION_SCHEMA [CollationSchema]
           75  +        ,   c.COLLATION_NAME [CollationName]
           76  +        ,   c.CHARACTER_SET_CATALOG [CharacterSetCatalog]
           77  +        ,   c.CHARACTER_SET_SCHEMA [CharacterSetSchema]
           78  +        ,   c.CHARACTER_SET_NAME [CharacterSetName]
           79  +        ,   0 as [IsMultiSet]
           80  +        ,   c.PRIMARY_KEY as [IsIdentity]
           81  +        ,   0 as [IsStoreGenerated]
           82  +        ,   c.COLUMN_DEFAULT [Default]
           83  +        FROM
           84  +        TEMP.SCHEMAVIEWCOLUMNS c
           85  +      </DefiningQuery>
           86  +    </EntitySet>
           87  +
           88  +    <EntitySet Name="SFunctions" EntityType="Self.Function">
           89  +      <DefiningQuery>
           90  +        SELECT
           91  +        NULL [Id]
           92  +        , NULL         [CatalogName]
           93  +        , NULL         [SchemaName]
           94  +        , NULL         [Name]
           95  +        , NULL         [ReturnTypeName]
           96  +        , NULL [ReturnMaxLength]
           97  +        , NULL        [ReturnPrecision]
           98  +        , NULL [ReturnDateTimePrecision]
           99  +        , NULL            [ReturnScale]
          100  +        , NULL        [ReturnCollationCatalog]
          101  +        , NULL         [ReturnCollationSchema]
          102  +        , NULL           [ReturnCollationName]
          103  +        , NULL    [ReturnCharacterSetCatalog]
          104  +        , NULL     [ReturnCharacterSetSchema]
          105  +        , NULL       [ReturnCharacterSetName]
          106  +        , NULL as        [ReturnIsMultiSet]
          107  +        , NULL as [IsAggregate]
          108  +        , NULL as [IsBuiltIn]
          109  +        , NULL as [IsNiladic]
          110  +        WHERE 1=2
          111  +      </DefiningQuery>
          112  +    </EntitySet>
          113  +
          114  +    <EntitySet Name="SFunctionParameters" EntityType="Self.Parameter">
          115  +      <DefiningQuery>
          116  +        SELECT
          117  +        NULL [Id]
          118  +        , NULL [ParentId]
          119  +        , NULL [Name]
          120  +        , NULL [Ordinal]
          121  +        , NULL [TypeName]
          122  +        , NULL [MaxLength]
          123  +        , NULL [Precision]
          124  +        , NULL [DateTimePrecision]
          125  +        , NULL    [Scale]
          126  +        , NULL [CollationCatalog]
          127  +        , NULL [CollationSchema]
          128  +        , NULL [CollationName]
          129  +        , NULL [CharacterSetCatalog]
          130  +        , NULL [CharacterSetSchema]
          131  +        , NULL [CharacterSetName]
          132  +        , NULL [IsMultiSet]
          133  +        , NULL [Mode]
          134  +        , NULL [Default]
          135  +        WHERE 1=2
          136  +      </DefiningQuery>
          137  +    </EntitySet>
          138  +
          139  +    <EntitySet Name="SProcedures" EntityType="Self.Procedure">
          140  +      <DefiningQuery>
          141  +        SELECT
          142  +        NULL [Id]
          143  +        , NULL         [CatalogName]
          144  +        , NULL          [SchemaName]
          145  +        , NULL            [Name]
          146  +        WHERE 1=2
          147  +      </DefiningQuery>
          148  +    </EntitySet>
          149  +
          150  +    <EntitySet Name="SProcedureParameters" EntityType="Self.Parameter">
          151  +      <DefiningQuery>
          152  +        SELECT
          153  +        NULL [Id]
          154  +        , NULL [ParentId]
          155  +        , NULL [Name]
          156  +        , NULL [Ordinal]
          157  +        , NULL [TypeName]
          158  +        , NULL [MaxLength]
          159  +        , NULL [Precision]
          160  +        , NULL [DateTimePrecision]
          161  +        , NULL [Scale]
          162  +        , NULL [CollationCatalog]
          163  +        , NULL [CollationSchema]
          164  +        , NULL [CollationName]
          165  +        , NULL [CharacterSetCatalog]
          166  +        , NULL [CharacterSetSchema]
          167  +        , NULL [CharacterSetName]
          168  +        , NULL as [IsMultiSet]
          169  +        , NULL   [Mode]
          170  +        , NULL [Default]
          171  +        WHERE 1=2
          172  +      </DefiningQuery>
          173  +    </EntitySet>
          174  +
          175  +    <EntitySet Name="SConstraints" EntityType="Self.Constraint">
          176  +      <DefiningQuery>
          177  +        SELECT
          178  +        '[' || tc.CONSTRAINT_NAME || ']' [Id]
          179  +        , '[' || tc.TABLE_NAME || ']' [ParentId]
          180  +        , tc.CONSTRAINT_NAME [Name]
          181  +        , tc.CONSTRAINT_TYPE [ConstraintType]
          182  +        , tc.IS_DEFERRABLE [IsDeferrable]
          183  +        , tc.INITIALLY_DEFERRED [IsInitiallyDeferred]
          184  +        FROM
          185  +        TEMP.SCHEMACONSTRAINTS tc
          186  +      </DefiningQuery>
          187  +    </EntitySet>
          188  +
          189  +    <EntitySet Name="SCheckConstraints" EntityType="Self.CheckConstraint">
          190  +      <DefiningQuery>
          191  +        SELECT
          192  +        NULL [Id]
          193  +        , NULL [Expression]
          194  +        WHERE 1 = 2
          195  +      </DefiningQuery>
          196  +    </EntitySet>
          197  +
          198  +    <EntitySet Name="SConstraintColumns" EntityType="Self.ConstraintColumn">
          199  +      <DefiningQuery>
          200  +        SELECT
          201  +        '[' || CONSTRAINT_NAME || ']' [ConstraintId]
          202  +        , '[' || TABLE_NAME || ']' || '[' || COLUMN_NAME    || ']' [ColumnId]
          203  +        FROM
          204  +        TEMP.SCHEMACONSTRAINTCOLUMNS
          205  +      </DefiningQuery>
          206  +    </EntitySet>
          207  +
          208  +    <EntitySet Name="SForeignKeyConstraints" EntityType="Self.ForeignKeyConstraint">
          209  +      <DefiningQuery>
          210  +        SELECT
          211  +        '[' || rc.CONSTRAINT_NAME || ']' [Id]
          212  +        , 'NO ACTION' [UpdateRule]
          213  +        , 'NO ACTION' [DeleteRule]
          214  +        FROM
          215  +        TEMP.SCHEMAFOREIGNKEYS rc
          216  +      </DefiningQuery>
          217  +    </EntitySet>
          218  +
          219  +    <EntitySet Name="SForeignKeys" EntityType="Self.ForeignKey">
          220  +      <DefiningQuery>
          221  +        SELECT
          222  +        '[' || FC.CONSTRAINT_NAME || ']' || '[' || FC.FKEY_FROM_ORDINAL_POSITION || ']' [Id]
          223  +        ,   '[' || FC.FKEY_TO_TABLE || ']' || '[' || FC.FKEY_TO_COLUMN || ']' [ToColumnId]
          224  +        ,   '[' || FC.TABLE_NAME || ']' || '[' || FC.FKEY_FROM_COLUMN || ']' [FromColumnId]
          225  +        ,   '[' || FC.CONSTRAINT_NAME || ']' [ConstraintId]
          226  +        ,   FC.FKEY_FROM_ORDINAL_POSITION [Ordinal]
          227  +        FROM
          228  +        TEMP.SCHEMAFOREIGNKEYS FC
          229  +      </DefiningQuery>
          230  +    </EntitySet>
          231  +
          232  +    <EntitySet Name="SViewConstraints" EntityType="Self.ViewConstraint">
          233  +      <DefiningQuery>
          234  +        SELECT
          235  +        NULL   [Id]
          236  +        , NULL [ParentId]
          237  +        , NULL [Name]
          238  +        , NULL [ConstraintType]
          239  +        , NULL [IsDeferrable]
          240  +        , NULL [IsInitiallyDeferred]
          241  +        , NULL [Expression]
          242  +        , NULL  [UpdateRule]
          243  +        , NULL  [DeleteRule]
          244  +        WHERE 1=2
          245  +      </DefiningQuery>
          246  +    </EntitySet>
          247  +
          248  +    <EntitySet Name="SViewConstraintColumns" EntityType="Self.ConstraintColumn">
          249  +      <DefiningQuery>
          250  +        SELECT
          251  +        NULL  [ConstraintId]
          252  +        , NULL [ColumnId]
          253  +        WHERE 1=2
          254  +      </DefiningQuery>
          255  +    </EntitySet>
          256  +
          257  +    <EntitySet Name="SViewForeignKeys" EntityType="Self.ForeignKey">
          258  +      <DefiningQuery>
          259  +        SELECT
          260  +        NULL  [Id]
          261  +        ,  NULL [ToColumnId]
          262  +        ,  NULL [FromColumnId]
          263  +        ,  NULL  [ConstraintId]
          264  +        ,  0 [Ordinal]
          265  +        WHERE 1=2
          266  +      </DefiningQuery>
          267  +    </EntitySet>
          268  +
          269  +    <AssociationSet Name="STableTableColumns" Association="Self.TableTableColumn" >
          270  +      <End Role="Parent" EntitySet="STables"/>
          271  +      <End Role="Column" EntitySet="STableColumns"/>
          272  +    </AssociationSet>
          273  +    <AssociationSet Name="STableConstraints" Association="Self.TableTableConstraint" >
          274  +      <End Role="Parent" EntitySet="STables"/>
          275  +      <End Role="Constraint" EntitySet="SConstraints"/>
          276  +    </AssociationSet>
          277  +    <AssociationSet Name="SConstraintConstraintColumns" Association="Self.ConstraintConstraintColumn" >
          278  +      <End Role="ConstraintColumn" EntitySet="SConstraintColumns"/>
          279  +      <End Role="Constraint" EntitySet="SConstraints"/>
          280  +    </AssociationSet>    
          281  +    <AssociationSet Name="SConstraintForeignKeys" Association="Self.ConstraintForeignKey" >
          282  +      <End Role="ForeignKey" EntitySet="SForeignKeys"/>
          283  +      <End Role="Constraint" EntitySet="SForeignKeyConstraints"/>
          284  +    </AssociationSet>
          285  +    <AssociationSet Name="SFromForeignKeyColumns" Association="Self.FromForeignKeyColumn" >
          286  +      <End Role="ForeignKey" EntitySet="SForeignKeys"/>
          287  +      <End Role="Column" EntitySet="STableColumns"/>
          288  +    </AssociationSet>
          289  +    <AssociationSet Name="SToForeignKeyColumns" Association="Self.ToForeignKeyColumn" >
          290  +      <End Role="ForeignKey" EntitySet="SForeignKeys"/>
          291  +      <End Role="Column" EntitySet="STableColumns"/>
          292  +    </AssociationSet>
          293  +
          294  +    <AssociationSet Name="SViewViewColumns" Association="Self.ViewViewColumn" >
          295  +      <End Role="Parent" EntitySet="SViews"/>
          296  +      <End Role="Column" EntitySet="SViewColumns"/>
          297  +    </AssociationSet>
          298  +    <AssociationSet Name="SViewViewConstraints" Association="Self.ViewViewConstraint" >
          299  +      <End Role="Parent" EntitySet="SViews"/>
          300  +      <End Role="Constraint" EntitySet="SViewConstraints"/>
          301  +    </AssociationSet>
          302  +    <AssociationSet Name="SViewConstraintConstraintColumns" Association="Self.ViewConstraintConstraintColumn" >
          303  +      <End Role="ConstraintColumn" EntitySet="SViewConstraintColumns"/>
          304  +      <End Role="Constraint" EntitySet="SViewConstraints"/>
          305  +    </AssociationSet>
          306  +    <AssociationSet Name="SViewConstraintForeignKeys" Association="Self.ViewConstraintForeignKey" >
          307  +      <End Role="ForeignKey" EntitySet="SViewForeignKeys"/>
          308  +      <End Role="Constraint" EntitySet="SViewConstraints"/>
          309  +    </AssociationSet>
          310  +    <AssociationSet Name="SFromForeignKeyViewColumns" Association="Self.FromForeignKeyViewColumn" >
          311  +      <End Role="ForeignKey" EntitySet="SViewForeignKeys"/>
          312  +      <End Role="Column" EntitySet="SViewColumns"/>
          313  +    </AssociationSet>
          314  +    <AssociationSet Name="SToForeignKeyViewColumns" Association="Self.ToForeignKeyViewColumn" >
          315  +      <End Role="ForeignKey" EntitySet="SViewForeignKeys"/>
          316  +      <End Role="Column" EntitySet="SViewColumns"/>
          317  +    </AssociationSet>
          318  +
          319  +    <AssociationSet Name="FunctionFunctionParameters" Association="Self.FunctionFunctionParameter">
          320  +      <End Role="Function" EntitySet="SFunctions"/>
          321  +      <End Role="Parameter" EntitySet="SFunctionParameters"/>
          322  +    </AssociationSet>
          323  +    <AssociationSet Name="ProcedureProcedureParameters" Association="Self.ProcedureProcedureParameter" >
          324  +      <End Role="Procedure" EntitySet="SProcedures"/>
          325  +      <End Role="Parameter" EntitySet="SProcedureParameters"/>
          326  +    </AssociationSet>
          327  +
          328  +  </EntityContainer>
          329  +
          330  +  <EntityType Name="Table">
          331  +    <Key>
          332  +      <PropertyRef Name="Id" />
          333  +    </Key>
          334  +    <Property Name="Id" Nullable="false" Type="nvarchar" />
          335  +    <Property Name="CatalogName" Type="nvarchar" />
          336  +    <Property Name="SchemaName" Type="nvarchar" />
          337  +    <Property Name="Name" Nullable="false" Type="nvarchar" />
          338  +  </EntityType>
          339  +
          340  +  <EntityType Name="TableColumn" >
          341  +    <Key>
          342  +      <PropertyRef Name="Id" />
          343  +    </Key>
          344  +    <Property Name="Id" Nullable="false" Type="nvarchar"/>
          345  +    <Property Name="ParentId" Nullable="false" Type="nvarchar"/>
          346  +    <Property Name="Name" Nullable="false" Type="nvarchar"/>
          347  +    <Property Name="Ordinal" Nullable="false" Type="int" />
          348  +    <Property Name="IsNullable" Nullable="false" Type="bit" />
          349  +    <Property Name="TypeName" Nullable="false" Type="nvarchar" />
          350  +    <Property Name="MaxLength" Type="int" />
          351  +    <Property Name="Precision" Type="int" />
          352  +    <Property Name="DateTimePrecision" Type="int" />
          353  +    <Property Name="Scale" Type="int" />
          354  +    <Property Name="CollationCatalog" Type="nvarchar" />
          355  +    <Property Name="CollationSchema" Type="nvarchar" />
          356  +    <Property Name="CollationName" Type="nvarchar" />
          357  +    <Property Name="CharacterSetCatalog" Type="nvarchar" />
          358  +    <Property Name="CharacterSetSchema" Type="nvarchar" />
          359  +    <Property Name="CharacterSetName" Type="nvarchar" />
          360  +    <Property Name="IsMultiSet" Nullable="false" Type="bit" />
          361  +    <Property Name="IsIdentity" Nullable="false" Type="bit" />
          362  +    <Property Name="IsStoreGenerated" Nullable="false" Type="bit" />
          363  +    <Property Name="Default" Nullable="true" Type="nvarchar"/>
          364  +  </EntityType>
          365  +
          366  +  <EntityType Name="View">
          367  +    <Key>
          368  +      <PropertyRef Name="Id" />
          369  +    </Key>
          370  +    <Property Name="Id" Nullable="false" Type="nvarchar" />
          371  +    <Property Name="CatalogName" Type="nvarchar" />
          372  +    <Property Name="SchemaName" Type="nvarchar" />
          373  +    <Property Name="Name" Nullable="false" Type="nvarchar" />
          374  +    <Property Name="ViewDefinition" Nullable="true" Type="nvarchar" />
          375  +    <Property Name="IsUpdatable" Nullable="false" Type="bit" />
          376  +  </EntityType>
          377  +
          378  +  <EntityType Name="ViewColumn">
          379  +    <Key>
          380  +      <PropertyRef Name="Id" />
          381  +    </Key>
          382  +    <Property Name="Id" Nullable="false" Type="nvarchar"/>
          383  +    <Property Name="ParentId" Nullable="false" Type="nvarchar"/>
          384  +    <Property Name="Name" Nullable="false" Type="nvarchar"/>
          385  +    <Property Name="Ordinal" Nullable="false" Type="int" />
          386  +    <Property Name="IsNullable" Nullable="false" Type="bit" />
          387  +    <Property Name="TypeName" Nullable="false" Type="nvarchar" />
          388  +    <Property Name="MaxLength" Type="int" />
          389  +    <Property Name="Precision" Type="int" />
          390  +    <Property Name="DateTimePrecision" Type="int" />
          391  +    <Property Name="Scale" Type="int" />
          392  +    <Property Name="CollationCatalog" Type="nvarchar" />
          393  +    <Property Name="CollationSchema" Type="nvarchar" />
          394  +    <Property Name="CollationName" Type="nvarchar" />
          395  +    <Property Name="CharacterSetCatalog" Type="nvarchar" />
          396  +    <Property Name="CharacterSetSchema" Type="nvarchar" />
          397  +    <Property Name="CharacterSetName" Type="nvarchar" />
          398  +    <Property Name="IsMultiSet" Nullable="false" Type="bit" />
          399  +    <Property Name="IsIdentity" Nullable="false" Type="bit" />
          400  +    <Property Name="IsStoreGenerated" Nullable="false" Type="bit" />
          401  +    <Property Name="Default" Nullable="true" Type="nvarchar"/>
          402  +  </EntityType>
          403  +
          404  +  <EntityType Name="Function">
          405  +    <Key>
          406  +      <PropertyRef Name="Id" />
          407  +    </Key>
          408  +    <Property Name="Id" Nullable="false" Type="nvarchar"/>
          409  +    <Property Name="CatalogName" Type="nvarchar"/>
          410  +    <Property Name="SchemaName" Type="nvarchar"/>
          411  +    <Property Name="Name" Nullable="false" Type="nvarchar"/>
          412  +    <Property Name="ReturnTypeName" Type="nvarchar" />
          413  +    <Property Name="ReturnMaxLength" Type="int" />
          414  +    <Property Name="ReturnPrecision" Type="int" />
          415  +    <Property Name="ReturnDateTimePrecision" Type="int" />
          416  +    <Property Name="ReturnScale" Type="int" />
          417  +    <Property Name="ReturnCollationCatalog" Type="nvarchar" />
          418  +    <Property Name="ReturnCollationSchema" Type="nvarchar" />
          419  +    <Property Name="ReturnCollationName" Type="nvarchar" />
          420  +    <Property Name="ReturnCharacterSetCatalog" Type="nvarchar" />
          421  +    <Property Name="ReturnCharacterSetSchema" Type="nvarchar" />
          422  +    <Property Name="ReturnCharacterSetName" Type="nvarchar" />
          423  +    <Property Name="ReturnIsMultiSet" Nullable="false" Type="bit" />
          424  +    <Property Name="IsAggregate" Type="bit" />
          425  +    <Property Name="IsBuiltIn" Type="bit" />
          426  +    <Property Name="IsNiladic" Type="bit" />
          427  +  </EntityType>
          428  +
          429  +  <EntityType Name="Procedure">
          430  +    <Key>
          431  +      <PropertyRef Name="Id" />
          432  +    </Key>
          433  +    <Property Name="Id" Nullable="false" Type="nvarchar"/>
          434  +    <Property Name="CatalogName" Type="nvarchar"/>
          435  +    <Property Name="SchemaName" Type="nvarchar"/>
          436  +    <Property Name="Name" Nullable="false" Type="nvarchar"/>
          437  +  </EntityType>
          438  +
          439  +  <EntityType Name="Parameter">
          440  +    <Key>
          441  +      <PropertyRef Name="Id" />
          442  +    </Key>
          443  +    <Property Name="Id" Nullable="false" Type="nvarchar"/>
          444  +    <Property Name="ParentId" Nullable="false" Type="nvarchar"/>
          445  +    <Property Name="Name" Nullable="false" Type="nvarchar" />
          446  +    <Property Name="Ordinal" Nullable="false" Type="int"/>
          447  +    <Property Name="TypeName" Nullable="false" Type="nvarchar" />
          448  +    <Property Name="MaxLength" Nullable="true" Type="int" />
          449  +    <Property Name="Precision" Nullable="true" Type="int" />
          450  +    <Property Name="DateTimePrecision" Type="int" />
          451  +    <Property Name="Scale" Nullable="true" Type="int" />
          452  +    <Property Name="CollationCatalog" Type="nvarchar" />
          453  +    <Property Name="CollationSchema" Type="nvarchar" />
          454  +    <Property Name="CollationName" Type="nvarchar" />
          455  +    <Property Name="CharacterSetCatalog" Type="nvarchar" />
          456  +    <Property Name="CharacterSetSchema" Type="nvarchar" />
          457  +    <Property Name="CharacterSetName" Type="nvarchar" />
          458  +    <Property Name="IsMultiSet" Nullable="false" Type="bit" />
          459  +    <Property Name="Mode" Type="nvarchar" />
          460  +    <Property Name="Default" Type="nvarchar" />
          461  +  </EntityType>
          462  +
          463  +  <EntityType Name="Constraint">
          464  +    <Key>
          465  +      <PropertyRef Name="Id" />
          466  +    </Key>
          467  +    <Property Name="Id" Nullable="false" Type="nvarchar" />
          468  +    <Property Name="ParentId" Nullable="false" Type="nvarchar" />
          469  +    <Property Name="Name" Nullable="false" Type="nvarchar" />
          470  +    <Property Name="IsDeferrable" Nullable="false" Type="bit" />
          471  +    <Property Name="IsInitiallyDeferred" Nullable="false" Type="bit" />
          472  +    <Property Name="ConstraintType" Nullable="false" Type="nvarchar" />
          473  +  </EntityType>
          474  +
          475  +  <EntityType Name="CheckConstraint">
          476  +    <Key>
          477  +      <PropertyRef Name="Id" />
          478  +    </Key>
          479  +    <Property Name="Id" Nullable="false" Type="nvarchar" />
          480  +    <Property Name="Expression" Nullable="true" Type="nvarchar" />
          481  +  </EntityType>
          482  +  
          483  +  <EntityType Name="ConstraintColumn">
          484  +    <Key>
          485  +      <PropertyRef Name="ConstraintId" />
          486  +      <PropertyRef Name="ColumnId" />
          487  +    </Key>
          488  +    <Property Name="ConstraintId" Nullable="false" Type="nvarchar" />
          489  +    <Property Name="ColumnId" Nullable="false" Type="nvarchar" />
          490  +  </EntityType>
          491  +
          492  +  <EntityType Name="ForeignKeyConstraint">
          493  +    <Key>
          494  +      <PropertyRef Name="Id" />
          495  +    </Key>
          496  +    <Property Name="Id" Nullable="false" Type="nvarchar" />
          497  +    <Property Name="UpdateRule" Nullable="false" Type="nvarchar" />
          498  +    <Property Name="DeleteRule" Nullable="false" Type="nvarchar" />
          499  +  </EntityType>
          500  +
          501  +  <EntityType Name="ForeignKey">
          502  +    <Key>
          503  +      <PropertyRef Name="Id" />
          504  +    </Key>
          505  +    <Property Name="Id" Nullable="false" Type="nvarchar" />
          506  +    <Property Name="Ordinal" Nullable="false" Type="int" />
          507  +    <Property Name="ConstraintId" Nullable="false" Type="nvarchar" />
          508  +    <Property Name="FromColumnId" Nullable="false" Type="nvarchar" />
          509  +    <Property Name="ToColumnId" Nullable="false" Type="nvarchar" />
          510  +  </EntityType>
          511  +
          512  +  <EntityType Name="ViewConstraint">
          513  +    <Key>
          514  +      <PropertyRef Name="Id" />
          515  +    </Key>
          516  +    <Property Name="Id" Nullable="false" Type="nvarchar" />
          517  +    <Property Name="ParentId" Nullable="false" Type="nvarchar" />
          518  +    <Property Name="Name" Nullable="false" Type="nvarchar" />
          519  +    <Property Name="IsDeferrable" Nullable="false" Type="bit" />
          520  +    <Property Name="IsInitiallyDeferred" Nullable="false" Type="bit" />
          521  +    <Property Name="ConstraintType" Nullable="false" Type="nvarchar" />
          522  +    <Property Name="Expression" Nullable="true" Type="nvarchar" />
          523  +    <Property Name="UpdateRule" Nullable="true" Type="nvarchar" />
          524  +    <Property Name="DeleteRule" Nullable="true" Type="nvarchar" />
          525  +  </EntityType>
          526  +
          527  +  <Association Name="TableTableConstraint">
          528  +    <End Type="Self.Table" Role="Parent" Multiplicity="1" />
          529  +    <End Type="Self.Constraint" Role="Constraint" Multiplicity="*" />
          530  +    <ReferentialConstraint>
          531  +      <Principal Role="Parent">
          532  +        <PropertyRef Name="Id" />
          533  +      </Principal>
          534  +      <Dependent Role="Constraint">
          535  +        <PropertyRef Name="ParentId" />
          536  +      </Dependent>
          537  +    </ReferentialConstraint>
          538  +  </Association>
          539  +
          540  +  <Association Name="ConstraintConstraintColumn">
          541  +    <End Type="Self.Constraint" Role="Constraint" Multiplicity="1" />
          542  +    <End Type="Self.ConstraintColumn" Role="ConstraintColumn" Multiplicity="*" />
          543  +    <ReferentialConstraint>
          544  +      <Principal Role="Constraint">
          545  +        <PropertyRef Name="Id" />
          546  +      </Principal>
          547  +      <Dependent Role="ConstraintColumn">
          548  +        <PropertyRef Name="ConstraintId" />
          549  +      </Dependent>
          550  +    </ReferentialConstraint>
          551  +  </Association>
          552  +
          553  +  <Association Name="ConstraintForeignKey">
          554  +    <End Type="Self.ForeignKeyConstraint" Role="Constraint" Multiplicity="1" />
          555  +    <End Type="Self.ForeignKey" Role="ForeignKey" Multiplicity="*" />
          556  +    <ReferentialConstraint>
          557  +      <Principal Role="Constraint">
          558  +        <PropertyRef Name="Id" />
          559  +      </Principal>
          560  +      <Dependent Role="ForeignKey">
          561  +        <PropertyRef Name="ConstraintId" />
          562  +      </Dependent>
          563  +    </ReferentialConstraint>
          564  +  </Association>
          565  +
          566  +  <Association Name="FromForeignKeyColumn">
          567  +    <End Type="Self.TableColumn" Role="Column" Multiplicity="1" />
          568  +    <End Type="Self.ForeignKey" Role="ForeignKey" Multiplicity="*" />
          569  +    <ReferentialConstraint>
          570  +      <Principal Role="Column">
          571  +        <PropertyRef Name="Id" />
          572  +      </Principal>
          573  +      <Dependent Role="ForeignKey">
          574  +        <PropertyRef Name="FromColumnId" />
          575  +      </Dependent>
          576  +    </ReferentialConstraint>
          577  +  </Association>
          578  +
          579  +  <Association Name="ToForeignKeyColumn">
          580  +    <End Type="Self.TableColumn" Role="Column" Multiplicity="1" />
          581  +    <End Type="Self.ForeignKey" Role="ForeignKey" Multiplicity="*" />
          582  +    <ReferentialConstraint>
          583  +      <Principal Role="Column">
          584  +        <PropertyRef Name="Id" />
          585  +      </Principal>
          586  +      <Dependent Role="ForeignKey">
          587  +        <PropertyRef Name="ToColumnId" />
          588  +      </Dependent>
          589  +    </ReferentialConstraint>
          590  +  </Association>
          591  +
          592  +  <Association Name="TableTableColumn">
          593  +    <End Type="Self.Table" Role="Parent" Multiplicity="1" />
          594  +    <End Type="Self.TableColumn" Role="Column" Multiplicity="*" />
          595  +    <ReferentialConstraint>
          596  +      <Principal Role="Parent">
          597  +        <PropertyRef Name="Id" />
          598  +      </Principal>
          599  +      <Dependent Role="Column">
          600  +        <PropertyRef Name="ParentId" />
          601  +      </Dependent>
          602  +    </ReferentialConstraint>
          603  +  </Association>
          604  +
          605  +  <Association Name="ViewViewColumn">
          606  +    <End Type="Self.View" Role="Parent" Multiplicity="1" />
          607  +    <End Type="Self.ViewColumn" Role="Column" Multiplicity="*" />
          608  +    <ReferentialConstraint>
          609  +      <Principal Role="Parent">
          610  +        <PropertyRef Name="Id" />
          611  +      </Principal>
          612  +      <Dependent Role="Column">
          613  +        <PropertyRef Name="ParentId" />
          614  +      </Dependent>
          615  +    </ReferentialConstraint>
          616  +  </Association>
          617  +
          618  +  <Association Name="FunctionFunctionParameter">
          619  +    <End Type="Self.Function" Role="Function" Multiplicity="1" />
          620  +    <End Type="Self.Parameter" Role="Parameter" Multiplicity="*" />
          621  +    <ReferentialConstraint>
          622  +      <Principal Role="Function">
          623  +        <PropertyRef Name="Id" />
          624  +      </Principal>
          625  +      <Dependent Role="Parameter">
          626  +        <PropertyRef Name="ParentId" />
          627  +      </Dependent>
          628  +    </ReferentialConstraint>
          629  +  </Association>
          630  +
          631  +  <Association Name="ProcedureProcedureParameter">
          632  +    <End Type="Self.Procedure" Role="Procedure" Multiplicity="1" />
          633  +    <End Type="Self.Parameter" Role="Parameter" Multiplicity="*" />
          634  +    <ReferentialConstraint>
          635  +      <Principal Role="Procedure">
          636  +        <PropertyRef Name="Id" />
          637  +      </Principal>
          638  +      <Dependent Role="Parameter">
          639  +        <PropertyRef Name="ParentId" />
          640  +      </Dependent>
          641  +    </ReferentialConstraint>
          642  +  </Association>
          643  +
          644  +  <Association Name="ViewViewConstraint">
          645  +    <End Type="Self.View" Role="Parent" Multiplicity="1" />
          646  +    <End Type="Self.ViewConstraint" Role="Constraint" Multiplicity="*" />
          647  +    <ReferentialConstraint>
          648  +      <Principal Role="Parent">
          649  +        <PropertyRef Name="Id" />
          650  +      </Principal>
          651  +      <Dependent Role="Constraint">
          652  +        <PropertyRef Name="ParentId" />
          653  +      </Dependent>
          654  +    </ReferentialConstraint>
          655  +  </Association>
          656  +
          657  +  <Association Name="ViewConstraintConstraintColumn">
          658  +    <End Type="Self.ViewConstraint" Role="Constraint" Multiplicity="1" />
          659  +    <End Type="Self.ConstraintColumn" Role="ConstraintColumn" Multiplicity="*" />
          660  +    <ReferentialConstraint>
          661  +      <Principal Role="Constraint">
          662  +        <PropertyRef Name="Id" />
          663  +      </Principal>
          664  +      <Dependent Role="ConstraintColumn">
          665  +        <PropertyRef Name="ConstraintId" />
          666  +      </Dependent>
          667  +    </ReferentialConstraint>
          668  +  </Association>
          669  +
          670  +  <Association Name="ViewConstraintForeignKey">
          671  +    <End Type="Self.ViewConstraint" Role="Constraint" Multiplicity="1" />
          672  +    <End Type="Self.ForeignKey" Role="ForeignKey" Multiplicity="*" />
          673  +    <ReferentialConstraint>
          674  +      <Principal Role="Constraint">
          675  +        <PropertyRef Name="Id" />
          676  +      </Principal>
          677  +      <Dependent Role="ForeignKey">
          678  +        <PropertyRef Name="ConstraintId" />
          679  +      </Dependent>
          680  +    </ReferentialConstraint>
          681  +  </Association>
          682  +
          683  +  <Association Name="FromForeignKeyViewColumn">
          684  +    <End Type="Self.ViewColumn" Role="Column" Multiplicity="1" />
          685  +    <End Type="Self.ForeignKey" Role="ForeignKey" Multiplicity="*" />
          686  +    <ReferentialConstraint>
          687  +      <Principal Role="Column">
          688  +        <PropertyRef Name="Id" />
          689  +      </Principal>
          690  +      <Dependent Role="ForeignKey">
          691  +        <PropertyRef Name="FromColumnId" />
          692  +      </Dependent>
          693  +    </ReferentialConstraint>
          694  +  </Association>
          695  +
          696  +  <Association Name="ToForeignKeyViewColumn">
          697  +    <End Type="Self.ViewColumn" Role="Column" Multiplicity="1" />
          698  +    <End Type="Self.ForeignKey" Role="ForeignKey" Multiplicity="*" />
          699  +    <ReferentialConstraint>
          700  +      <Principal Role="Column">
          701  +        <PropertyRef Name="Id" />
          702  +      </Principal>
          703  +      <Dependent Role="ForeignKey">
          704  +        <PropertyRef Name="ToColumnId" />
          705  +      </Dependent>
          706  +    </ReferentialConstraint>
          707  +  </Association>
          708  +
          709  +</Schema>

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

            1  +<?xml version="1.0" encoding="utf-8"?>
            2  +<Mapping xmlns:cs="urn:schemas-microsoft-com:windows:storage:mapping:CS" Space="C-S" xmlns="urn:schemas-microsoft-com:windows:storage:mapping:CS">
            3  +  <cs:EntityContainerMapping StorageEntityContainer="Schema" CdmEntityContainer="SchemaInformation">
            4  +
            5  +    <cs:EntitySetMapping Name="Tables" StoreEntitySet="STables" TypeName="Store.Table">
            6  +      <cs:ScalarProperty Name="Id" ColumnName="Id" />
            7  +      <cs:ScalarProperty Name="CatalogName" ColumnName="CatalogName" />
            8  +      <cs:ScalarProperty Name="SchemaName" ColumnName="SchemaName" />
            9  +      <cs:ScalarProperty Name="Name" ColumnName="Name" />
           10  +    </cs:EntitySetMapping>
           11  +
           12  +    <cs:EntitySetMapping Name="TableColumns" StoreEntitySet="STableColumns" TypeName="Store.Column">
           13  +      <cs:ScalarProperty Name="Id" ColumnName="Id" />
           14  +      <cs:ScalarProperty Name="Name" ColumnName="Name" />
           15  +      <cs:ScalarProperty Name="Ordinal" ColumnName="Ordinal" />
           16  +      <cs:ScalarProperty Name="IsNullable" ColumnName="IsNullable" />
           17  +      <cs:ComplexProperty Name="ColumnType">
           18  +        <cs:ScalarProperty Name="TypeName" ColumnName="TypeName" />
           19  +        <cs:ScalarProperty Name="MaxLength" ColumnName="MaxLength" />
           20  +        <cs:ScalarProperty Name="DateTimePrecision" ColumnName="DateTimePrecision" />
           21  +        <cs:ScalarProperty Name="Precision" ColumnName="Precision" />
           22  +        <cs:ScalarProperty Name="Scale" ColumnName="Scale" />
           23  +        <cs:ComplexProperty Name="Collation">
           24  +          <cs:ScalarProperty Name="CatalogName" ColumnName="CollationCatalog" />
           25  +          <cs:ScalarProperty Name="SchemaName" ColumnName="CollationSchema" />
           26  +          <cs:ScalarProperty Name="Name" ColumnName="CollationName" />
           27  +        </cs:ComplexProperty>
           28  +        <cs:ComplexProperty Name="CharacterSet">
           29  +          <cs:ScalarProperty Name="CatalogName" ColumnName="CharacterSetCatalog" />
           30  +          <cs:ScalarProperty Name="SchemaName" ColumnName="CharacterSetSchema" />
           31  +          <cs:ScalarProperty Name="Name" ColumnName="CharacterSetName" />
           32  +        </cs:ComplexProperty>
           33  +        <cs:ScalarProperty Name="IsMultiSet" ColumnName="IsMultiSet" />
           34  +      </cs:ComplexProperty>
           35  +      <cs:ScalarProperty Name="IsIdentity" ColumnName="IsIdentity" />
           36  +      <cs:ScalarProperty Name="IsStoreGenerated" ColumnName="IsStoreGenerated" />
           37  +      <cs:ScalarProperty Name="Default" ColumnName="Default" />
           38  +    </cs:EntitySetMapping>
           39  +
           40  +    <cs:EntitySetMapping Name="Views" StoreEntitySet="SViews" TypeName="Store.View">
           41  +      <cs:ScalarProperty Name="Id" ColumnName="Id" />
           42  +      <cs:ScalarProperty Name="CatalogName" ColumnName="CatalogName" />
           43  +      <cs:ScalarProperty Name="SchemaName" ColumnName="SchemaName" />
           44  +      <cs:ScalarProperty Name="Name" ColumnName="Name" />
           45  +      <cs:ScalarProperty Name="ViewDefinition" ColumnName="ViewDefinition" />
           46  +      <cs:ScalarProperty Name="IsUpdatable" ColumnName="IsUpdatable" />
           47  +    </cs:EntitySetMapping>
           48  +
           49  +    <cs:EntitySetMapping Name="ViewColumns" StoreEntitySet="SViewColumns" TypeName="Store.Column">
           50  +      <cs:ScalarProperty Name="Id" ColumnName="Id" />
           51  +      <cs:ScalarProperty Name="Name" ColumnName="Name" />
           52  +      <cs:ScalarProperty Name="Ordinal" ColumnName="Ordinal" />
           53  +      <cs:ScalarProperty Name="IsNullable" ColumnName="IsNullable" />
           54  +      <cs:ComplexProperty Name="ColumnType">
           55  +        <cs:ScalarProperty Name="TypeName" ColumnName="TypeName" />
           56  +        <cs:ScalarProperty Name="MaxLength" ColumnName="MaxLength" />
           57  +        <cs:ScalarProperty Name="Precision" ColumnName="Precision" />
           58  +        <cs:ScalarProperty Name="DateTimePrecision" ColumnName="DateTimePrecision" />
           59  +        <cs:ScalarProperty Name="Scale" ColumnName="Scale" />
           60  +        <cs:ComplexProperty Name="Collation">
           61  +          <cs:ScalarProperty Name="CatalogName" ColumnName="CollationCatalog" />
           62  +          <cs:ScalarProperty Name="SchemaName" ColumnName="CollationSchema" />
           63  +          <cs:ScalarProperty Name="Name" ColumnName="CollationName" />
           64  +        </cs:ComplexProperty>
           65  +        <cs:ComplexProperty Name="CharacterSet">
           66  +          <cs:ScalarProperty Name="CatalogName" ColumnName="CharacterSetCatalog" />
           67  +          <cs:ScalarProperty Name="SchemaName" ColumnName="CharacterSetSchema" />
           68  +          <cs:ScalarProperty Name="Name" ColumnName="CharacterSetName" />
           69  +        </cs:ComplexProperty>
           70  +        <cs:ScalarProperty Name="IsMultiSet" ColumnName="IsMultiSet" />
           71  +      </cs:ComplexProperty>
           72  +      <cs:ScalarProperty Name="IsIdentity" ColumnName="IsIdentity" />
           73  +      <cs:ScalarProperty Name="IsStoreGenerated" ColumnName="IsStoreGenerated" />
           74  +      <cs:ScalarProperty Name="Default" ColumnName="Default" />
           75  +    </cs:EntitySetMapping>
           76  +
           77  +    <cs:EntitySetMapping Name="Functions" TypeName="Store.ScalarFunction" StoreEntitySet="SFunctions">
           78  +      <cs:ScalarProperty Name="Id" ColumnName="Id" />
           79  +      <cs:ScalarProperty Name="CatalogName" ColumnName="CatalogName" />
           80  +      <cs:ScalarProperty Name="SchemaName" ColumnName="SchemaName" />
           81  +      <cs:ScalarProperty Name="Name" ColumnName="Name" />
           82  +      <cs:ComplexProperty Name="ReturnType">
           83  +        <cs:ScalarProperty Name="TypeName" ColumnName="ReturnTypeName" />
           84  +        <cs:ScalarProperty Name="MaxLength" ColumnName="ReturnMaxLength" />
           85  +        <cs:ScalarProperty Name="Precision" ColumnName="ReturnPrecision" />
           86  +        <cs:ScalarProperty Name="DateTimePrecision" ColumnName="ReturnDateTimePrecision" />
           87  +        <cs:ScalarProperty Name="Scale" ColumnName="ReturnScale" />
           88  +        <cs:ComplexProperty Name="Collation">
           89  +          <cs:ScalarProperty Name="CatalogName" ColumnName="ReturnCollationCatalog" />
           90  +          <cs:ScalarProperty Name="SchemaName" ColumnName="ReturnCollationSchema" />
           91  +          <cs:ScalarProperty Name="Name" ColumnName="ReturnCollationName" />
           92  +        </cs:ComplexProperty>
           93  +        <cs:ComplexProperty Name="CharacterSet">
           94  +          <cs:ScalarProperty Name="CatalogName" ColumnName="ReturnCharacterSetCatalog" />
           95  +          <cs:ScalarProperty Name="SchemaName" ColumnName="ReturnCharacterSetSchema" />
           96  +          <cs:ScalarProperty Name="Name" ColumnName="ReturnCharacterSetName" />
           97  +        </cs:ComplexProperty>
           98  +        <cs:ScalarProperty Name="IsMultiSet" ColumnName="ReturnIsMultiSet" />
           99  +      </cs:ComplexProperty>
          100  +      <cs:ScalarProperty Name="IsAggregate" ColumnName="IsAggregate" />
          101  +      <cs:ScalarProperty Name="IsBuiltIn" ColumnName="IsBuiltIn" />
          102  +      <cs:ScalarProperty Name="IsNiladic" ColumnName="IsNiladic" />
          103  +    </cs:EntitySetMapping>
          104  +
          105  +    <cs:EntitySetMapping Name="FunctionParameters" TypeName="Store.Parameter" StoreEntitySet="SFunctionParameters">
          106  +      <cs:ScalarProperty Name="Id" ColumnName="Id" />
          107  +      <cs:ScalarProperty Name="Name" ColumnName="Name" />
          108  +      <cs:ScalarProperty Name="Ordinal" ColumnName="Ordinal" />
          109  +      <cs:ComplexProperty Name="ParameterType">
          110  +        <cs:ScalarProperty Name="TypeName" ColumnName="TypeName" />
          111  +        <cs:ScalarProperty Name="MaxLength" ColumnName="MaxLength" />
          112  +        <cs:ScalarProperty Name="DateTimePrecision" ColumnName="DateTimePrecision" />
          113  +        <cs:ScalarProperty Name="Precision" ColumnName="Precision" />
          114  +        <cs:ScalarProperty Name="Scale" ColumnName="Scale" />
          115  +        <cs:ComplexProperty Name="Collation">
          116  +          <cs:ScalarProperty Name="CatalogName" ColumnName="CollationCatalog" />
          117  +          <cs:ScalarProperty Name="SchemaName" ColumnName="CollationSchema" />
          118  +          <cs:ScalarProperty Name="Name" ColumnName="CollationName" />
          119  +        </cs:ComplexProperty>
          120  +        <cs:ComplexProperty Name="CharacterSet">
          121  +          <cs:ScalarProperty Name="CatalogName" ColumnName="CharacterSetCatalog" />
          122  +          <cs:ScalarProperty Name="SchemaName" ColumnName="CharacterSetSchema" />
          123  +          <cs:ScalarProperty Name="Name" ColumnName="CharacterSetName" />
          124  +        </cs:ComplexProperty>
          125  +        <cs:ScalarProperty Name="IsMultiSet" ColumnName="IsMultiSet" />
          126  +      </cs:ComplexProperty>
          127  +      <cs:ScalarProperty Name="Mode" ColumnName="Mode" />
          128  +      <cs:ScalarProperty Name="Default" ColumnName="Default" />
          129  +    </cs:EntitySetMapping>
          130  +
          131  +    <cs:EntitySetMapping Name="Procedures" TypeName="Store.Procedure" StoreEntitySet="SProcedures">
          132  +      <cs:ScalarProperty Name="Id" ColumnName="Id" />
          133  +      <cs:ScalarProperty Name="CatalogName" ColumnName="CatalogName" />
          134  +      <cs:ScalarProperty Name="SchemaName" ColumnName="SchemaName" />
          135  +      <cs:ScalarProperty Name="Name" ColumnName="Name" />
          136  +    </cs:EntitySetMapping>
          137  +
          138  +    <cs:EntitySetMapping Name="ProcedureParameters" TypeName="Store.Parameter" StoreEntitySet="SProcedureParameters">
          139  +      <cs:ScalarProperty Name="Id" ColumnName="Id" />
          140  +      <cs:ScalarProperty Name="Name" ColumnName="Name" />
          141  +      <cs:ScalarProperty Name="Ordinal" ColumnName="Ordinal" />
          142  +      <cs:ComplexProperty Name="ParameterType">
          143  +        <cs:ScalarProperty Name="TypeName" ColumnName="TypeName" />
          144  +        <cs:ScalarProperty Name="MaxLength" ColumnName="MaxLength" />
          145  +        <cs:ScalarProperty Name="DateTimePrecision" ColumnName="DateTimePrecision" />
          146  +        <cs:ScalarProperty Name="Precision" ColumnName="Precision" />
          147  +        <cs:ScalarProperty Name="Scale" ColumnName="Scale" />
          148  +        <cs:ComplexProperty Name="Collation">
          149  +          <cs:ScalarProperty Name="CatalogName" ColumnName="CollationCatalog" />
          150  +          <cs:ScalarProperty Name="SchemaName" ColumnName="CollationSchema" />
          151  +          <cs:ScalarProperty Name="Name" ColumnName="CollationName" />
          152  +        </cs:ComplexProperty>
          153  +        <cs:ComplexProperty Name="CharacterSet">
          154  +          <cs:ScalarProperty Name="CatalogName" ColumnName="CharacterSetCatalog" />
          155  +          <cs:ScalarProperty Name="SchemaName" ColumnName="CharacterSetSchema" />
          156  +          <cs:ScalarProperty Name="Name" ColumnName="CharacterSetName" />
          157  +        </cs:ComplexProperty>
          158  +        <cs:ScalarProperty Name="IsMultiSet" ColumnName="IsMultiSet" />
          159  +      </cs:ComplexProperty>
          160  +      <cs:ScalarProperty Name="Mode" ColumnName="Mode" />
          161  +      <cs:ScalarProperty Name="Default" ColumnName="Default" />
          162  +    </cs:EntitySetMapping>
          163  +
          164  +    <cs:EntitySetMapping Name="TableConstraints" >
          165  +      <cs:EntityTypeMapping TypeName="IsTypeOf(Store.Constraint)">
          166  +        <cs:MappingFragment StoreEntitySet="SConstraints">
          167  +          <cs:ScalarProperty Name="Id" ColumnName="Id" />
          168  +          <cs:ScalarProperty Name="Name" ColumnName="Name" />
          169  +          <cs:ScalarProperty Name="IsDeferrable" ColumnName="IsDeferrable" />
          170  +          <cs:ScalarProperty Name="IsInitiallyDeferred" ColumnName="IsInitiallyDeferred" />
          171  +        </cs:MappingFragment>
          172  +      </cs:EntityTypeMapping>
          173  +      <cs:EntityTypeMapping TypeName="Store.UniqueConstraint">
          174  +          <cs:MappingFragment StoreEntitySet="SConstraints">
          175  +          <cs:ScalarProperty Name="Id" ColumnName="Id" />
          176  +          <cs:Condition ColumnName="ConstraintType" Value="UNIQUE"/>
          177  +        </cs:MappingFragment>
          178  +      </cs:EntityTypeMapping>
          179  +      <cs:EntityTypeMapping TypeName="Store.CheckConstraint">
          180  +        <cs:MappingFragment StoreEntitySet="SConstraints">
          181  +          <cs:ScalarProperty Name="Id" ColumnName="Id" />
          182  +          <cs:Condition ColumnName="ConstraintType" Value="CHECK"/>
          183  +        </cs:MappingFragment>
          184  +        <cs:MappingFragment StoreEntitySet="SCheckConstraints">
          185  +          <cs:ScalarProperty Name="Id" ColumnName="Id" />
          186  +          <cs:ScalarProperty Name="Expression" ColumnName="Expression" />
          187  +        </cs:MappingFragment>
          188  +      </cs:EntityTypeMapping>
          189  +      <cs:EntityTypeMapping TypeName="Store.PrimaryKeyConstraint">
          190  +        <cs:MappingFragment StoreEntitySet="SConstraints">
          191  +          <cs:ScalarProperty Name="Id" ColumnName="Id" />
          192  +          <cs:Condition ColumnName="ConstraintType" Value="PRIMARY KEY"/>
          193  +        </cs:MappingFragment>
          194  +      </cs:EntityTypeMapping>
          195  +      <cs:EntityTypeMapping TypeName="Store.ForeignKeyConstraint">
          196  +        <cs:MappingFragment StoreEntitySet="SConstraints">
          197  +          <cs:ScalarProperty Name="Id" ColumnName="Id" />
          198  +          <cs:Condition ColumnName="ConstraintType" Value="FOREIGN KEY"/>
          199  +        </cs:MappingFragment>
          200  +        <cs:MappingFragment StoreEntitySet="SForeignKeyConstraints">
          201  +          <cs:ScalarProperty Name="Id" ColumnName="Id" />
          202  +          <cs:ScalarProperty Name="UpdateRule" ColumnName="UpdateRule" />
          203  +          <cs:ScalarProperty Name="DeleteRule" ColumnName="DeleteRule" />
          204  +        </cs:MappingFragment>
          205  +      </cs:EntityTypeMapping>
          206  +    </cs:EntitySetMapping>
          207  +
          208  +    <cs:EntitySetMapping Name="ViewConstraints" >
          209  +      <cs:EntityTypeMapping TypeName="Store.UniqueConstraint" >
          210  +        <cs:MappingFragment StoreEntitySet="SViewConstraints">
          211  +          <cs:ScalarProperty Name="Id" ColumnName="Id" />
          212  +          <cs:ScalarProperty Name="Name" ColumnName="Name" />
          213  +          <cs:ScalarProperty Name="IsDeferrable" ColumnName="IsDeferrable" />
          214  +          <cs:ScalarProperty Name="IsInitiallyDeferred" ColumnName="IsInitiallyDeferred" />
          215  +          <cs:Condition ColumnName="ConstraintType" Value="UNIQUE"/>
          216  +        </cs:MappingFragment>
          217  +      </cs:EntityTypeMapping>
          218  +      <cs:EntityTypeMapping TypeName="Store.CheckConstraint" >
          219  +        <cs:MappingFragment StoreEntitySet="SViewConstraints">
          220  +          <cs:ScalarProperty Name="Id" ColumnName="Id" />
          221  +          <cs:ScalarProperty Name="Name" ColumnName="Name" />
          222  +          <cs:ScalarProperty Name="IsDeferrable" ColumnName="IsDeferrable" />
          223  +          <cs:ScalarProperty Name="IsInitiallyDeferred" ColumnName="IsInitiallyDeferred" />
          224  +          <cs:ScalarProperty Name="Expression" ColumnName="Expression" />
          225  +          <cs:Condition ColumnName="ConstraintType" Value="CHECK"/>
          226  +        </cs:MappingFragment>
          227  +      </cs:EntityTypeMapping>
          228  +      <cs:EntityTypeMapping TypeName="Store.PrimaryKeyConstraint" >
          229  +        <cs:MappingFragment StoreEntitySet="SViewConstraints">
          230  +          <cs:ScalarProperty Name="Id" ColumnName="Id" />
          231  +          <cs:ScalarProperty Name="Name" ColumnName="Name" />
          232  +          <cs:ScalarProperty Name="IsDeferrable" ColumnName="IsDeferrable" />
          233  +          <cs:ScalarProperty Name="IsInitiallyDeferred" ColumnName="IsInitiallyDeferred" />
          234  +          <cs:Condition ColumnName="ConstraintType" Value="PRIMARY KEY"/>
          235  +        </cs:MappingFragment>
          236  +      </cs:EntityTypeMapping>
          237  +      <cs:EntityTypeMapping TypeName="Store.ForeignKeyConstraint" >
          238  +        <cs:MappingFragment StoreEntitySet="SViewConstraints">
          239  +          <cs:ScalarProperty Name="Id" ColumnName="Id" />
          240  +          <cs:ScalarProperty Name="Name" ColumnName="Name" />
          241  +          <cs:ScalarProperty Name="IsDeferrable" ColumnName="IsDeferrable" />
          242  +          <cs:ScalarProperty Name="IsInitiallyDeferred" ColumnName="IsInitiallyDeferred" />
          243  +          <cs:ScalarProperty Name="UpdateRule" ColumnName="UpdateRule" />
          244  +          <cs:ScalarProperty Name="DeleteRule" ColumnName="DeleteRule" />
          245  +          <cs:Condition ColumnName="ConstraintType" Value="FOREIGN KEY"/>
          246  +        </cs:MappingFragment>
          247  +      </cs:EntityTypeMapping>
          248  +    </cs:EntitySetMapping>
          249  +
          250  +    <cs:EntitySetMapping Name="TableForeignKeys" StoreEntitySet="SForeignKeys" TypeName="Store.ForeignKey">
          251  +      <cs:ScalarProperty Name="Id" ColumnName="Id" />
          252  +      <cs:ScalarProperty Name="Ordinal" ColumnName="Ordinal" />
          253  +    </cs:EntitySetMapping>
          254  +
          255  +    <cs:EntitySetMapping Name="ViewForeignKeys" StoreEntitySet="SViewForeignKeys" TypeName="Store.ForeignKey">
          256  +      <cs:ScalarProperty Name="Id" ColumnName="Id" />
          257  +      <cs:ScalarProperty Name="Ordinal" ColumnName="Ordinal" />
          258  +    </cs:EntitySetMapping>
          259  +    
          260  +    <cs:AssociationSetMapping Name="TableTableColumns" StoreEntitySet="STableColumns" TypeName="Store.TableOrViewColumn">
          261  +      <cs:EndProperty Name="Parent">
          262  +        <cs:ScalarProperty Name="Id" ColumnName="ParentId" />
          263  +      </cs:EndProperty>
          264  +      <cs:EndProperty Name="Column">
          265  +        <cs:ScalarProperty Name="Id" ColumnName="Id" />
          266  +      </cs:EndProperty>
          267  +    </cs:AssociationSetMapping>
          268  +
          269  +    <cs:AssociationSetMapping Name="ViewViewColumns" StoreEntitySet="SViewColumns" TypeName="Store.TableOrViewColumn">
          270  +      <cs:EndProperty Name="Parent">
          271  +        <cs:ScalarProperty Name="Id" ColumnName="ParentId" />
          272  +      </cs:EndProperty>
          273  +      <cs:EndProperty Name="Column">
          274  +        <cs:ScalarProperty Name="Id" ColumnName="Id" />
          275  +      </cs:EndProperty>
          276  +    </cs:AssociationSetMapping>
          277  +
          278  +    <cs:AssociationSetMapping Name="TableTableConstraints" StoreEntitySet="SConstraints" TypeName="Store.TableOrViewConstraint">
          279  +      <cs:EndProperty Name="Parent">
          280  +        <cs:ScalarProperty Name="Id" ColumnName="ParentId" />
          281  +      </cs:EndProperty>
          282  +      <cs:EndProperty Name="Constraint">
          283  +        <cs:ScalarProperty Name="Id" ColumnName="Id" />
          284  +      </cs:EndProperty>
          285  +    </cs:AssociationSetMapping>
          286  +
          287  +    <cs:AssociationSetMapping Name="TableConstraintColumns" StoreEntitySet="SConstraintColumns" TypeName="Store.TableOrViewConstraintColumn">
          288  +      <cs:EndProperty Name="Constraint">
          289  +        <cs:ScalarProperty Name="Id" ColumnName="ConstraintId" />
          290  +      </cs:EndProperty>
          291  +      <cs:EndProperty Name="Column">
          292  +        <cs:ScalarProperty Name="Id" ColumnName="ColumnId" />
          293  +      </cs:EndProperty>
          294  +    </cs:AssociationSetMapping>
          295  +
          296  +    <cs:AssociationSetMapping Name="TableConstraintForeignKeys" StoreEntitySet="SForeignKeys" TypeName="Store.ConstraintForeignKey">
          297  +      <cs:EndProperty Name="Constraint">
          298  +        <cs:ScalarProperty Name="Id" ColumnName="ConstraintId" />
          299  +      </cs:EndProperty>
          300  +      <cs:EndProperty Name="ForeignKey">
          301  +        <cs:ScalarProperty Name="Id" ColumnName="Id" />
          302  +      </cs:EndProperty>
          303  +    </cs:AssociationSetMapping>
          304  +
          305  +    <cs:AssociationSetMapping Name="ToTableForeignKeyColumns" StoreEntitySet="SForeignKeys" TypeName="Store.ToForeignKeyColumn">
          306  +      <cs:EndProperty Name="ForeignKey">
          307  +        <cs:ScalarProperty Name="Id" ColumnName="Id" />
          308  +      </cs:EndProperty>
          309  +      <cs:EndProperty Name="Column">
          310  +        <cs:ScalarProperty Name="Id" ColumnName="ToColumnId" />
          311  +      </cs:EndProperty>
          312  +    </cs:AssociationSetMapping>
          313  +
          314  +    <cs:AssociationSetMapping Name="FromTableForeignKeyColumns" StoreEntitySet="SForeignKeys" TypeName="Store.FromForeignKeyColumn">
          315  +      <cs:EndProperty Name="ForeignKey">
          316  +        <cs:ScalarProperty Name="Id" ColumnName="Id" />
          317  +      </cs:EndProperty>
          318  +      <cs:EndProperty Name="Column">
          319  +        <cs:ScalarProperty Name="Id" ColumnName="FromColumnId" />
          320  +      </cs:EndProperty>
          321  +    </cs:AssociationSetMapping>
          322  +
          323  +    <cs:AssociationSetMapping Name="ViewViewConstraints" StoreEntitySet="SViewConstraints" TypeName="Store.TableOrViewConstraint">
          324  +      <cs:EndProperty Name="Parent">
          325  +        <cs:ScalarProperty Name="Id" ColumnName="ParentId" />
          326  +      </cs:EndProperty>
          327  +      <cs:EndProperty Name="Constraint">
          328  +        <cs:ScalarProperty Name="Id" ColumnName="Id" />
          329  +      </cs:EndProperty>
          330  +    </cs:AssociationSetMapping>
          331  +
          332  +    <cs:AssociationSetMapping Name="ViewConstraintColumns" StoreEntitySet="SViewConstraintColumns" TypeName="Store.TableOrViewConstraintColumn">
          333  +      <cs:EndProperty Name="Constraint">
          334  +        <cs:ScalarProperty Name="Id" ColumnName="ConstraintId" />
          335  +      </cs:EndProperty>
          336  +      <cs:EndProperty Name="Column">
          337  +        <cs:ScalarProperty Name="Id" ColumnName="ColumnId" />
          338  +      </cs:EndProperty>
          339  +    </cs:AssociationSetMapping>
          340  +
          341  +    <cs:AssociationSetMapping Name="ViewConstraintForeignKeys" StoreEntitySet="SViewForeignKeys" TypeName="Store.ConstraintForeignKey">
          342  +      <cs:EndProperty Name="Constraint">
          343  +        <cs:ScalarProperty Name="Id" ColumnName="ConstraintId" />
          344  +      </cs:EndProperty>
          345  +      <cs:EndProperty Name="ForeignKey">
          346  +        <cs:ScalarProperty Name="Id" ColumnName="Id" />
          347  +      </cs:EndProperty>
          348  +    </cs:AssociationSetMapping>
          349  +
          350  +    <cs:AssociationSetMapping Name="ToViewForeignKeyColumns" StoreEntitySet="SViewForeignKeys" TypeName="Store.ToForeignKeyColumn">
          351  +      <cs:EndProperty Name="ForeignKey">
          352  +        <cs:ScalarProperty Name="Id" ColumnName="Id" />
          353  +      </cs:EndProperty>
          354  +      <cs:EndProperty Name="Column">
          355  +        <cs:ScalarProperty Name="Id" ColumnName="ToColumnId" />
          356  +      </cs:EndProperty>
          357  +    </cs:AssociationSetMapping>
          358  +
          359  +    <cs:AssociationSetMapping Name="FromViewForeignKeyColumns" StoreEntitySet="SViewForeignKeys" TypeName="Store.FromForeignKeyColumn">
          360  +      <cs:EndProperty Name="ForeignKey">
          361  +        <cs:ScalarProperty Name="Id" ColumnName="Id" />
          362  +      </cs:EndProperty>
          363  +      <cs:EndProperty Name="Column">
          364  +        <cs:ScalarProperty Name="Id" ColumnName="FromColumnId" />
          365  +      </cs:EndProperty>
          366  +    </cs:AssociationSetMapping>
          367  +
          368  +    <cs:AssociationSetMapping Name="FunctionFunctionParameters" StoreEntitySet="SFunctionParameters" TypeName="Store.RoutineParameter">
          369  +      <cs:EndProperty Name="Routine">
          370  +        <cs:ScalarProperty Name="Id" ColumnName="ParentId" />
          371  +      </cs:EndProperty>
          372  +      <cs:EndProperty Name="Parameter">
          373  +        <cs:ScalarProperty Name="Id" ColumnName="Id" />
          374  +      </cs:EndProperty>
          375  +    </cs:AssociationSetMapping>
          376  +
          377  +    <cs:AssociationSetMapping Name="ProcedureProcedureParameters" StoreEntitySet="SProcedureParameters" TypeName="Store.RoutineParameter">
          378  +      <cs:EndProperty Name="Routine">
          379  +        <cs:ScalarProperty Name="Id" ColumnName="ParentId" />
          380  +      </cs:EndProperty>
          381  +      <cs:EndProperty Name="Parameter">
          382  +        <cs:ScalarProperty Name="Id" ColumnName="Id" />
          383  +      </cs:EndProperty>
          384  +    </cs:AssociationSetMapping>
          385  +
          386  +  </cs:EntityContainerMapping>
          387  +
          388  +</Mapping>

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

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

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

            1  +<?xml version="1.0"?>
            2  +<!-- XSD for CS( CDM <-> Storage ) space mapping. -->
            3  +<xs:schema xmlns:tns="urn:schemas-microsoft-com:windows:storage:mapping:CS" 
            4  +           attributeFormDefault="unqualified" 
            5  +           elementFormDefault="qualified" 
            6  +           targetNamespace="urn:schemas-microsoft-com:windows:storage:mapping:CS" 
            7  +           xmlns:csmsl="urn:schemas-microsoft-com:windows:storage:mapping:CS" 
            8  +           xmlns:xs="http://www.w3.org/2001/XMLSchema">
            9  +
           10  +  <xs:annotation>
           11  +    <xs:documentation xml:lang="en">
           12  +      Common Data Model Schema Definition Language.
           13  +      Copyright (c) Microsoft Corp. All rights reserved.
           14  +    </xs:documentation>
           15  +  </xs:annotation>
           16  +  
           17  +  <!-- Root Level element for CS Mapping -->
           18  +  <xs:element name="Mapping" type="csmsl:TMapping"/>
           19  +
           20  +  <!-- Type of Root level mapping elements-->
           21  +  <xs:complexType name="TMapping">
           22  +    <!-- Top level Mapping element can have Alias elements followed by 
           23  +         EntityContainer Mapping element-->
           24  +    <xs:sequence>
           25  +      <xs:element minOccurs="0" maxOccurs="unbounded" name="Alias" type="csmsl:TAlias"/>
           26  +      <!-- For now we will allow only one EntityContainerMapping to be mapped per MSL File.-->
           27  +      <xs:element name="EntityContainerMapping" type="csmsl:TEntityContainerMapping"/>
           28  +    </xs:sequence>
           29  +    <!-- Space represents the space that the mapping occurs. For CS Mapping
           30  +         it always has to be "C-S"-->
           31  +    <xs:attribute name="Space" type="csmsl:TSpace" use="required" fixed="C-S" />
           32  +  </xs:complexType>
           33  +
           34  +  <!-- Type for QueryView Element -->
           35  +  <xs:complexType name="TQueryView">
           36  +    <xs:simpleContent>
           37  +      <xs:extension base="xs:string">
           38  +        <xs:attribute name="TypeName" type="xs:string" use="optional" />
           39  +      </xs:extension>
           40  +    </xs:simpleContent>
           41  +  </xs:complexType>
           42  +
           43  +
           44  +
           45  +
           46  +  <!-- Type for Alias Element-->
           47  +  <xs:complexType name="TAlias">
           48  +    <xs:attribute name="Key" type="csmsl:TSimpleIdentifier" use="required" />
           49  +    <xs:attribute name="Value" type="xs:string" use="required" />
           50  +  </xs:complexType>
           51  +
           52  +  <!-- Type for EntityContainerMapping Element-->
           53  +  <xs:complexType name="TEntityContainerMapping">
           54  +    <xs:sequence>
           55  +      <xs:choice maxOccurs="unbounded">
           56  +        <xs:element minOccurs="0" name="EntitySetMapping" type="csmsl:TEntitySetMapping"/>
           57  +        <xs:element minOccurs="0" name="AssociationSetMapping" type="csmsl:TAssociationSetMapping"/>
           58  +        <xs:element minOccurs="0" name="FunctionImportMapping" type="csmsl:TFunctionImportMapping"/>
           59  +      </xs:choice>
           60  +    </xs:sequence>
           61  +    <xs:attribute name="CdmEntityContainer" type="csmsl:TSimpleIdentifier" use="required" />
           62  +    <xs:attribute name="StorageEntityContainer" type="xs:string" use="required" />
           63  +  </xs:complexType>
           64  +
           65  +  <!-- Type for FunctionImport Mapping element -->
           66  +  <xs:complexType name="TFunctionImportMapping">
           67  +    <xs:sequence>
           68  +      <xs:element minOccurs="0" maxOccurs="1" name="ResultMapping" type="csmsl:TFunctionImportMappingResultMapping"/>
           69  +    </xs:sequence>
           70  +    <xs:attribute name="FunctionName" type="xs:string" use="required"/>
           71  +    <xs:attribute name="FunctionImportName" type="csmsl:TSimpleIdentifier" use="required"/>
           72  +  </xs:complexType>
           73  +  
           74  +  <!-- Type for FunctionImport/ResultMapping element -->
           75  +  <xs:complexType name="TFunctionImportMappingResultMapping">
           76  +    <xs:sequence>
           77  +      <xs:element minOccurs="0" maxOccurs="unbounded" name="EntityTypeMapping" type="csmsl:TFunctionImportEntityTypeMapping"/>
           78  +    </xs:sequence>    
           79  +  </xs:complexType>
           80  +
           81  +  <!-- Type for EntitySet Mapping element-->
           82  +  <xs:complexType name="TEntitySetMapping">
           83  +    <xs:choice>
           84  +      <xs:choice>
           85  +        <xs:sequence>
           86  +          <xs:element name="QueryView" type="csmsl:TQueryView" minOccurs="0" maxOccurs="unbounded"/>
           87  +    
           88  +          <xs:element name="EntityTypeMapping" type="csmsl:TEntityTypeMapping" minOccurs="0" maxOccurs="unbounded"/>
           89  +        </xs:sequence>
           90  +        <xs:sequence>
           91  +          <xs:element name="MappingFragment" type="csmsl:TMappingFragment" minOccurs="0" maxOccurs="unbounded"/>
           92  +        </xs:sequence>
           93  +      </xs:choice>
           94  +      <xs:group ref="csmsl:TPropertyGroup"/>
           95  +    </xs:choice>
           96  +    <xs:attribute name="Name" type="csmsl:TSimpleIdentifier" use="required" />
           97  +    <xs:attribute name="TypeName" type="xs:string" use="optional" />
           98  +    <xs:attribute name="StoreEntitySet" type="xs:string" use="optional" />
           99  +  </xs:complexType>
          100  +
          101  +  <!-- Type for AssociationSetMapping element-->
          102  +  <xs:complexType name="TAssociationSetMapping">
          103  +    <xs:sequence>
          104  +      <xs:element name="QueryView" type="xs:string" minOccurs="0" maxOccurs="1"/>          
          105  +      <xs:element name="EndProperty" type="csmsl:TEndProperty" minOccurs="0" maxOccurs="2"/>
          106  +      <xs:element name="Condition" type="csmsl:TCondition" minOccurs="0" maxOccurs="unbounded"/>
          107  +      <xs:element name="ModificationFunctionMapping" type="csmsl:TAssociationSetModificationFunctionMapping" minOccurs="0" maxOccurs="1"/>
          108  +    </xs:sequence>
          109  +    <xs:attribute name="Name" type="csmsl:TSimpleIdentifier" use="required" />
          110  +    <xs:attribute name="TypeName" type="csmsl:TQualifiedName" use="optional" />
          111  +    <xs:attribute name="StoreEntitySet" type="xs:string" use="optional" />
          112  +  </xs:complexType>
          113  +
          114  +  <!-- Type for EntityTypeMapping element-->
          115  +  <xs:complexType name="TEntityTypeMapping">
          116  +    <xs:sequence>
          117  +      <xs:element minOccurs="0" maxOccurs="unbounded" name="MappingFragment" type="csmsl:TMappingFragment"/>
          118  +      <xs:element minOccurs="0" maxOccurs="1" name="ModificationFunctionMapping" type="csmsl:TEntityTypeModificationFunctionMapping"/>
          119  +    </xs:sequence>
          120  +    <xs:attribute name="TypeName" type="xs:string" use="required" />
          121  +  </xs:complexType>
          122  +  
          123  +  <!-- Type for FunctionImport EntityTypeMapping element-->
          124  +  <xs:complexType name="TFunctionImportEntityTypeMapping">
          125  +    <xs:sequence>
          126  +      <xs:element minOccurs="0" maxOccurs="unbounded" name="Condition" type="csmsl:TFunctionImportCondition"/>
          127  +    </xs:sequence>
          128  +    <xs:attribute name="TypeName" type="xs:string" use="required" />
          129  +  </xs:complexType>
          130  +
          131  +  <!-- Type for MappingFragment Element-->
          132  +  <xs:complexType name="TMappingFragment">
          133  +    <xs:group ref="csmsl:TPropertyGroup" minOccurs="1" maxOccurs="1"/>
          134  +    <xs:attribute name="StoreEntitySet" type="xs:string" use="required" />
          135  +  </xs:complexType>
          136  +
          137  +  <!-- Type for EntityTypeMapping/ModificationFunctionMapping element -->
          138  +  <xs:complexType name="TEntityTypeModificationFunctionMapping">
          139  +    <xs:all>
          140  +      <xs:element minOccurs="1" maxOccurs="1" name="DeleteFunction" type="csmsl:TEntityTypeModificationFunction"/>
          141  +      <xs:element minOccurs="1" maxOccurs="1" name="InsertFunction" type="csmsl:TEntityTypeModificationFunctionWithResult"/>
          142  +      <xs:element minOccurs="1" maxOccurs="1" name="UpdateFunction" type="csmsl:TEntityTypeModificationFunctionWithResult"/>
          143  +    </xs:all>
          144  +  </xs:complexType>
          145  +  
          146  +  <!-- Type for AssociationSetMapping/ModificationFunctionMapping element -->
          147  +  <xs:complexType name="TAssociationSetModificationFunctionMapping">
          148  +    <xs:all>
          149  +      <xs:element minOccurs="1" maxOccurs="1" name="DeleteFunction" type="csmsl:TAssociationSetModificationFunction"/>
          150  +      <xs:element minOccurs="1" maxOccurs="1" name="InsertFunction" type="csmsl:TAssociationSetModificationFunction"/>
          151  +    </xs:all>
          152  +  </xs:complexType>
          153  +
          154  +  <!-- Type for entity type DeleteFunction -->
          155  +  <xs:complexType name="TEntityTypeModificationFunction">
          156  +    <xs:group ref="csmsl:TEntityTypeFunctionMappingPropertyGroup" minOccurs="1" maxOccurs="1"/>
          157  +    <xs:attribute name="FunctionName" type="xs:string" use="required"/>
          158  +    <xs:attribute name="RowsAffectedParameter" type="xs:string" use="optional"/>
          159  +  </xs:complexType>
          160  +
          161  +  <!-- Extensions to modification function for entity type InsertFunction and UpdateFunction -->
          162  +  <xs:complexType name="TEntityTypeModificationFunctionWithResult">
          163  +    <xs:complexContent>
          164  +      <xs:extension base="csmsl:TEntityTypeModificationFunction">
          165  +        <xs:group ref="csmsl:TResultBindingGroup" minOccurs="1" maxOccurs="1"/>
          166  +      </xs:extension>
          167  +    </xs:complexContent>
          168  +  </xs:complexType>
          169  +
          170  +  <!-- Type for association set DeleteFunction and InsertFunction -->
          171  +  <xs:complexType name="TAssociationSetModificationFunction">
          172  +    <xs:group ref="csmsl:TAssociationSetFunctionMappingPropertyGroup" minOccurs="1" maxOccurs="1"/>
          173  +    <xs:attribute name="FunctionName" type="xs:string" use="required"/>
          174  +    <xs:attribute name="RowsAffectedParameter" type="xs:string" use="optional"/>
          175  +  </xs:complexType>
          176  +
          177  +  <!-- Grouping for entity type function mappings -->
          178  +  <xs:group name="TEntityTypeFunctionMappingPropertyGroup">
          179  +    <xs:sequence>
          180  +      <xs:choice maxOccurs="unbounded">
          181  +        <xs:element minOccurs="0" name="ScalarProperty" type="csmsl:TFunctionMappingScalarProperty"/>
          182  +        <xs:element minOccurs="0" name="AssociationEnd" type="csmsl:TFunctionMappingAssociationEnd"/>
          183  +        <xs:element minOccurs="0" name="ComplexProperty" type="csmsl:TFunctionMappingComplexProperty"/>
          184  +      </xs:choice>
          185  +    </xs:sequence>
          186  +  </xs:group>
          187  +
          188  +  <!-- Grouping for entity type function mappings -->
          189  +  <xs:group name="TAssociationSetFunctionMappingPropertyGroup">
          190  +    <xs:sequence>
          191  +      <xs:choice maxOccurs="unbounded">
          192  +        <xs:element minOccurs="1" name="EndProperty" type="csmsl:TFunctionMappingEndProperty"/>
          193  +      </xs:choice>
          194  +    </xs:sequence>
          195  +  </xs:group>
          196  +
          197  +  <!-- Type for function mapping end property -->
          198  +  <xs:complexType name="TFunctionMappingEndProperty">
          199  +    <xs:group ref="csmsl:TFunctionMappingAssociationEndPropertyGroup" minOccurs="1" maxOccurs="1"/>
          200  +    <xs:attribute name="Name" type="csmsl:TSimpleIdentifier" use="required"/>
          201  +  </xs:complexType>
          202  +
          203  +  <!-- Type for function mapping scalar property -->
          204  +  <xs:complexType name="TFunctionMappingScalarProperty">
          205  +    <xs:attribute name="ParameterName" type="xs:string" use="required"/>
          206  +    <xs:attribute name="Name" type="csmsl:TSimpleIdentifier" use="required"/>
          207  +    <xs:attribute name="Version" type="csmsl:TVersion" use="optional"/>
          208  +  </xs:complexType>
          209  +
          210  +  <!-- Type for function mapping result binding -->
          211  +  <xs:complexType name="TResultBinding">
          212  +    <xs:attribute name="ColumnName" type="xs:string" use="required"/>
          213  +    <xs:attribute name="Name" type="csmsl:TSimpleIdentifier" use="required"/>
          214  +  </xs:complexType>
          215  +
          216  +  <!-- Type for function mapping association end -->
          217  +  <xs:complexType name="TFunctionMappingAssociationEnd">
          218  +    <xs:group ref="csmsl:TFunctionMappingAssociationEndPropertyGroup" minOccurs="1" maxOccurs="1"/>
          219  +    <xs:attribute name="AssociationSet" type="csmsl:TSimpleIdentifier" use="required"/>
          220  +    <xs:attribute name="From" type="csmsl:TSimpleIdentifier" use="required"/>
          221  +    <xs:attribute name="To" type="csmsl:TSimpleIdentifier" use="required"/>
          222  +  </xs:complexType>
          223  +
          224  +  <!-- Grouping for property bindings in function mapping end property -->
          225  +  <xs:group name="TFunctionMappingAssociationEndPropertyGroup">
          226  +    <xs:sequence>
          227  +      <xs:element minOccurs="0" maxOccurs="unbounded" name="ScalarProperty" type="csmsl:TFunctionMappingScalarProperty"/>
          228  +    </xs:sequence>
          229  +  </xs:group>
          230  +
          231  +  <!-- Type for function mapping complex property -->
          232  +  <xs:complexType name="TFunctionMappingComplexProperty">
          233  +    <xs:group ref="csmsl:TFunctionMappingComplexPropertyPropertyGroup" minOccurs="1" maxOccurs="1"/>
          234  +    <xs:attribute name="Name" type="csmsl:TSimpleIdentifier" use="required"/>
          235  +    <xs:attribute name="TypeName" type="xs:string" use="required"/>
          236  +  </xs:complexType>  
          237  +
          238  +  <!-- Grouping for result bindings in function mappings -->
          239  +  <xs:group name="TResultBindingGroup">
          240  +    <xs:sequence>
          241  +      <xs:element minOccurs="0" maxOccurs="unbounded" name="ResultBinding" type="csmsl:TResultBinding"/>
          242  +    </xs:sequence>
          243  +  </xs:group>
          244  +
          245  +  <!-- Grouping for property bindings in function mapping association end -->
          246  +  <xs:group name="TFunctionMappingComplexPropertyPropertyGroup">
          247  +    <xs:sequence>
          248  +      <xs:choice maxOccurs="unbounded">
          249  +        <xs:element minOccurs="0" name="ScalarProperty" type="csmsl:TFunctionMappingScalarProperty"/>
          250  +        <xs:element minOccurs="0" name="ComplexProperty" type="csmsl:TFunctionMappingComplexProperty"/>
          251  +      </xs:choice>
          252  +    </xs:sequence>
          253  +  </xs:group>
          254  +
          255  +  <!-- Grouping these elements so that they can be reused
          256  +       These elements represent the property group
          257  +       that can either directly reside unser EntitySet, EntityType
          258  +       or MappingFragment-->
          259  +  <xs:group name="TPropertyGroup">
          260  +    <xs:sequence>
          261  +      <xs:choice maxOccurs="unbounded">
          262  +        <xs:element minOccurs="0" name="ComplexProperty" type="csmsl:TComplexProperty"/>
          263  +        <xs:element minOccurs="0" name="ScalarProperty" type="csmsl:TScalarProperty"/>
          264  +        <xs:element minOccurs="0" name="Condition" type="csmsl:TCondition"/>
          265  +      </xs:choice>
          266  +    </xs:sequence>
          267  +  </xs:group>
          268  +
          269  +  <!-- Type for Condition Element-->
          270  +  <xs:complexType name="TCondition">
          271  +    <xs:attribute name="Value" type="xs:string" use="optional" />
          272  +    <xs:attribute name="Name" type="csmsl:TSimpleIdentifier" use="optional" />
          273  +    <xs:attribute name="ColumnName" type="xs:string" use="optional" />
          274  +    <xs:attribute name="IsNull" type="xs:boolean" use="optional" />
          275  +  </xs:complexType>
          276  +
          277  +  <!-- Type for FunctionImport Condition element-->
          278  +  <xs:complexType name="TFunctionImportCondition">
          279  +    <xs:attribute name="Value" type="xs:string" use="optional" />
          280  +    <xs:attribute name="ColumnName" type="xs:string" use="required" />
          281  +    <xs:attribute name="IsNull" type="xs:boolean" use="optional" />
          282  +  </xs:complexType>
          283  +
          284  +  <!-- Type for End Property Elements in Association Maps -->
          285  +  <xs:complexType name="TEndProperty">
          286  +    <xs:sequence>
          287  +      <xs:element maxOccurs="unbounded" name="ScalarProperty" type="csmsl:TScalarProperty"/>
          288  +    </xs:sequence>
          289  +    <xs:attribute name="Name" type="csmsl:TSimpleIdentifier" use="required" />
          290  +  </xs:complexType>
          291  +
          292  +  <!-- Type for Complex Property Map elements-->
          293  +  <xs:complexType name="TComplexProperty">
          294  +    <xs:sequence>
          295  +      <xs:choice maxOccurs="unbounded">
          296  +        <xs:element name="ScalarProperty" type="csmsl:TScalarProperty"/>
          297  +        <xs:element name="ComplexProperty" type="csmsl:TComplexProperty"/>
          298  +        <xs:element name="ComplexTypeMapping" type="csmsl:TComplexTypeMapping"/>
          299  +        <xs:element name="Condition" type="csmsl:TCondition"/>
          300  +      </xs:choice>
          301  +    </xs:sequence>
          302  +    <xs:attribute name="Name" type="csmsl:TSimpleIdentifier" use="required" />
          303  +    <xs:attribute name="TypeName" type="xs:string" use="optional" />
          304  +    <xs:attribute name="IsPartial" type="xs:boolean" use="optional" />
          305  +  </xs:complexType>
          306  +
          307  +  <!-- Type for Complex Type mapping element-->
          308  +  <xs:complexType name="TComplexTypeMapping">
          309  +    <xs:sequence>
          310  +      <xs:choice maxOccurs="unbounded">
          311  +        <xs:element name="ScalarProperty" type="csmsl:TScalarProperty"/>
          312  +        <xs:element name="ComplexProperty" type="csmsl:TComplexProperty"/>
          313  +        <xs:element name="Condition" type="csmsl:TCondition"/>
          314  +      </xs:choice>
          315  +    </xs:sequence>
          316  +    <xs:attribute name="TypeName" type="xs:string" use="optional" />
          317  +    <xs:attribute name="IsPartial" type="xs:boolean" use="optional" />
          318  +  </xs:complexType>
          319  +  
          320  +  <!-- Type for ScalarProperty Element-->
          321  +  <xs:complexType name="TScalarProperty">
          322  +    <xs:attribute name="Name" type="csmsl:TSimpleIdentifier" use="required" />
          323  +    <xs:attribute name="ColumnName" type="xs:string" use="required" />
          324  +  </xs:complexType>
          325  +
          326  +  <!--Definition for SimpleIdentifier
          327  +      This is the same definition that is being used in the CSDL XSD
          328  +      -->
          329  +  <xs:simpleType name="TSimpleIdentifier">
          330  +    <xs:restriction base="xs:token">
          331  +        <!-- The below pattern represents the allowed identifiers in ECMA specification -->
          332  +        <xs:pattern value="[\p{L}\p{Nl}][\p{L}\p{Nl}\p{Nd}\p{Mn}\p{Mc}\p{Pc}\p{Cf}]{0,}"/>
          333  +    </xs:restriction>
          334  +  </xs:simpleType>
          335  +
          336  +
          337  +  <!--Definition for QualifiedName. QualifiedName is SimpleIdentifiers with '.'
          338  +      allowed. This is the same definition that is being used in the CSDL XSD
          339  +      -->
          340  +  <xs:simpleType name="TQualifiedName">
          341  +    <xs:restriction base="xs:token">
          342  +        <!-- The below pattern represents the allowed identifiers in ECMA specification plus the '.' for namespace qualification  -->
          343  +         <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,}"/>
          344  +    </xs:restriction>
          345  +  </xs:simpleType>
          346  +
          347  +  <!--Definition for Version, which can 'original' or 'current' as its value-->
          348  +  <xs:simpleType name="TVersion">
          349  +    <xs:restriction base="xs:token">
          350  +      <xs:enumeration value="Original"/>
          351  +      <xs:enumeration value="Current"/>
          352  +    </xs:restriction>
          353  +  </xs:simpleType>
          354  +
          355  +  <!-- Type fopr Space or Type Attribute -->
          356  +  <xs:simpleType name="TSpace">
          357  +    <xs:restriction base="xs:token">
          358  +      <xs:enumeration value="C-S" />
          359  +    </xs:restriction>
          360  +  </xs:simpleType>
          361  +</xs:schema>

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

            1  +<?xml version="1.0" encoding="utf-8"?>
            2  +<xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified"
            3  +           xmlns:xs="http://www.w3.org/2001/XMLSchema"
            4  +           xmlns:source="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator"
            5  +           targetNamespace="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator">
            6  +    <xs:annotation>
            7  +        <xs:documentation xml:lang="en">
            8  +            Common Data Model Schema Definition Language.
            9  +            Copyright (c) Microsoft Corp. All rights reserved.
           10  +        </xs:documentation>
           11  +    </xs:annotation>
           12  +
           13  +
           14  +  <xs:attribute name="Type" type="source:TSourceType"/>
           15  +  <xs:attribute name="Schema" type="xs:string"/>
           16  +  <xs:attribute name="Name" type="xs:string"/>
           17  +
           18  +    <xs:simpleType name="TSourceType">
           19  +        <xs:restriction base="xs:string">
           20  +            <xs:enumeration value="Tables" />
           21  +            <xs:enumeration value="Views" />
           22  +        </xs:restriction>
           23  +    </xs:simpleType>
           24  +
           25  +</xs:schema>

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

            1  +<?xml version="1.0" encoding="utf-8"?>
            2  +<xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified"
            3  +           xmlns:xs="http://www.w3.org/2001/XMLSchema"
            4  +           xmlns:edm="http://schemas.microsoft.com/ado/2006/04/edm/ssdl"
            5  +           xmlns:gen="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" 
            6  +           targetNamespace="http://schemas.microsoft.com/ado/2006/04/edm/ssdl">
            7  +    <xs:annotation>
            8  +        <xs:documentation xml:lang="en">
            9  +            Common Data Model Schema Definition Language.
           10  +            Copyright (c) Microsoft Corp. All rights reserved.
           11  +        </xs:documentation>
           12  +    </xs:annotation>
           13  +  <xs:import namespace="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" schemaLocation="System.Data.Resources.EntityStoreSchemaGenerator.xsd" />
           14  +  <xs:element name="Schema" type="edm:TSchema"/>
           15  +    <xs:complexType name="TSchema">
           16  +        <xs:sequence>
           17  +            <xs:group ref="edm:GSchemaBodyElements" minOccurs="0" maxOccurs="unbounded"/>
           18  +            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
           19  +        </xs:sequence>
           20  +        <xs:attribute name="Namespace" type="edm:TQualifiedName" use="required" />
           21  +        <xs:attribute name="Alias" type="edm:TSimpleIdentifier" use="optional" />
           22  +        <xs:attribute name="Provider" type="edm:TSimpleIdentifier" use="required" />
           23  +        <xs:attribute name="ProviderManifestToken" type="edm:TSimpleIdentifier" use="required" />      
           24  +        <xs:anyAttribute namespace="##other" processContents="lax" />
           25  +    </xs:complexType>
           26  +
           27  +    <xs:group name="GSchemaBodyElements">
           28  +        <xs:choice>
           29  +            <xs:element name="Association" type="edm:TAssociation" minOccurs="0" maxOccurs="unbounded"/>
           30  +            <xs:element name="EntityType" type="edm:TEntityType" minOccurs="0" maxOccurs="unbounded"/>
           31  +            <xs:element ref="edm:EntityContainer" minOccurs="1" maxOccurs="1"/>
           32  +            <xs:element name="Function" type="edm:TFunction" minOccurs="0" maxOccurs="unbounded" />
           33  +        </xs:choice>
           34  +    </xs:group>
           35  +
           36  +    <xs:simpleType name="TMax">
           37  +        <xs:restriction base="xs:string">
           38  +            <xs:enumeration value="Max"/>
           39  +        </xs:restriction>
           40  +    </xs:simpleType>
           41  +
           42  +    <!-- Facets for Primitive types -->
           43  +    <xs:simpleType name="TMaxLengthFacet">
           44  +        <xs:union memberTypes="edm:TMax xs:nonNegativeInteger"/>
           45  +    </xs:simpleType>
           46  +
           47  +    <xs:simpleType name="TIsFixedLengthFacet">
           48  +        <xs:restriction base="xs:boolean"/>
           49  +    </xs:simpleType>
           50  +
           51  +    <xs:simpleType name="TKindFacet">
           52  +        <xs:restriction base="xs:string">
           53  +            <xs:enumeration value="Utc"/>
           54  +            <xs:enumeration value="Local"/>
           55  +            <xs:enumeration value="Unspecified"/>
           56  +        </xs:restriction>
           57  +    </xs:simpleType>
           58  +
           59  +    <xs:simpleType name="TPrecisionFacet">
           60  +        <xs:restriction base="xs:nonNegativeInteger"/>
           61  +    </xs:simpleType>
           62  +
           63  +    <xs:simpleType name="TScaleFacet">
           64  +        <xs:restriction base="xs:nonNegativeInteger"/>
           65  +    </xs:simpleType>
           66  +
           67  +    <xs:simpleType name="TIsUnicodeFacet">
           68  +        <xs:restriction base="xs:boolean"/>
           69  +    </xs:simpleType>
           70  +
           71  +    <xs:simpleType name="TCollationFacet">
           72  +        <xs:restriction base="xs:string"/>
           73  +    </xs:simpleType>
           74  +
           75  +    <!-- 
           76  +        types of the top level elements 
           77  +    -->
           78  +   <xs:complexType name="TDocumentation">
           79  +    <xs:annotation>
           80  +      <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.
           81  +      </xs:documentation>
           82  +    </xs:annotation>
           83  +    <xs:sequence>
           84  +      <xs:element name="Summary" type="edm:TText" minOccurs="0" maxOccurs="1" />
           85  +      <xs:element name="LongDescription" type="edm:TText" minOccurs="0" maxOccurs="1" />
           86  +    </xs:sequence>
           87  +    <xs:anyAttribute processContents="lax" namespace="##other" />
           88  +  </xs:complexType>
           89  +
           90  +  <xs:complexType name="TText" mixed="true">
           91  +    <xs:sequence>
           92  +      <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
           93  +    </xs:sequence>
           94  +    <xs:anyAttribute processContents="lax" namespace="##other" />
           95  +  </xs:complexType>
           96  +
           97  +
           98  +    <xs:complexType name="TUsing">
           99  +        <xs:sequence>
          100  +            <xs:group ref="edm:GEmptyElementExtensibility" minOccurs="0" maxOccurs="1"/>
          101  +        </xs:sequence>
          102  +        <xs:attribute name="Namespace" type="edm:TQualifiedName" use="required" />
          103  +        <xs:attribute name="Alias" type="edm:TSimpleIdentifier" use="required" />
          104  +        <xs:anyAttribute namespace="##other" processContents="lax" />
          105  +    </xs:complexType>
          106  +
          107  +    <xs:complexType name="TAssociation">
          108  +        <xs:sequence>
          109  +            <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
          110  +            <xs:element name="End" type="edm:TAssociationEnd" minOccurs="2" maxOccurs="2"/>
          111  +            <xs:element name="ReferentialConstraint" type="edm:TConstraint" minOccurs="0" maxOccurs="1" />
          112  +            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
          113  +        </xs:sequence>
          114  +        <xs:attribute name="Name" type="edm:TSimpleIdentifier" use="required" />
          115  +        <!--<xs:attribute name="Identifying" type="xs:boolean" use="optional" default="false" />-->
          116  +        <xs:anyAttribute namespace="##other" processContents="lax" />
          117  +    </xs:complexType>
          118  +
          119  +    <xs:complexType name="TConstraint">
          120  +        <xs:sequence>
          121  +            <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
          122  +            <xs:element name="Principal" type="edm:TReferentialConstraintRoleElement" minOccurs="1" maxOccurs="1" />
          123  +            <xs:element name="Dependent" type="edm:TReferentialConstraintRoleElement" minOccurs="1" maxOccurs="1" />
          124  +            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
          125  +        </xs:sequence>
          126  +        <xs:anyAttribute namespace="##other" processContents="lax"/>
          127  +    </xs:complexType>
          128  +
          129  +    <xs:complexType name="TNavigationProperty">
          130  +        <xs:sequence>
          131  +            <xs:group ref="edm:GEmptyElementExtensibility" minOccurs="0" maxOccurs="1"/>
          132  +        </xs:sequence>
          133  +        <xs:attribute name="Name" type="edm:TSimpleIdentifier" use="required" />
          134  +        <xs:attribute name="Relationship" type="edm:TQualifiedName" use ="required" />
          135  +        <xs:attribute name="ToRole" type="edm:TSimpleIdentifier" use="required" />
          136  +        <xs:attribute name="FromRole" type="edm:TSimpleIdentifier" use="required" />
          137  +        <xs:anyAttribute namespace="##other" processContents="lax" />
          138  +    </xs:complexType>
          139  +
          140  +    <xs:complexType name="TReferentialConstraintRoleElement">
          141  +        <xs:sequence>
          142  +            <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
          143  +            <xs:element name="PropertyRef" type="edm:TPropertyRef" minOccurs="1" maxOccurs="unbounded" />
          144  +            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
          145  +        </xs:sequence>
          146  +        <xs:attribute name="Role" type="edm:TSimpleIdentifier" use="required" />
          147  +        <xs:anyAttribute namespace="##other" processContents="lax"/>
          148  +    </xs:complexType>
          149  +
          150  +    <xs:complexType name="TEntityType">
          151  +        <xs:sequence>
          152  +            <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
          153  +            <xs:element name="Key" type="edm:TEntityKeyElement" minOccurs="0" maxOccurs="1"/>
          154  +            <xs:choice minOccurs="0" maxOccurs="unbounded">
          155  +                <xs:element name="Property" type="edm:TEntityProperty" minOccurs="0" maxOccurs="unbounded" />
          156  +                <xs:element name="NavigationProperty" type="edm:TNavigationProperty" minOccurs="0" maxOccurs="unbounded"/>
          157  +            </xs:choice>
          158  +            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
          159  +        </xs:sequence>
          160  +        <xs:attribute name="Name" type="edm:TSimpleIdentifier" use="required" />
          161  +        <xs:anyAttribute namespace="##other" processContents="lax"/>
          162  +    </xs:complexType>
          163  +
          164  +    <xs:complexType name ="TEntityKeyElement">
          165  +        <xs:sequence>
          166  +            <xs:element name="PropertyRef" type="edm:TPropertyRef" minOccurs="1" maxOccurs="unbounded" />
          167  +            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
          168  +        </xs:sequence>
          169  +    </xs:complexType>
          170  +
          171  +    <xs:complexType name="TPropertyRef">
          172  +        <xs:sequence>
          173  +            <xs:group ref="edm:GEmptyElementExtensibility" minOccurs="0" maxOccurs="1" />
          174  +        </xs:sequence>
          175  +        <xs:attribute name="Name" type="edm:TSimpleIdentifier" use="required" />
          176  +        <xs:anyAttribute namespace="##other" processContents="lax" />
          177  +    </xs:complexType>
          178  +
          179  +    <xs:group name="GEmptyElementExtensibility">
          180  +        <xs:sequence>
          181  +            <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
          182  +            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
          183  +        </xs:sequence>
          184  +    </xs:group>
          185  +
          186  +    <!-- 
          187  +        base types  
          188  +    -->
          189  +    <xs:complexType name="TAssociationEnd">
          190  +        <xs:sequence>
          191  +            <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
          192  +            <xs:group ref="edm:TOperations" minOccurs="0" maxOccurs="unbounded" />
          193  +            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
          194  +        </xs:sequence>
          195  +        <xs:attribute name="Type" type="edm:TQualifiedName" use="required" />
          196  +        <xs:attribute name="Role" type="edm:TSimpleIdentifier" use="optional" />
          197  +        <xs:attribute name="Multiplicity" type="edm:TMultiplicity" use="required" />
          198  +        <xs:anyAttribute namespace="##other" processContents="lax" />
          199  +    </xs:complexType>
          200  +
          201  +    <xs:group name="TOperations">
          202  +        <xs:choice>
          203  +            <xs:element name="OnDelete" type="edm:TOnAction" maxOccurs="1" minOccurs="0" />
          204  +        </xs:choice>
          205  +    </xs:group>
          206  +
          207  +    <xs:complexType name="TOnAction">
          208  +        <xs:sequence>
          209  +            <xs:group ref="edm:GEmptyElementExtensibility" minOccurs="0" maxOccurs="1"/>
          210  +        </xs:sequence>
          211  +        <xs:attribute name="Action" type="edm:TAction" use="required" />
          212  +        <xs:anyAttribute namespace="##other" processContents="lax" />
          213  +    </xs:complexType>
          214  +
          215  +    <xs:complexType name="TEntityProperty">
          216  +        <xs:sequence>
          217  +            <xs:group ref="edm:GEmptyElementExtensibility" minOccurs="0" maxOccurs="1"/>
          218  +        </xs:sequence>
          219  +        <xs:attributeGroup ref="edm:TCommonPropertyAttributes"/>
          220  +        <xs:attribute name="StoreGeneratedPattern" type="edm:TStoreGeneratedPattern" use="optional" />
          221  +        <xs:anyAttribute namespace="##other" processContents="lax" />
          222  +    </xs:complexType>
          223  +
          224  +    <xs:attributeGroup name="TCommonPropertyAttributes">
          225  +        <xs:attribute name="Name" type="edm:TSimpleIdentifier" use="required" />
          226  +        <xs:attribute name="Type" type="edm:TPropertyType" use="required" />
          227  +        <xs:attribute name="Nullable" type="xs:boolean" default="true" use="optional" />
          228  +        <xs:attribute name="DefaultValue" type="xs:string" use="optional" />
          229  +
          230  +        <!-- Start Facets -->
          231  +        <xs:attribute name="MaxLength" type="edm:TMaxLengthFacet" use="optional" />
          232  +        <xs:attribute name="FixedLength" type="edm:TIsFixedLengthFacet" use="optional" />
          233  +        <xs:attribute name="Precision" type="edm:TPrecisionFacet" use="optional" />
          234  +        <xs:attribute name="Scale" type="edm:TScaleFacet" use="optional" />
          235  +        <xs:attribute name="Unicode" type="edm:TIsUnicodeFacet" use="optional" />
          236  +        <xs:attribute name="Collation" type="edm:TCollationFacet" use="optional" />
          237  +        <!--End Facets -->
          238  +    </xs:attributeGroup>
          239  +
          240  +    <xs:attributeGroup name="TEntitySetAttributes">
          241  +        <xs:attribute name="Name" type="edm:TSimpleIdentifier" use="required" />
          242  +        <xs:attribute name="EntityType" type="edm:TQualifiedName" use="required" />
          243  +        <xs:attribute name="Schema" type="edm:TSimpleIdentifier" use="optional" />
          244  +        <xs:attribute name="Table" type="edm:TSimpleIdentifier" use="optional" />
          245  +
          246  +    </xs:attributeGroup>
          247  +
          248  +    <xs:element name="EntityContainer">
          249  +        <xs:complexType>
          250  +            <xs:sequence>
          251  +                <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
          252  +                <xs:choice minOccurs="0" maxOccurs="unbounded">
          253  +                    <xs:element name="EntitySet">
          254  +                        <xs:complexType>
          255  +                            <xs:sequence>
          256  +                                <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
          257  +                                <xs:element name="DefiningQuery" type="edm:TCommandText" minOccurs="0" maxOccurs="1"/>
          258  +                                <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
          259  +                            </xs:sequence>
          260  +                            <xs:attributeGroup ref="edm:TEntitySetAttributes"/>
          261  +                          <xs:attribute ref="gen:Type" use="optional"/>
          262  +                          <xs:attribute ref="gen:Schema" use="optional"/>
          263  +                          <xs:attribute ref="gen:Name" use="optional"/>
          264  +                          <xs:anyAttribute processContents="lax" namespace="##other" />
          265  +                        </xs:complexType>
          266  +                    </xs:element>
          267  +
          268  +                    <xs:element name="AssociationSet">
          269  +                        <xs:complexType>
          270  +                            <xs:sequence>
          271  +                                <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
          272  +                                <xs:element name="End" minOccurs="0" maxOccurs="2">
          273  +                                    <!-- 1. The number of Ends has to match with ones defined in AssociationType 
          274  +                                         2. Value for attribute Name should match the defined ones and EntitySet should be of the 
          275  +                                            defined Entity Type in AssociationType 
          276  +                                    -->
          277  +                                    <xs:complexType>
          278  +                                        <xs:sequence>
          279  +                                            <xs:group ref="edm:GEmptyElementExtensibility" minOccurs="0" maxOccurs="1"/>
          280  +                                        </xs:sequence>
          281  +                                        <xs:attribute name="Role" type="edm:TSimpleIdentifier" use="optional" />
          282  +                                        <xs:attribute name="EntitySet" type="edm:TSimpleIdentifier" use="required" />
          283  +                                    </xs:complexType>
          284  +                                </xs:element>
          285  +                                <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
          286  +                            </xs:sequence>
          287  +                            <xs:attribute name="Name" type="edm:TSimpleIdentifier" use="required" />
          288  +                            <xs:attribute name="Association" type="edm:TQualifiedName" use="required" />
          289  +                            <xs:anyAttribute namespace="##other" processContents="lax" />
          290  +                        </xs:complexType>
          291  +                    </xs:element>
          292  +                </xs:choice>
          293  +            </xs:sequence>
          294  +            <xs:attribute name="Name" type="edm:TSimpleIdentifier" use="required" />
          295  +        </xs:complexType>
          296  +    </xs:element>
          297  +
          298  +    <xs:complexType name="TFunction">
          299  +        <xs:sequence>
          300  +            <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
          301  +            <xs:element name="CommandText" type="edm:TCommandText" minOccurs="0" maxOccurs="1" />
          302  +            <xs:element name="Parameter" type="edm:TParameter" minOccurs="0" maxOccurs="unbounded" />
          303  +            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
          304  +        </xs:sequence>
          305  +        <xs:attribute name="Name" type="xs:string" use="required" />
          306  +        <xs:attribute name="ReturnType" type="edm:TFunctionType" use="optional" />
          307  +        <xs:attribute name="Aggregate" type="xs:boolean" use="optional" />
          308  +        <xs:attribute name="BuiltIn" type="xs:boolean" use="optional" />
          309  +        <xs:attribute name="StoreFunctionName" type="xs:string" use="optional" />
          310  +        <xs:attribute name="NiladicFunction" type="xs:boolean" use="optional" />
          311  +        <xs:attribute name="IsComposable" type="xs:boolean" use="optional" default="true" />
          312  +        <xs:attribute name="ParameterTypeSemantics" type="edm:TParameterTypeSemantics" use="optional" default="AllowImplicitConversion" />
          313  +        <xs:attribute name="Schema" type="edm:TSimpleIdentifier" use="optional" />
          314  +        <xs:anyAttribute namespace="##other" processContents="lax" />
          315  +    </xs:complexType>
          316  +
          317  +    <xs:complexType name="TParameter">
          318  +        <xs:sequence>
          319  +            <xs:element name="Documentation" type="edm:TDocumentation" minOccurs="0" maxOccurs="1" />
          320  +            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
          321  +        </xs:sequence>
          322  +        <xs:attribute name="Name" type="xs:string" use="required" />
          323  +        <xs:attribute name="Type" type="edm:TFunctionType" use="required" />
          324  +        <xs:attribute name="Mode" type="edm:TParameterMode" use="optional" />
          325  +        <!-- Start Facets -->
          326  +        <xs:attribute name="MaxLength" type="edm:TMaxLengthFacet" use="optional" />
          327  +        <xs:attribute name="Precision" type="edm:TPrecisionFacet" use="optional" />
          328  +        <xs:attribute name="Scale" type="edm:TScaleFacet" use="optional" />
          329  +        <!--End Facets -->
          330  +        <xs:anyAttribute namespace="##other" processContents="lax" />
          331  +    </xs:complexType>
          332  +
          333  +    <!-- 
          334  +    general (more or less) purpose simple types 
          335  +    -->
          336  +
          337  +  <xs:simpleType name="TCommandText">
          338  +    <xs:restriction base="xs:string">
          339  +      <xs:whiteSpace value="preserve"/>
          340  +    </xs:restriction>
          341  +  </xs:simpleType>
          342  +
          343  +  <xs:simpleType name="TQualifiedName">
          344  +        <xs:restriction base="xs:string"/>
          345  +    </xs:simpleType>
          346  +
          347  +    <xs:simpleType name="TSimpleIdentifier">
          348  +        <xs:restriction base="xs:string"/>
          349  +    </xs:simpleType>
          350  +
          351  +    <xs:simpleType name="TPropertyType">
          352  +        <xs:union memberTypes="edm:TQualifiedName">
          353  +            <xs:simpleType>
          354  +                <xs:restriction base="xs:token">
          355  +                    <!-- The below pattern represents the allowed identifiers in ECMA specification plus the '.' for namespace qualification -->
          356  +                    <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,}" />
          357  +                </xs:restriction>
          358  +            </xs:simpleType>
          359  +        </xs:union>
          360  +    </xs:simpleType>
          361  +
          362  +    <xs:simpleType name="TAction">
          363  +        <xs:restriction base="xs:token">
          364  +            <xs:enumeration value="Cascade" />
          365  +            <xs:enumeration value="Restrict" />
          366  +            <xs:enumeration value="None" />
          367  +        </xs:restriction>
          368  +    </xs:simpleType>
          369  +
          370  +    <xs:simpleType name="TMultiplicity">
          371  +    <xs:restriction base="xs:token">
          372  +      <xs:enumeration value="0..1" />
          373  +      <xs:enumeration value="1" />
          374  +      <xs:enumeration value="*" />
          375  +    </xs:restriction>
          376  +  </xs:simpleType>
          377  +
          378  +    <xs:simpleType name="TStoreGeneratedPattern">
          379  +        <xs:restriction base="xs:token">
          380  +            <xs:enumeration value="None" />
          381  +            <xs:enumeration value="Identity" />
          382  +            <xs:enumeration value="Computed" />
          383  +        </xs:restriction>
          384  +    </xs:simpleType>
          385  +
          386  +    <xs:simpleType name="TParameterMode">
          387  +        <xs:restriction base="xs:token">
          388  +            <xs:enumeration value="In" />
          389  +            <xs:enumeration value="Out" />
          390  +            <xs:enumeration value="InOut" />
          391  +        </xs:restriction>
          392  +    </xs:simpleType>
          393  +    <xs:simpleType name="TFunctionType">
          394  +        <xs:union memberTypes="edm:TQualifiedName ">
          395  +            <xs:simpleType>
          396  +                <xs:restriction base="xs:token">
          397  +                    <xs:pattern value="Collection\([^ \t]{1,}(\.[^ \t]{1,}){0,}\)" />
          398  +                </xs:restriction>
          399  +            </xs:simpleType>
          400  +        </xs:union>
          401  +    </xs:simpleType>
          402  +    <xs:simpleType name="TParameterTypeSemantics">
          403  +        <xs:restriction base="xs:token">
          404  +            <xs:enumeration value="ExactMatchOnly" />
          405  +            <xs:enumeration value="AllowImplicitPromotion" />
          406  +            <xs:enumeration value="AllowImplicitConversion" />
          407  +        </xs:restriction>
          408  +    </xs:simpleType>
          409  +
          410  +
          411  +</xs:schema>

Added System.Data.SQLite.Linq/SQL.

            1  +//---------------------------------------------------------------------
            2  +// <copyright file="TopClause.cs" company="Microsoft">
            3  +//      Copyright (c) Microsoft Corporation.  All rights reserved.
            4  +// </copyright>
            5  +//---------------------------------------------------------------------
            6  +
            7  +using System;
            8  +using System.Collections.Generic;
            9  +using System.Diagnostics;
           10  +using System.Globalization;
           11  +using System.IO;
           12  +using System.Text;
           13  +using System.Data.Metadata.Edm;
           14  +using System.Data.Common.CommandTrees;
           15  +
           16  +namespace System.Data.SQLite
           17  +{
           18  +    /// <summary>
           19  +    /// TopClause represents the a TOP expression in a SqlSelectStatement. 
           20  +    /// It has a count property, which indicates how many TOP rows should be selected and a 
           21  +    /// boolen WithTies property.
           22  +    /// </summary>
           23  +    class TopClause : ISqlFragment
           24  +    {
           25  +        ISqlFragment topCount;
           26  +        bool withTies;
           27  +
           28  +        /// <summary>
           29  +        /// Do we need to add a WITH_TIES to the top statement
           30  +        /// </summary>
           31  +        internal bool WithTies
           32  +        {
           33  +            get { return withTies; }
           34  +        }
           35  +
           36  +        /// <summary>
           37  +        /// How many top rows should be selected.
           38  +        /// </summary>
           39  +        internal ISqlFragment TopCount
           40  +        {
           41  +            get { return topCount; }
           42  +        }
           43  +
           44  +        /// <summary>
           45  +        /// Creates a TopClause with the given topCount and withTies.
           46  +        /// </summary>
           47  +        /// <param name="topCount"></param>
           48  +        /// <param name="withTies"></param>
           49  +        internal TopClause(ISqlFragment topCount, bool withTies)
           50  +        {
           51  +            this.topCount = topCount;
           52  +            this.withTies = withTies;
           53  +        }
           54  +
           55  +        /// <summary>
           56  +        /// Creates a TopClause with the given topCount and withTies.
           57  +        /// </summary>
           58  +        /// <param name="topCount"></param>
           59  +        /// <param name="withTies"></param>
           60  +        internal TopClause(int topCount, bool withTies)
           61  +        {
           62  +            SqlBuilder sqlBuilder = new SqlBuilder();
           63  +            sqlBuilder.Append(topCount.ToString(CultureInfo.InvariantCulture));
           64  +            this.topCount = sqlBuilder;
           65  +            this.withTies = withTies;
           66  +        }
           67  +
           68  +        #region ISqlFragment Members
           69  +
           70  +        /// <summary>
           71  +        /// Write out the TOP part of sql select statement 
           72  +        /// It basically writes TOP (X) [WITH TIES].
           73  +        /// </summary>
           74  +        /// <param name="writer"></param>
           75  +        /// <param name="sqlGenerator"></param>
           76  +        public void WriteSql(SqlWriter writer, SqlGenerator sqlGenerator)
           77  +        {
           78  +            writer.Write("TOP (");
           79  +            this.TopCount.WriteSql(writer, sqlGenerator);
           80  +            writer.Write(")");
           81  +
           82  +            writer.Write(" ");
           83  +
           84  +            if (this.WithTies)
           85  +            {
           86  +                writer.Write("WITH TIES ");
           87  +            }
           88  +        }
           89  +
           90  +        #endregion
           91  +    }
           92  +}

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

            1  +//---------------------------------------------------------------------
            2  +// <copyright file="SampleProviderManifest.cs" company="Microsoft">
            3  +//      Copyright (c) Microsoft Corporation.  All rights reserved.
            4  +// </copyright>
            5  +//---------------------------------------------------------------------
            6  +
            7  +using System.Collections.Generic;
            8  +using System.Xml;
            9  +using System.Collections.ObjectModel;
           10  +using System.Data.EntityModel.SchemaObjectModel;
           11  +using System.Data.EntityModel;
           12  +using System.Data.Common;
           13  +using System.Diagnostics;
           14  +using System.Data.Entity;
           15  +using System.Data.Metadata.Edm;
           16  +using System;
           17  +using System.Data;
           18  +using System.Reflection;
           19  +using System.IO;
           20  +
           21  +namespace System.Data.SQLite
           22  +{
           23  +  /// <summary>
           24  +  /// The Provider Manifest for SQL Server
           25  +  /// </summary>
           26  +  internal class SQLiteProviderManifest : DbXmlEnabledProviderManifest
           27  +  {
           28  +    #region Private Fields
           29  +
           30  +    /// <summary>
           31  +    /// maximum size of sql server unicode 
           32  +    /// </summary>
           33  +    private const int varcharMaxSize = Int32.MaxValue;
           34  +    private const int nvarcharMaxSize = Int32.MaxValue;
           35  +    private const int binaryMaxSize = Int32.MaxValue;
           36  +
           37  +    private System.Collections.ObjectModel.ReadOnlyCollection<PrimitiveType> _primitiveTypes = null;
           38  +    private System.Collections.ObjectModel.ReadOnlyCollection<EdmFunction> _functions = null;
           39  +
           40  +    #endregion
           41  +
           42  +    #region Constructors
           43  +
           44  +    /// <summary>
           45  +    /// Constructor
           46  +    /// </summary>
           47  +    /// <param name="manifestToken">A token used to infer the capabilities of the store</param>
           48  +    public SQLiteProviderManifest()
           49  +      : base(SQLiteProviderManifest.GetProviderManifest())
           50  +    {
           51  +    }
           52  +
           53  +    #endregion
           54  +
           55  +    #region Properties
           56  +
           57  +    /// <summary>
           58  +    /// Provider Invariant Name - this property will be removed in Entity Framework v1
           59  +    /// Entity Framework SP1Beta does not use it, but it must be defined.
           60  +    /// </summary>
           61  +    public override string Provider
           62  +    {
           63  +      get { throw new NotImplementedException(); }
           64  +    }
           65  +
           66  +    /// <summary>
           67  +    /// Provider Manifest Token - this property will be removed in Entity Framework v1
           68  +    /// Entity Framework SP1Beta does not use it, but it must be defined.
           69  +    /// </summary>
           70  +    public override string Token
           71  +    {
           72  +      get { throw new NotImplementedException(); }
           73  +    }
           74  +
           75  +    #endregion
           76  +
           77  +    internal static XmlReader GetProviderManifest()
           78  +    {
           79  +      return GetXmlResource("System.Data.SQLite.Resources.SQLiteProviderServices.ProviderManifest.xml");
           80  +    }
           81  +
           82  +    /// <summary>
           83  +    /// Providers should override this to return information specific to their provider.  
           84  +    /// 
           85  +    /// This method should never return null.
           86  +    /// </summary>
           87  +    /// <param name="informationType">The name of the information to be retrieved.</param>
           88  +    /// <returns>An XmlReader at the begining of the information requested.</returns>
           89  +    protected override XmlReader GetDbInformation(string informationType)
           90  +    {
           91  +      if (informationType == DbProviderManifest.StoreSchemaDefinition)
           92  +      {
           93  +        return GetStoreSchemaDescription();
           94  +      }
           95  +
           96  +      if (informationType == DbProviderManifest.StoreSchemaMapping)
           97  +      {
           98  +        return GetStoreSchemaMapping();
           99  +      }
          100  +
          101  +      throw new ProviderIncompatibleException(String.Format("The provider returned null for the informationType '{0}'.", informationType));
          102  +    }
          103  +
          104  +    public override System.Collections.ObjectModel.ReadOnlyCollection<PrimitiveType> GetStoreTypes()
          105  +    {
          106  +      if (_primitiveTypes == null)
          107  +      {
          108  +        List<PrimitiveType> primitiveTypes = new List<PrimitiveType>(base.GetStoreTypes());
          109  +        PrimitiveType newt;
          110  +
          111  +        newt = PrimitiveType.GetEdmPrimitiveType(PrimitiveTypeKind.Int64);
          112  +
          113  +        _primitiveTypes = primitiveTypes.AsReadOnly();
          114  +      }
          115  +      return _primitiveTypes;
          116  +    }
          117  +
          118  +    public override System.Collections.ObjectModel.ReadOnlyCollection<EdmFunction> GetStoreFunctions()
          119  +    {
          120  +      if (this._functions == null)
          121  +      {
          122  +        this._functions = base.GetStoreFunctions();
          123  +      }
          124  +      return this._functions;
          125  +    }
          126  +
          127  +    /// <summary>
          128  +    /// This method takes a type and a set of facets and returns the best mapped equivalent type 
          129  +    /// in EDM.
          130  +    /// </summary>
          131  +    /// <param name="storeType">A TypeUsage encapsulating a store type and a set of facets</param>
          132  +    /// <returns>A TypeUsage encapsulating an EDM type and a set of facets</returns>
          133  +    public override TypeUsage GetEdmType(TypeUsage storeType)
          134  +    {
          135  +      if (storeType == null)
          136  +      {
          137  +        throw new ArgumentNullException("storeType");
          138  +      }
          139  +
          140  +      string storeTypeName = storeType.EdmType.Name.ToLowerInvariant();
          141  +      if (!base.StoreTypeNameToEdmPrimitiveType.ContainsKey(storeTypeName))
          142  +      {
          143  +        switch (storeTypeName)
          144  +        {
          145  +          case "integer":
          146  +            return TypeUsage.CreateDefaultTypeUsage(PrimitiveType.GetEdmPrimitiveType(PrimitiveTypeKind.Int64));
          147  +          default:
          148  +            throw new ArgumentException(String.Format("The underlying provider does not support the type '{0}'.", storeTypeName));
          149  +        }
          150  +      }
          151  +
          152  +      PrimitiveType edmPrimitiveType = base.StoreTypeNameToEdmPrimitiveType[storeTypeName];
          153  +
          154  +      int maxLength = 0;
          155  +      bool isUnicode = true;
          156  +      bool isFixedLen = false;
          157  +      bool isUnbounded = true;
          158  +
          159  +      PrimitiveTypeKind newPrimitiveTypeKind;
          160  +
          161  +      switch (storeTypeName)
          162  +      {
          163  +        // for some types we just go with simple type usage with no facets
          164  +        case "tinyint":
          165  +        case "smallint":
          166  +        case "integer":
          167  +        case "bit":
          168  +        case "uniqueidentifier":
          169  +        case "int":
          170  +          return TypeUsage.CreateDefaultTypeUsage(edmPrimitiveType);
          171  +
          172  +        case "varchar":
          173  +          newPrimitiveTypeKind = PrimitiveTypeKind.String;
          174  +          isUnbounded = !TypeHelpers.TryGetMaxLength(storeType, out maxLength);
          175  +          isUnicode = false;
          176  +          isFixedLen = false;
          177  +          break;
          178  +
          179  +        case "char":
          180  +          newPrimitiveTypeKind = PrimitiveTypeKind.String;
          181  +          isUnbounded = !TypeHelpers.TryGetMaxLength(storeType, out maxLength);
          182  +          isUnicode = false;
          183  +          isFixedLen = true;
          184  +          break;
          185  +
          186  +        case "nvarchar":
          187  +          newPrimitiveTypeKind = PrimitiveTypeKind.String;
          188  +          isUnbounded = !TypeHelpers.TryGetMaxLength(storeType, out maxLength);
          189  +          isUnicode = true;
          190  +          isFixedLen = false;
          191  +          break;
          192  +
          193  +        case "nchar":
          194  +          newPrimitiveTypeKind = PrimitiveTypeKind.String;
          195  +          isUnbounded = !TypeHelpers.TryGetMaxLength(storeType, out maxLength);
          196  +          isUnicode = true;
          197  +          isFixedLen = true;
          198  +          break;
          199  +
          200  +        case "blob":
          201  +          newPrimitiveTypeKind = PrimitiveTypeKind.Binary;
          202  +          isUnbounded = !TypeHelpers.TryGetMaxLength(storeType, out maxLength);
          203  +          isFixedLen = false;
          204  +          break;
          205  +
          206  +        case "float":
          207  +        case "real":
          208  +          return TypeUsage.CreateDefaultTypeUsage(edmPrimitiveType);
          209  +
          210  +        case "decimal":
          211  +          {
          212  +            byte precision;
          213  +            byte scale;
          214  +            if (TypeHelpers.TryGetPrecision(storeType, out precision) && TypeHelpers.TryGetScale(storeType, out scale))
          215  +            {
          216  +              return TypeUsage.CreateDecimalTypeUsage(edmPrimitiveType, precision, scale);
          217  +            }
          218  +            else
          219  +            {
          220  +              return TypeUsage.CreateDecimalTypeUsage(edmPrimitiveType);
          221  +            }
          222  +          }
          223  +
          224  +        case "datetime":
          225  +          return TypeUsage.CreateDateTimeTypeUsage(edmPrimitiveType, null);
          226  +
          227  +        default:
          228  +          throw new NotSupportedException(String.Format("The underlying provider does not support the type '{0}'.", storeTypeName));
          229  +      }
          230  +
          231  +      Debug.Assert(newPrimitiveTypeKind == PrimitiveTypeKind.String || newPrimitiveTypeKind == PrimitiveTypeKind.Binary, "at this point only string and binary types should be present");
          232  +
          233  +      switch (newPrimitiveTypeKind)
          234  +      {
          235  +        case PrimitiveTypeKind.String:
          236  +          if (!isUnbounded)
          237  +          {
          238  +            return TypeUsage.CreateStringTypeUsage(edmPrimitiveType, isUnicode, isFixedLen, maxLength);
          239  +          }
          240  +          else
          241  +          {
          242  +            return TypeUsage.CreateStringTypeUsage(edmPrimitiveType, isUnicode, isFixedLen);
          243  +          }
          244  +        case PrimitiveTypeKind.Binary:
          245  +          if (!isUnbounded)
          246  +          {
          247  +            return TypeUsage.CreateBinaryTypeUsage(edmPrimitiveType, isFixedLen, maxLength);
          248  +          }
          249  +          else
          250  +          {
          251  +            return TypeUsage.CreateBinaryTypeUsage(edmPrimitiveType, isFixedLen);
          252  +          }
          253  +        default:
          254  +          throw new NotSupportedException(String.Format("The underlying provider does not support the type '{0}'.", storeTypeName));
          255  +      }
          256  +    }
          257  +
          258  +    /// <summary>
          259  +    /// This method takes a type and a set of facets and returns the best mapped equivalent type 
          260  +    /// in SQL Server, taking the store version into consideration.
          261  +    /// </summary>
          262  +    /// <param name="storeType">A TypeUsage encapsulating an EDM type and a set of facets</param>
          263  +    /// <returns>A TypeUsage encapsulating a store type and a set of facets</returns>
          264  +    public override TypeUsage GetStoreType(TypeUsage edmType)
          265  +    {
          266  +      if (edmType == null)
          267  +      {
          268  +        throw new ArgumentNullException("edmType");
          269  +      }
          270  +      System.Diagnostics.Debug.Assert(edmType.EdmType.BuiltInTypeKind == BuiltInTypeKind.PrimitiveType);
          271  +
          272  +      PrimitiveType primitiveType = edmType.EdmType as PrimitiveType;
          273  +      if (primitiveType == null)
          274  +      {
          275  +        throw new ArgumentException(String.Format("The underlying provider does not support the type '{0}'.", edmType));
          276  +      }
          277  +
          278  +      ReadOnlyMetadataCollection<Facet> facets = edmType.Facets;
          279  +
          280  +      switch (primitiveType.PrimitiveTypeKind)
          281  +      {
          282  +        case PrimitiveTypeKind.Boolean:
          283  +          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["bit"]);
          284  +
          285  +        case PrimitiveTypeKind.Byte:
          286  +          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["tinyint"]);
          287  +
          288  +        case PrimitiveTypeKind.Int16:
          289  +          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["smallint"]);
          290  +
          291  +        case PrimitiveTypeKind.Int32:
          292  +          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["int"]);
          293  +
          294  +        case PrimitiveTypeKind.Int64:
          295  +          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["integer"]);
          296  +
          297  +        case PrimitiveTypeKind.Guid:
          298  +          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["uniqueidentifier"]);
          299  +
          300  +        case PrimitiveTypeKind.Double:
          301  +          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["float"]);
          302  +
          303  +        case PrimitiveTypeKind.Single:
          304  +          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["real"]);
          305  +
          306  +        case PrimitiveTypeKind.Decimal: // decimal, numeric, smallmoney, money
          307  +          {
          308  +            byte precision;
          309  +            if (!TypeHelpers.TryGetPrecision(edmType, out precision))
          310  +            {
          311  +              precision = 18;
          312  +            }
          313  +
          314  +            byte scale;
          315  +            if (!TypeHelpers.TryGetScale(edmType, out scale))
          316  +            {
          317  +              scale = 0;
          318  +            }
          319  +
          320  +            return TypeUsage.CreateDecimalTypeUsage(StoreTypeNameToStorePrimitiveType["extDecimal"], precision, scale);
          321  +          }
          322  +
          323  +        case PrimitiveTypeKind.Binary: // binary, varbinary, varbinary(max), image, timestamp, rowversion
          324  +          {
          325  +            bool isFixedLength = null != facets["FixedLength"].Value && (bool)facets["FixedLength"].Value;
          326  +            Facet f = facets["MaxLength"];
          327  +
          328  +            bool isMaxLength = f.IsUnbounded || null == f.Value || (int)f.Value > binaryMaxSize;
          329  +            int maxLength = !isMaxLength ? (int)f.Value : Int32.MinValue;
          330  +
          331  +            TypeUsage tu;
          332  +            if (isFixedLength)
          333  +            {
          334  +              tu = TypeUsage.CreateBinaryTypeUsage(StoreTypeNameToStorePrimitiveType["binary"], true, maxLength);
          335  +            }
          336  +            else
          337  +            {
          338  +              if (isMaxLength)
          339  +              {
          340  +                tu = TypeUsage.CreateBinaryTypeUsage(StoreTypeNameToStorePrimitiveType["blob"], false);
          341  +                System.Diagnostics.Debug.Assert(tu.Facets["MaxLength"].Description.IsConstant, "varbinary(max) is not constant!");
          342  +              }
          343  +              else
          344  +              {
          345  +                tu = TypeUsage.CreateBinaryTypeUsage(StoreTypeNameToStorePrimitiveType["blob"], false, maxLength);
          346  +              }
          347  +            }
          348  +            return tu;
          349  +          }
          350  +
          351  +        case PrimitiveTypeKind.String:
          352  +          // char, nchar, varchar, nvarchar, varchar(max), nvarchar(max), ntext, text, xml
          353  +          {
          354  +            bool isUnicode = null == facets["Unicode"].Value || (bool)facets["Unicode"].Value;
          355  +            bool isFixedLength = null != facets["FixedLength"].Value && (bool)facets["FixedLength"].Value;
          356  +            Facet f = facets["MaxLength"];
          357  +            // maxlen is true if facet value is unbounded, the value is bigger than the limited string sizes *or* the facet
          358  +            // value is null. this is needed since functions still have maxlength facet value as null
          359  +            bool isMaxLength = f.IsUnbounded || null == f.Value || (int)f.Value > (isUnicode ? nvarcharMaxSize : varcharMaxSize);
          360  +            int maxLength = !isMaxLength ? (int)f.Value : Int32.MinValue;
          361  +
          362  +            TypeUsage tu;
          363  +
          364  +            if (isUnicode)
          365  +            {
          366  +              if (isFixedLength)
          367  +              {
          368  +                tu = TypeUsage.CreateStringTypeUsage(StoreTypeNameToStorePrimitiveType["nchar"], true, true, maxLength);
          369  +              }
          370  +              else
          371  +              {
          372  +                if (isMaxLength)
          373  +                {
          374  +                  tu = TypeUsage.CreateStringTypeUsage(StoreTypeNameToStorePrimitiveType["nvarchar"], true, false);
          375  +                }
          376  +                else
          377  +                {
          378  +                  tu = TypeUsage.CreateStringTypeUsage(StoreTypeNameToStorePrimitiveType["nvarchar"], true, false, maxLength);
          379  +                }
          380  +              }
          381  +            }
          382  +            else
          383  +            {
          384  +              if (isFixedLength)
          385  +              {
          386  +                tu = TypeUsage.CreateStringTypeUsage(StoreTypeNameToStorePrimitiveType["char"], false, true, maxLength);
          387  +              }
          388  +              else
          389  +              {
          390  +                if (isMaxLength)
          391  +                {
          392  +                  tu = TypeUsage.CreateStringTypeUsage(StoreTypeNameToStorePrimitiveType["varchar"], false, false);
          393  +                }
          394  +                else
          395  +                {
          396  +                  tu = TypeUsage.CreateStringTypeUsage(StoreTypeNameToStorePrimitiveType["varchar"], false, false, maxLength);
          397  +                }
          398  +              }
          399  +            }
          400  +            return tu;
          401  +          }
          402  +
          403  +        case PrimitiveTypeKind.DateTime: // datetime, smalldatetime
          404  +
          405  +          Facet preserveSecondsFacet;
          406  +          bool preserveSeconds;
          407  +          if (edmType.Facets.TryGetValue("PreserveSeconds", true, out preserveSecondsFacet) && null != preserveSecondsFacet.Value)
          408  +          {
          409  +            preserveSeconds = (bool)preserveSecondsFacet.Value;
          410  +          }
          411  +          else
          412  +          {
          413  +            preserveSeconds = true;
          414  +          }
          415  +
          416  +          return TypeUsage.CreateDefaultTypeUsage(preserveSeconds ? StoreTypeNameToStorePrimitiveType["datetime"] : StoreTypeNameToStorePrimitiveType["smalldatetime"]);
          417  +
          418  +        default:
          419  +          throw new NotSupportedException(String.Format("There is no store type corresponding to the EDM type '{0}' of primitive type '{1}'.", edmType, primitiveType.PrimitiveTypeKind));
          420  +      }
          421  +    }
          422  +
          423  +    private XmlReader GetStoreSchemaMapping()
          424  +    {
          425  +      return GetXmlResource("System.Data.SQLite.Resources.SQLiteProviderServices.StoreSchemaMapping.msl");
          426  +    }
          427  +
          428  +    private XmlReader GetStoreSchemaDescription()
          429  +    {
          430  +      return GetXmlResource("System.Data.SQLite.Resources.SQLiteProviderServices.StoreSchemaDefinition.ssdl");
          431  +    }
          432  +
          433  +    internal static XmlReader GetXmlResource(string resourceName)
          434  +    {
          435  +      Assembly executingAssembly = Assembly.GetExecutingAssembly();
          436  +      Stream stream = executingAssembly.GetManifestResourceStream(resourceName);
          437  +      return XmlReader.Create(stream);
          438  +    }
          439  +
          440  +    class TypeHelpers
          441  +    {
          442  +      public static bool TryGetPrecision(TypeUsage tu, out byte precision)
          443  +      {
          444  +        Facet f;
          445  +
          446  +        precision = 0;
          447  +        if (tu.Facets.TryGetValue("Precision", false, out f))
          448  +        {
          449  +          if (!f.IsUnbounded && f.Value != null)
          450  +          {
          451  +            precision = (byte)f.Value;
          452  +            return true;
          453  +          }
          454  +        }
          455  +        return false;
          456  +      }
          457  +
          458  +      public static bool TryGetMaxLength(TypeUsage tu, out int maxLength)
          459  +      {
          460  +        Facet f;
          461  +
          462  +        maxLength = 0;
          463  +        if (tu.Facets.TryGetValue("MaxLength", false, out f))
          464  +        {
          465  +          if (!f.IsUnbounded && f.Value != null)
          466  +          {
          467  +            maxLength = (int)f.Value;
          468  +            return true;
          469  +          }
          470  +        }
          471  +        return false;
          472  +      }
          473  +
          474  +      public static bool TryGetScale(TypeUsage tu, out byte scale)
          475  +      {
          476  +        Facet f;
          477  +
          478  +        scale = 0;
          479  +        if (tu.Facets.TryGetValue("Scale", false, out f))
          480  +        {
          481  +          if (!f.IsUnbounded && f.Value != null)
          482  +          {
          483  +            scale = (byte)f.Value;
          484  +            return true;
          485  +          }
          486  +        }
          487  +        return false;
          488  +      }
          489  +    }
          490  +  }
          491  +}

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

            1  +namespace System.Data.SQLite
            2  +{
            3  +  using System;
            4  +  using System.Data.Common;
            5  +  using System.Data.Common.CommandTrees;
            6  +  using System.Data.Metadata.Edm;
            7  +  using System.Diagnostics;
            8  +  using System.Collections.Generic;
            9  +  using System.Data.SQLite;
           10  +  using System.Text;
           11  +  using System.Globalization;
           12  +
           13  +  internal class SQLiteProviderServices : DbProviderServices, ISQLiteSchemaExtensions
           14  +  {
           15  +    internal static readonly SQLiteProviderServices Instance = new SQLiteProviderServices();
           16  +
           17  +    protected override DbCommandDefinition CreateDbCommandDefinition(DbProviderManifest manifest, DbCommandTree commandTree)
           18  +    {
           19  +      DbCommand prototype = CreateCommand(manifest, commandTree);
           20  +      DbCommandDefinition result = this.CreateCommandDefinition(prototype);
           21  +      return result;
           22  +    }
           23  +
           24  +    private DbCommand CreateCommand(DbProviderManifest manifest, DbCommandTree commandTree)
           25  +    {
           26  +      if (manifest == null)
           27  +        throw new ArgumentNullException("manifest");
           28  +
           29  +      if (commandTree == null)
           30  +        throw new ArgumentNullException("commandTree");
           31  +
           32  +      SQLiteCommand command = new SQLiteCommand();
           33  +      try
           34  +      {
           35  +        List<DbParameter> parameters;
           36  +        CommandType commandType;
           37  +
           38  +        command.CommandText = SqlGenerator.GenerateSql(commandTree, out parameters, out commandType);
           39  +        command.CommandType = commandType;
           40  +
           41  +        // Get the function (if any) implemented by the command tree since this influences our interpretation of parameters
           42  +        EdmFunction function = null;
           43  +        if (commandTree is DbFunctionCommandTree)
           44  +        {
           45  +          function = ((DbFunctionCommandTree)commandTree).Function;
           46  +        }
           47  +
           48  +        // Now make sure we populate the command's parameters from the CQT's parameters:
           49  +        foreach (KeyValuePair<string, TypeUsage> queryParameter in commandTree.Parameters)
           50  +        {
           51  +          SQLiteParameter parameter;
           52  +
           53  +          // Use the corresponding function parameter TypeUsage where available (currently, the SSDL facets and 
           54  +          // type trump user-defined facets and type in the EntityCommand).
           55  +          FunctionParameter functionParameter;
           56  +          if (null != function && function.Parameters.TryGetValue(queryParameter.Key, false, out functionParameter))
           57  +          {
           58  +            parameter = CreateSqlParameter(functionParameter.Name, functionParameter.TypeUsage, functionParameter.Mode, DBNull.Value);
           59  +          }
           60  +          else
           61  +          {
           62  +            parameter = CreateSqlParameter(queryParameter.Key, queryParameter.Value, ParameterMode.In, DBNull.Value);
           63  +          }
           64  +
           65  +          command.Parameters.Add(parameter);
           66  +        }
           67  +
           68  +        // Now add parameters added as part of SQL gen (note: this feature is only safe for DML SQL gen which
           69  +        // does not support user parameters, where there is no risk of name collision)
           70  +        if (null != parameters && 0 < parameters.Count)
           71  +        {
           72  +          if (!(commandTree is DbInsertCommandTree) &&
           73  +            !(commandTree is DbUpdateCommandTree) &&
           74  +            !(commandTree is DbDeleteCommandTree))
           75  +          {
           76  +            throw new InvalidOperationException("SqlGenParametersNotPermitted");
           77  +          }
           78  +
           79  +          foreach (DbParameter parameter in parameters)
           80  +          {
           81  +            command.Parameters.Add(parameter);
           82  +          }
           83  +        }
           84  +
           85  +        return command;
           86  +      }
           87  +      catch
           88  +      {
           89  +        command.Dispose();
           90  +        throw;
           91  +      }
           92  +    }
           93  +
           94  +    protected override string GetDbProviderManifestToken(DbConnection connection)
           95  +    {
           96  +      return "SQLite";
           97  +    }
           98  +
           99  +    protected override DbProviderManifest GetDbProviderManifest(string versionHint)
          100  +    {
          101  +      return new SQLiteProviderManifest();
          102  +    }
          103  +
          104  +    /// <summary>
          105  +    /// Creates a SQLiteParameter given a name, type, and direction
          106  +    /// </summary>
          107  +    internal static SQLiteParameter CreateSqlParameter(string name, TypeUsage type, ParameterMode mode, object value)
          108  +    {
          109  +      int? size;
          110  +
          111  +      SQLiteParameter result = new SQLiteParameter(name, value);
          112  +
          113  +      // .Direction
          114  +      ParameterDirection direction = MetadataHelpers.ParameterModeToParameterDirection(mode);
          115  +      if (result.Direction != direction)
          116  +      {
          117  +        result.Direction = direction;
          118  +      }
          119  +
          120  +      // .Size and .DbType
          121  +      // output parameters are handled differently (we need to ensure there is space for return
          122  +      // values where the user has not given a specific Size/MaxLength)
          123  +      bool isOutParam = mode != ParameterMode.In;
          124  +      DbType sqlDbType = GetSqlDbType(type, isOutParam, out size);
          125  +      if (result.DbType != sqlDbType)
          126  +      {
          127  +        result.DbType = sqlDbType;
          128  +      }
          129  +
          130  +      // Note that we overwrite 'facet' parameters where either the value is different or
          131  +      // there is an output parameter.
          132  +      if (size.HasValue && (isOutParam || result.Size != size.Value))
          133  +      {
          134  +        result.Size = size.Value;
          135  +      }
          136  +
          137  +      // .IsNullable
          138  +      bool isNullable = MetadataHelpers.IsNullable(type);
          139  +      if (isOutParam || isNullable != result.IsNullable)
          140  +      {
          141  +        result.IsNullable = isNullable;
          142  +      }
          143  +
          144  +      return result;
          145  +    }
          146  +
          147  +
          148  +    /// <summary>
          149  +    /// Determines DbType for the given primitive type. Extracts facet
          150  +    /// information as well.
          151  +    /// </summary>
          152  +    private static DbType GetSqlDbType(TypeUsage type, bool isOutParam, out int? size)
          153  +    {
          154  +      // only supported for primitive type
          155  +      PrimitiveTypeKind primitiveTypeKind = MetadataHelpers.GetPrimitiveTypeKind(type);
          156  +
          157  +      size = default(int?);
          158  +
          159  +
          160  +      // TODO add logic for Xml here
          161  +      switch (primitiveTypeKind)
          162  +      {
          163  +        case PrimitiveTypeKind.Binary:
          164  +          // for output parameters, ensure there is space...
          165  +          size = GetParameterSize(type, isOutParam);
          166  +          return GetBinaryDbType(type);
          167  +
          168  +        case PrimitiveTypeKind.Boolean:
          169  +          return DbType.Boolean;
          170  +
          171  +        case PrimitiveTypeKind.Byte:
          172  +          return DbType.Byte;
          173  +
          174  +        case PrimitiveTypeKind.Time:
          175  +          return DbType.Time;
          176  +
          177  +        case PrimitiveTypeKind.DateTimeOffset:
          178  +          return DbType.DateTimeOffset;
          179  +
          180  +        case PrimitiveTypeKind.DateTime:
          181  +          return DbType.DateTime;
          182  +
          183  +        case PrimitiveTypeKind.Decimal:
          184  +          return DbType.Decimal;
          185  +
          186  +        case PrimitiveTypeKind.Double:
          187  +          return DbType.Double;
          188  +
          189  +        case PrimitiveTypeKind.Guid:
          190  +          return DbType.Guid;
          191  +
          192  +        case PrimitiveTypeKind.Int16:
          193  +          return DbType.Int16;
          194  +
          195  +        case PrimitiveTypeKind.Int32:
          196  +          return DbType.Int32;
          197  +
          198  +        case PrimitiveTypeKind.Int64:
          199  +          return DbType.Int64;
          200  +
          201  +        case PrimitiveTypeKind.SByte:
          202  +          return DbType.SByte;
          203  +
          204  +        case PrimitiveTypeKind.Single:
          205  +          return DbType.Single;
          206  +
          207  +        case PrimitiveTypeKind.String:
          208  +          size = GetParameterSize(type, isOutParam);
          209  +          return GetStringDbType(type);
          210  +
          211  +        default:
          212  +          Debug.Fail("unknown PrimitiveTypeKind " + primitiveTypeKind);
          213  +          return DbType.Object;
          214  +      }
          215  +    }
          216  +
          217  +    /// <summary>
          218  +    /// Determines preferred value for SqlParameter.Size. Returns null
          219  +    /// where there is no preference.
          220  +    /// </summary>
          221  +    private static int? GetParameterSize(TypeUsage type, bool isOutParam)
          222  +    {
          223  +      int maxLength;
          224  +      if (MetadataHelpers.TryGetMaxLength(type, out maxLength))
          225  +      {
          226  +        // if the MaxLength facet has a specific value use it
          227  +        return maxLength;
          228  +      }
          229  +      else if (isOutParam)
          230  +      {
          231  +        // if the parameter is a return/out/inout parameter, ensure there 
          232  +        // is space for any value
          233  +        return int.MaxValue;
          234  +      }
          235  +      else
          236  +      {
          237  +        // no value
          238  +        return default(int?);
          239  +      }
          240  +    }
          241  +
          242  +    /// <summary>
          243  +    /// Chooses the appropriate DbType for the given string type.
          244  +    /// </summary>
          245  +    private static DbType GetStringDbType(TypeUsage type)
          246  +    {
          247  +      Debug.Assert(type.EdmType.BuiltInTypeKind == BuiltInTypeKind.PrimitiveType &&
          248  +        PrimitiveTypeKind.String == ((PrimitiveType)type.EdmType).PrimitiveTypeKind, "only valid for string type");
          249  +
          250  +      DbType dbType;
          251  +      if (type.EdmType.Name.ToLowerInvariant() == "xml")
          252  +      {
          253  +        dbType = DbType.Xml;
          254  +      }
          255  +      else
          256  +      {
          257  +        // Specific type depends on whether the string is a unicode string and whether it is a fixed length string.
          258  +        // By default, assume widest type (unicode) and most common type (variable length)
          259  +        bool unicode;
          260  +        bool fixedLength;
          261  +        if (!MetadataHelpers.TryGetIsFixedLength(type, out fixedLength))
          262  +        {
          263  +          fixedLength = false;
          264  +        }
          265  +
          266  +        if (!MetadataHelpers.TryGetIsUnicode(type, out unicode))
          267  +        {
          268  +          unicode = true;
          269  +        }
          270  +
          271  +        if (fixedLength)
          272  +        {
          273  +          dbType = (unicode ? DbType.StringFixedLength : DbType.AnsiStringFixedLength);
          274  +        }
          275  +        else
          276  +        {
          277  +          dbType = (unicode ? DbType.String : DbType.AnsiString);
          278  +        }
          279  +      }
          280  +      return dbType;
          281  +    }
          282  +
          283  +    /// <summary>
          284  +    /// Chooses the appropriate DbType for the given binary type.
          285  +    /// </summary>
          286  +    private static DbType GetBinaryDbType(TypeUsage type)
          287  +    {
          288  +      Debug.Assert(type.EdmType.BuiltInTypeKind == BuiltInTypeKind.PrimitiveType &&
          289  +        PrimitiveTypeKind.Binary == ((PrimitiveType)type.EdmType).PrimitiveTypeKind, "only valid for binary type");
          290  +
          291  +      // Specific type depends on whether the binary value is fixed length. By default, assume variable length.
          292  +      bool fixedLength;
          293  +      if (!MetadataHelpers.TryGetIsFixedLength(type, out fixedLength))
          294  +      {
          295  +        fixedLength = false;
          296  +      }
          297  +
          298  +      return DbType.Binary;
          299  +      //            return fixedLength ? DbType.Binary : DbType.VarBinary;
          300  +    }
          301  +
          302  +    #region ISQLiteSchemaExtensions Members
          303  +
          304  +    void ISQLiteSchemaExtensions.BuildTempSchema(SQLiteConnection cnn)
          305  +    {
          306  +      string[] arr = new string[] { "TABLES", "COLUMNS", "VIEWS", "VIEWCOLUMNS", "INDEXES", "INDEXCOLUMNS", "FOREIGNKEYS", "CATALOGS" };
          307  +
          308  +      using (DataTable table = cnn.GetSchema("Tables", new string[] { "TEMP", null, String.Format("SCHEMA{0}", arr[0]) }))
          309  +      {
          310  +        if (table.Rows.Count > 0) return;
          311  +      }
          312  +
          313  +      for (int n = 0; n < arr.Length; n++)
          314  +      {
          315  +        using (DataTable table = cnn.GetSchema(arr[n]))
          316  +        {
          317  +          DataTableToTable(cnn, table, String.Format("SCHEMA{0}", arr[n]));
          318  +        }
          319  +      }
          320  +      using (SQLiteCommand cmd = cnn.CreateCommand())
          321  +      {
          322  +        cmd.CommandText = @"
          323  +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);
          324  +
          325  +INSERT INTO TEMP.SCHEMACONSTRAINTS
          326  +SELECT INDEX_CATALOG, NULL, INDEX_NAME, TABLE_CATALOG, NULL, TABLE_NAME, 'PRIMARY KEY', 0, 0, NULL 
          327  +FROM TEMP.SCHEMAINDEXES WHERE PRIMARY_KEY = 1;
          328  +
          329  +INSERT INTO TEMP.SCHEMACONSTRAINTS
          330  +SELECT INDEX_CATALOG, NULL, INDEX_NAME, TABLE_CATALOG, NULL, TABLE_NAME, 'UNIQUE', 0, 0, NULL 
          331  +FROM TEMP.SCHEMAINDEXES WHERE PRIMARY_KEY = 0 AND [UNIQUE] = 1;
          332  +
          333  +INSERT INTO TEMP.SCHEMACONSTRAINTS
          334  +SELECT CONSTRAINT_CATALOG, NULL, CONSTRAINT_NAME, TABLE_CATALOG, NULL, TABLE_NAME, CONSTRAINT_TYPE, IS_DEFERRABLE, INITIALLY_DEFERRED, NULL 
          335  +FROM TEMP.SCHEMAFOREIGNKEYS;
          336  +";
          337  +        cmd.ExecuteNonQuery();
          338  +
          339  +        cmd.CommandText = @"
          340  +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);
          341  +
          342  +INSERT INTO TEMP.SCHEMACONSTRAINTCOLUMNS
          343  +SELECT CONSTRAINT_CATALOG, NULL, CONSTRAINT_NAME, TABLE_CATALOG, NULL, TABLE_NAME, COLUMN_NAME 
          344  +FROM TEMP.SCHEMAINDEXCOLUMNS;
          345  +
          346  +INSERT INTO TEMP.SCHEMACONSTRAINTCOLUMNS
          347  +SELECT CONSTRAINT_CATALOG, NULL, CONSTRAINT_NAME, TABLE_CATALOG, NULL, TABLE_NAME, FKEY_FROM_COLUMN
          348  +FROM TEMP.SCHEMAFOREIGNKEYS;
          349  +";
          350  +        cmd.ExecuteNonQuery();
          351  +      }
          352  +    }
          353  +
          354  +    private void DataTableToTable(SQLiteConnection cnn, DataTable table, string dest)
          355  +    {
          356  +      StringBuilder sql = new StringBuilder();
          357  +      SQLiteCommandBuilder builder = new SQLiteCommandBuilder();
          358  +
          359  +      using (SQLiteCommand cmd = cnn.CreateCommand())
          360  +      using (DataTable source = new DataTable())
          361  +      {
          362  +        sql.AppendFormat(CultureInfo.InvariantCulture, "CREATE TEMP TABLE {0} (", builder.QuoteIdentifier(dest));
          363  +        string separator = String.Empty;
          364  +        foreach (DataColumn dc in table.Columns)
          365  +        {
          366  +          sql.AppendFormat(CultureInfo.InvariantCulture, "{2}{0} {1}", builder.QuoteIdentifier(dc.ColumnName), SQLiteConvert.DbTypeToTypeName(SQLiteConvert.TypeToDbType(dc.DataType)), separator);
          367  +          separator = ", ";
          368  +        }
          369  +        sql.Append(")");
          370  +
          371  +        cmd.CommandText = sql.ToString();
          372  +        cmd.ExecuteNonQuery();
          373  +
          374  +        cmd.CommandText = String.Format("SELECT * FROM TEMP.{0} WHERE 1=2", builder.QuoteIdentifier(dest));
          375  +        using (SQLiteDataAdapter adp = new SQLiteDataAdapter(cmd))
          376  +        {
          377  +          builder.DataAdapter = adp;
          378  +
          379  +          adp.Fill(source);
          380  +
          381  +          foreach (DataRow row in table.Rows)
          382  +          {
          383  +            source.Rows.Add(row.ItemArray);
          384  +          }
          385  +          adp.Update(source);
          386  +        }
          387  +      }
          388  +    }
          389  +
          390  +    #endregion
          391  +  }
          392  +}
          393  +

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

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