Giter Site home page Giter Site logo

Comments (10)

rojepp avatar rojepp commented on August 23, 2024

I've been experimenting with converting to set fmtonly on and it seems hard to get this to work without knowing the types of the parameters. I get all sorts of errors. Maybe this isn't possible after all... I'll think about it some more.

from fsharp.data.sqlclient.

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

I got the same impression trying combination of general ADO.NET schema collections and ExecuteReader with CommandBehaviour.SchemaOnly.

from fsharp.data.sqlclient.

rojepp avatar rojepp commented on August 23, 2024

It is not an easy problem. The possible types that would satisfy running the query with SchemaOnly are few, however. Seeing as it is only compile time, maybe it would be possible to try some known variants before failing out?

Think about a query like this:

select top (@top) 
from tbl t
where t.ColName = @param

Given that we know the name of each param, but not the type, We could try sending int for @top, parse the error, then try '', parse the error again. If the error now says @param is wrong, then do the same for that. 0 works for numerics, '' works for strings, dates. With those two, most types are covered. We can add more as we see the need.

It would be awesome to remove the temp table restriction..

from fsharp.data.sqlclient.

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

I'm afraid that we'll end up writing some sort of SQL parser. I would rather provide solution that works well under certain limitations that something that "kinda works" but has wider applicability. Anyway, I'll keep thinking about it. We can save it version or 1.5 or 2.0.

from fsharp.data.sqlclient.

dsevastianov avatar dsevastianov commented on August 23, 2024

I agree with @dmitry-a-morozov, writing sql parser is way over our original intent.

from fsharp.data.sqlclient.

rojepp avatar rojepp commented on August 23, 2024

I'm on the same page. I agree to keep it open though.
On Oct 27, 2013 11:49 PM, "dsevastianov" [email protected] wrote:

I agree with @dmitry-a-morozov https://github.com/dmitry-a-morozov,
writing sql parser is way over our original intent.


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

from fsharp.data.sqlclient.

rojepp avatar rojepp commented on August 23, 2024

This can be closed?

from fsharp.data.sqlclient.

dsevastianov avatar dsevastianov commented on August 23, 2024

I'd like to play with this first, right now minimal version is 12. We should have partial supporting I think.

from fsharp.data.sqlclient.

rojepp avatar rojepp commented on August 23, 2024

My guess is that Sql 2014 will have better support, and the importance of this will diminish in time.
Attempting this might prove to be sisyfosian. :)

from fsharp.data.sqlclient.

dsevastianov avatar dsevastianov commented on August 23, 2024

I guess you're right, closing

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.