Git Product home page Git Product logo

Comments (2)

smoothdeveloper avatar smoothdeveloper commented on August 15, 2024 1

@MrGodlike6 thanks for the extensive bug report.

What I remember on top of my head is that SqlEnumProvider relies on some ADO.NET APIs that the two other type providers are not relying on:

member internal this.CreateRootType( typeName, query, connectionStringOrName, provider, configFile, kind: SqlEnumKind) =
let tempAssembly = ProvidedAssembly()
let providedEnumType = ProvidedTypeDefinition(tempAssembly, nameSpace, typeName, baseType = Some typeof<obj>, hideObjectMethods = true, isErased = false)
let connStr, providerName =
match DesignTimeConnectionString.Parse(connectionStringOrName, config.ResolutionFolder, configFile) with
| Literal value -> value, provider
| NameInConfig(_, value, provider) -> value, provider
#if !USE_SYSTEM_DATA_COMMON_DBPROVIDERFACTORIES
// not supported on netstandard 20?
raise ("DbProviderFactories not available" |> NotImplementedException)
#else
let adoObjectsFactory = DbProviderFactories.GetFactory( providerName: string)
use conn = adoObjectsFactory.CreateConnection()
conn.ConnectionString <- connStr
conn.Open()

It seems you are running under .net 5, but I'm not sure if it loads the provider which is compiled with USE_SYSTEM_DATA_COMMON_DBPROVIDERFACTORIES or not, which has impact on the code above.

Another thing is that SqlEnumProvider is the only one being a generative type provider (rather than erased one) and I'm not sure if it has impact on the usage of this library under .net 5 runtime.

I don't have time to investigate right now, but one thing to test would be if the code surounding db provider factories works properly outside the context of a type provider, and of course, running through the issue with debugger attached to the editor instanciating/running the provider.

Thanks again for the report and all the references.

from fsharp.data.sqlclient.

xperiandri avatar xperiandri commented on August 15, 2024

Looks like the provider must be compiled for the latest .NET in order to make this work
As .NET 6 has it https://docs.microsoft.com/en-us/dotnet/api/system.data.common.dbproviderfactories?view=net-6.0

from fsharp.data.sqlclient.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.