System.Data.SQLite
Artifact Content
Not logged in

Artifact 73dcde9ddfa14aa91a19f869cb2710fe6b8f56b1:


<?xml version="1.0" encoding="utf-8"?>
<xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:edm="http://schemas.microsoft.com/ado/2006/04/edm/ssdl"
           xmlns:gen="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" 
           targetNamespace="http://schemas.microsoft.com/ado/2006/04/edm/ssdl">
    <xs:annotation>
        <xs:documentation xml:lang="en">
            Common Data Model Schema Definition Language.
            Copyright (c) Microsoft Corp. All rights reserved.
        </xs:documentation>
    </xs:annotation>
  <xs:import namespace="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" schemaLocation="System.Data.Resources.EntityStoreSchemaGenerator.xsd" />
  <xs:element name="Schema" type="edm:TSchema"/>
    <xs:complexType name="TSchema">
        <xs:sequence>
            <xs:group ref="edm:GSchemaBodyElements" minOccurs="0" maxOccurs="unbounded"/>
            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
        </xs:sequence>
        <xs:attribute name="Namespace" type="edm:TQualifiedName" use="required" />
        <xs:attribute name="Alias" type="edm:TSimpleIdentifier" use="optional" />
        <xs:attribute name="Provider" type="edm:TSimpleIdentifier" use="required" />
        <xs:attribute name="ProviderManifestToken" type="edm:TSimpleIdentifier" use="required" />      
        <xs:anyAttribute namespace="##other" processContents="lax" />
    </xs:complexType>

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    </xs:attributeGroup>

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

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

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

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

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

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

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

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

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

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

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

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

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


</xs:schema>