fsprojects / fsprojects/FSharp.Data.SqlClient

Is it possible to turn off concurrency violation checking?

Open
#311 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description

Using the SQL Programmability Provider, I'm trying to use it for updates to existing rows. I only have a subset of columns in the table that need updating, and don't need to load in data first. The way I'm doing it currently is:

  1. Create a new data row with blank values.
  2. Call AcceptChanges()
  3. Modify the appropriate fields with the values to update.
  4. Call Update().

The issue is that the generated SQL also adds in where clauses to ensure that all the other values are the same as before, which obviously doesn't work since it expects all values to be blank. Is it possible to turn this check off for the dynamically generated SQL? The only other alternatives that I can see are:

  1. Load in the data before performing the update - not needed in my scenario and will greatly increase the number of SQL calls.
  2. Switch to hand-crafted update statements, either using a custom data adapter or using the SQL Command Provider.

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 the SQL Programmability Provider's generated SQL from the DataRow Update() path, focusing on how AcceptChanges() and original column values become WHERE clauses. Compare this with the SQL Command Provider behavior and determine where an opt-out could be exposed. Done means the provider supports updates without requiring unchanged values for every column, with coverage for the described partial-row scenario.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.