Giter Site home page Giter Site logo

Comments (29)

dsevastianov avatar dsevastianov commented on August 23, 2024

Nuget package now depends on server types package, are you sure it was installed?

from fsharp.data.sqlclient.

rojepp avatar rojepp commented on August 23, 2024

The same project works on Windows without modification. In the error message, it says it is trying to load the type from System.Data. This type is probably not implemented in mono. What is it used for, and it is important enough to break mono compat?

from fsharp.data.sqlclient.

dsevastianov avatar dsevastianov commented on August 23, 2024

I don't see anything about System.Data in the error message though. This reference is for Spatial types. Also, see issue #46, Don thinks it's must have.

It comes with unmanaged dll which you probably have available in Windows. Can you please have a look at Readme in their nuget, maybe it's still possible to have this feature on Mono.

from fsharp.data.sqlclient.

rojepp avatar rojepp commented on August 23, 2024

From the first two comments in that link, it seems that Spatial types can not be used on mono.

I've never used spatial types, however breaking mono compat kills this library for me. Can we find some way to enable both?

from fsharp.data.sqlclient.

dsevastianov avatar dsevastianov commented on August 23, 2024

I'll look into this.

from fsharp.data.sqlclient.

dsevastianov avatar dsevastianov commented on August 23, 2024

@rojepp I am trying to do mono test using Valiant as described here. Right now I'm stuck with XBuild apparently not recognizing VS 2013 F# projects properly. I was wondering if you have any kind of test project I could use for these purposes.

from fsharp.data.sqlclient.

rojepp avatar rojepp commented on August 23, 2024

I made one quickly: https://github.com/rojepp/sqlclientmonosample
Given a valid database, this fails to compile on mono with
/Users/robert/Projects/sampleapp/sampleapp/Program.fs(12,12): Error FS3033: The type provider 'FSharp.Data.SqlCommandProvider' reported an error: Could not load type 'Microsoft.SqlServer.Server.SqlDataRecord' from assembly 'System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. (FS3033) (sampleapp)

Note the extra stuff brought in by dependencies in the folder SqlServerTypes. Contains Windows interop code that naturally won't work on mono.

from fsharp.data.sqlclient.

dsevastianov avatar dsevastianov commented on August 23, 2024

Awesome, thanks, I'll look into building mono version without sqltypes support. What puzzles me is that apparently Entity Framework on mono supports it just fine.

from fsharp.data.sqlclient.

dsevastianov avatar dsevastianov commented on August 23, 2024

Hi @rojepp, setting up testing environment turned out to be a real headache. Any chance you could help us with this? I believe we could have mono-specific build target for both providers and just load SqlServer.Types assembly conditionally:

from fsharp.data.sqlclient.

rojepp avatar rojepp commented on August 23, 2024

I'm not sure how to help. SqlDataRecord seems hard to conditionally build?

from fsharp.data.sqlclient.

dsevastianov avatar dsevastianov commented on August 23, 2024

SqlDataRecord comes from another libary, System.Data.
I believe none of the types declared in Microsoft.SqlServer.Types is used directly in TP code, so ideal solution would be to load it dynamically if it's available.

from fsharp.data.sqlclient.

rojepp avatar rojepp commented on August 23, 2024

I see. SqlDataRecord gives a compilation error on mono, it seems it is not ported:
http://www.go-mono.com/momareports/apis/System.Void%20Microsoft.SqlServer.Server.SqlDataRecord;;.ctor(Microsoft.SqlServer.Server.SqlMetaData[])

from fsharp.data.sqlclient.

rojepp avatar rojepp commented on August 23, 2024

Maybe spatial types do not cause the issue, unless they are used. SqlDataRecord is even mentioned in the exception above. :)
Microsoft.SqlServer.Types should already only load if needed.

from fsharp.data.sqlclient.

dsevastianov avatar dsevastianov commented on August 23, 2024

Oh, it's much bigger problem then. Let's keep this issue open for later, I don't see any simple solution for it right now. Thank you for looking into this though.

from fsharp.data.sqlclient.

rojepp avatar rojepp commented on August 23, 2024

Why did you start using SqlDataRecord? What benefits does it give?

On Wed, Mar 19, 2014 at 9:26 PM, dsevastianov [email protected]:

Oh, it's much bigger problem then. Let's keep this issue open for later, I
don't see any simple solution for it right now. Thank you for looking into
this though.

Reply to this email directly or view it on GitHubhttps://github.com//issues/49#issuecomment-38102407
.

from fsharp.data.sqlclient.

dmitry-a-morozov avatar dmitry-a-morozov commented on August 23, 2024

In initial implementation of UDTT support that you provided (which is helped us a lot) seq of tuples was used as type of parameter. Later I realized that tuples lack of intellisense for column names of UDDT and switched to seq of custom type with ctor. Parameters names for the ctor provide reasonable intellisense help. SqlDataRecord was obvious choice of "erased to" type for this custom type.
https://github.com/fsprojects/FSharp.Data.SqlClient/blob/master/src/SqlClient/SqlCommandProvider.fs#L228
Also, as side-effect of this re-factoring intermediate DataTable was not necessary.
Let me know if I expressed it clearly.

from fsharp.data.sqlclient.

rojepp avatar rojepp commented on August 23, 2024

I think I get what you're saying. Using SqlDataRecord was convenient, and
now it turns out that using it means losing mono compatibility. So, what
now?
It doesn't seem to me that SqlDataRecord is all that necessary?

from fsharp.data.sqlclient.

dmitry-a-morozov avatar dmitry-a-morozov commented on August 23, 2024

I was not aware about Mono incompatibility. Let me think some time of what can be done.
I'm also curious, the change was made long time ago. How come you noticed just now?

from fsharp.data.sqlclient.

rojepp avatar rojepp commented on August 23, 2024

I haven't updated my old project that use the TP. I just had to code up a
new simple sql-centric app, so I tried the recent version.

from fsharp.data.sqlclient.

dsevastianov avatar dsevastianov commented on August 23, 2024

Hey @rojepp, I installed Xamarin 4.2.3 on my windows box and I was able to build and run the project just fine, which is weird.

I tried to do the same from ubuntu vagrant box but the problem is that I don't have full version of Sql Server available right now, and I can't target Sql Express on host machine.

@dmitry-a-morozov may have a chance to look into it in enterprise environment later.

Sorry we can't be more help for now.

from fsharp.data.sqlclient.

rojepp avatar rojepp commented on August 23, 2024

I think on a Windows box, Xamarin defaults to using .Net instead of mono. You should be able to switch target on the project to see the problem.

from fsharp.data.sqlclient.

dsevastianov avatar dsevastianov commented on August 23, 2024

Right, I forgot to mention I was targeting Mono/Net 4. Anyway, it doesn't look like problem is reproducible on Windows, @dmitry-a-morozov will try it on Mac later this week.

from fsharp.data.sqlclient.

dmitry-a-morozov avatar dmitry-a-morozov commented on August 23, 2024

@rojepp I hope I made your day ! :)

from fsharp.data.sqlclient.

rojepp avatar rojepp commented on August 23, 2024

Nice, will try it out!

from fsharp.data.sqlclient.

rojepp avatar rojepp commented on August 23, 2024

Sorry, it doesn't work on OSX. This is with Xamarin Studio 5.
The same project compiles on Windows. v1.2.17
screenshot 2014-05-02 15 49 42

from fsharp.data.sqlclient.

dmitry-a-morozov avatar dmitry-a-morozov commented on August 23, 2024

@rojepp I hope you're prepared to send me flowers or chocolate :). Mono on Mac is missing property called "TypeName" which is a key to implement TVP properly. The best workaround I was able to find is to call it only for TVP parameters via reflection so it won't break in Xamarin on mac. Therefore TVP on Mac is not supported. Other kind of parameters seems to work fine.

from fsharp.data.sqlclient.

rojepp avatar rojepp commented on August 23, 2024

Thanks!

from fsharp.data.sqlclient.

jackfoxy avatar jackfoxy commented on August 23, 2024

What is TVP?

from fsharp.data.sqlclient.

dsevastianov avatar dsevastianov commented on August 23, 2024

Table valued parameters

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.