Calling stored procedure with arguments with default values. Wrong types generated in ORM

Open
#663 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
fsharp, sql
Domain
database

Research direction

Reproduce the issue with the SQL Server create_config procedure shown in the report and inspect the generated F# function's parameter types. Compare parameters whose database defaults are NULL with the generated types, then verify that nullable procedure arguments are represented correctly for procedures with multiple default arguments.

Written by the indexing model from the issue text.

Description

enhancement
Description

If the SQL procedure has the input argument with default NULL value like f.e.

create procedure [dbo].[create_config]
   @CreateDate datetime = NULL,
   @UpdateDate datetime = NULL,
   @DeleteDate datetime = NULL,
   @Parm1 int = NULL
   ...
as
   …

then the SQLProvider creates the function for calling this procedure, but the type of the CreateDate is DateTime (ie not the Option or Nullable).
I have a lot of stored procedures with lots of default arguments. How to get the correct parameter type in the fsharp function?

Related information
  • Used database MS SQL server
  • Operating system WIndows 10
  • Branch
  • .NET FW 4.7.2
Dominant language
F#
Stars
627
Forks
147
Avg merge
2h 2m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fsprojects/SQLProvider

All issues in fsprojects/SQLProvider

Similar issues

More Databases issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.