Giter Site home page Giter Site logo

Comments (9)

dsevastianov avatar dsevastianov commented on August 23, 2024

SPs are loaded lazily, so it won't help performance. As for the Stored Procedures, we are trying to mimic SSMS experience for the user, but maybe you're right, it's not necessarily very useful.

from fsharp.data.sqlclient.

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

@vasily-kirichenko I think we'll keep Stored Procedures for now mostly because there is value in using widely accepted terms. You alleviate the issue by using local alias:

let procedures = myDb.``Stored Procedures``.
procedures.``dbo.MyProc``.AsyncExecute()

We'll work on performance/responsiveness improvements.

Question: would you mind if we'll remove SP support from SqlCommandProvider? I mean we'll remove CommandType parameter. So stored procedures can be called only via EXEC.

Also, what do you think about packaging? Should both type providers be in one project/nuget package? Or separate ones?

from fsharp.data.sqlclient.

vasily-kirichenko avatar vasily-kirichenko commented on August 23, 2024

I agree with removing CommandType parameter from SqlCommand TP.

What about packaging, I think it's ok to put both the TPs into a single package, since it's quite common to use some ad-hoc queries along with SPs (at least in my daily job).

Parameters/result type inference in SqlProgrammability is awesome (so far). However, it's uncovered another problem - it's very easy to get lost in big tuples, where we don't have result column names, like this:

sp.AsyncExecute(@LastDayCount: int, @MD5: byte []) : Async<Collections.Generic.IEnumerable<string * DateTime * bool * Option<string> * Option<string> * string * Option<DateTime> * Option<string> * Option<int> * int * Option<byte> * byte>>

As a result, I have to go to the Sql Server Management Studio to consult what all this mean. Is it possible to return records instead?

from fsharp.data.sqlclient.

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

@vasily-kirichenko You can use ResultType.Records instead of default ResultType.Tuples.

from fsharp.data.sqlclient.

dsevastianov avatar dsevastianov commented on August 23, 2024

How about switching default to Records?

from fsharp.data.sqlclient.

vasily-kirichenko avatar vasily-kirichenko commented on August 23, 2024

With ResultType=ResultType.Records the TP is fantastic! :) It inferences literally everything. Cool.

I agree with switching to Records as default result type, great idea.

from fsharp.data.sqlclient.

vasily-kirichenko avatar vasily-kirichenko commented on August 23, 2024

However, I think it's better to generate string option for all string parameters (varchar, nvarchar, text...) instead of string. Here we have inconsistence between strings and all other types, i.e.:

DB int <=> int option
DB tinyint <=> byte option

but

DB nvarchar <=> string

from fsharp.data.sqlclient.

dsevastianov avatar dsevastianov commented on August 23, 2024

I'm not sure about that. string is reference type, not struct. I think this behavior is well-aligned with what is commonly expected.

from fsharp.data.sqlclient.

dsevastianov avatar dsevastianov commented on August 23, 2024

Default result type for SqlProgrammability switched to Records

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.