locked
Entity Framework Sample Provider Impelmentation Questions RRS feed

  • Question

  • I've drawn the short straw and got stuck with implementing SQLite's EntityFramework provider so I've been going through the sample and I'm totally stumped as to what the xml resources mean. 
    Specifically I'm stumped by the Types section.  Is this supposed to be the canonical list of all the types supported by the DB and how to map them into .Net framework types? Better yet is there documentation for provider writers I've just managed to miss?
    Thursday, December 13, 2007 11:22 PM

Answers

  • We'll be publishing sample provider updated for Beta3 shortly (there are some changes so Beta2 sample will not work). Stay tuned - there will be an announcement on http://blogs.msdn.com/adonet/ really soon.

     

    To answer your direct question:

     

    <Types> section in provider manifest XML represents a list of types supported by the database and their facet descriptions (such as default values  & allowed ranges for Precision/Scale/MaxLength for each type). In Beta2 there was also a statement about type promotability and implicit/explicit conversions that store allows - in Beta 3 we have removed that. In Beta2 each type also had mapping information (how to convert from store type to conceptual type) declared in the XML, in Beta3 we have made the mapping part API-based. There are more changes between Beta2 and Beta3 and sample provider that will soon be published will explain those changes in more detail.

     

    In any case - we would love to get your feedback from working with the provider interface. If you have any problems or questions that require immedia assistance, feel free to email us. The right people to talk to would be: David Sceppa (david.sceppa -at- microsoft -dot- com) and Jaroslaw Kowalski (jaroslaw.kowalski -at- microsoft -dot- com).

     

     

     

     

    Friday, December 14, 2007 2:47 PM

All replies

  • We'll be publishing sample provider updated for Beta3 shortly (there are some changes so Beta2 sample will not work). Stay tuned - there will be an announcement on http://blogs.msdn.com/adonet/ really soon.

     

    To answer your direct question:

     

    <Types> section in provider manifest XML represents a list of types supported by the database and their facet descriptions (such as default values  & allowed ranges for Precision/Scale/MaxLength for each type). In Beta2 there was also a statement about type promotability and implicit/explicit conversions that store allows - in Beta 3 we have removed that. In Beta2 each type also had mapping information (how to convert from store type to conceptual type) declared in the XML, in Beta3 we have made the mapping part API-based. There are more changes between Beta2 and Beta3 and sample provider that will soon be published will explain those changes in more detail.

     

    In any case - we would love to get your feedback from working with the provider interface. If you have any problems or questions that require immedia assistance, feel free to email us. The right people to talk to would be: David Sceppa (david.sceppa -at- microsoft -dot- com) and Jaroslaw Kowalski (jaroslaw.kowalski -at- microsoft -dot- com).

     

     

     

     

    Friday, December 14, 2007 2:47 PM
  • Cool, thanks man the promotability thing was really confusing me.  Does the PreferedMapping attribute allow me to specify multiple .Net type mappings for DB types and vice versa?  We try to delay our DataType mapping as much as possible due to the fact that in SQLite we dont acutally know the type of data till we read it.  So our IDataRecord implementation has several paths for most type mappings.
    Friday, December 14, 2007 4:51 PM
  • PreferredMapping in Beta3 has been replaced by new 2 methods on new DbProviderManifest class:

     

    GetEdmType(): takes store type + facets and returns corresponding conceptual type + facets

    GetStoreType(): takes conceptual type + facets and returns corresponding store type + facets

     

    Reasoning about promotability,convertibility,etc. (type semantics) has been moved from S(store) space to C(conceptual) space and there is an uniform set of possible conversions/promotions that doesn't change from one provider to another.

     

    I am afraid that delayed datatype mapping as you describe will not be possible, as Entity Framework requires the type of each column to be known in advance (must be supplied in SSDL file). Each primitive type in conceptual schema must be mapped to a compatible (in terms of promotability and facets) store type and EF performs certain validations to make sure that the mapping does not lead to data loss.

    Friday, December 14, 2007 5:01 PM
  • I really dont think that will be a problem if the manifest can be generated programatically.  We fudge stuff to make it look like we have many more store types than we really do anyway.
    Friday, December 14, 2007 9:46 PM
  • FYI:

     

    Sample Entity Framework Provider compatible with Beta3 has just been released. Grab it while it's fresh:

     

    http://blogs.msdn.com/adonet/archive/2007/12/17/sample-ado-net-entity-framework-provider-beta-3.aspx

     

    Tuesday, December 18, 2007 4:57 AM
  • Cool, I grabed it and I think I'm off to a good start.
    Thursday, December 20, 2007 12:56 AM