Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SqlFile type provider #232

Closed
dmitry-a-morozov opened this issue Jul 11, 2016 · 1 comment
Closed

SqlFile type provider #232

dmitry-a-morozov opened this issue Jul 11, 2016 · 1 comment
Assignees

Comments

@dmitry-a-morozov
Copy link
Member

dmitry-a-morozov commented Jul 11, 2016

Description

There are numerous issues associated with built-in ability to pass *.sql file name as command text to SqlCommandProvider and SqlProgrammabilityProvider.CreateCommand
See
#163
#123

I propose to introduce dedicated SqlFile generative type provider that will return content of sql file as literal string. It is related to fsprojects/FSharp.Management#71 but there are benefits having our own version of it for several reasons:

  • It has't not been implemented in FSharp.Management lib yet
  • We have a reason (see below) to implement it as generative not erased. On other side erased implementation probably makes more sense for FSharp.Management
  • extra dependency might not be justifiable in this case

Expected behavior

type MyQuery = SqlFile<"myfile.sql">
do
    use cmd = SqlCommandProvider<MyQuery.Text, "Server=.;Database=AdventureWorks2012;Trusted_Connection=yes">
    cmd.Execute ...
    ...

Related information

@smoothdeveloper
Copy link
Collaborator

👍

Can we close this, this is implemented in recent versions and is working great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants