fsprojects / fsprojects/FSharp.Data.SqlClient

enable natural setters on data tables

Open
#378 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

improvement
Dominant language
F#
Stars
206
Forks
66
PR merge metrics
No merged PRs in 30d

Description

DataTable types coming from SqlCommandProvider don't have natural setters for the column accessor.

The work around is kind of unatural / unwieldy:

type MyCommand = SqlCommandProvider< myConnection, myQuery, ResultType = ResultType.DataTable >

let table = MyCommand.Table()
let row = table.Rows.NewRow()
table.Columns.column1.SetValue(row, "my value")

proposed:

type MyCommand = SqlCommandProvider< myConnection, myQuery, ResultType = ResultType.DataTable >

let table = MyCommand.Table()
let row = table.Rows.NewRow()
row.column1 <- "my value"

related: #215, #221

If anyone is opposing this change, please let me know.

Contributor guide

Open the contributing guide

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.

Research direction

Start by tracing how SqlCommandProvider generates DataTable result types and review related issues #215 and #221. The work is done when generated rows expose natural writable column properties such as row.column1 <- "my value" instead of requiring table.Columns.column1.SetValue.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.