Server-side column values not retrieved when record inserted or updated

未关闭
#620 2 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
fsharp, sql
领域
database

调研方向

首先定位 SQLProvider 中用于 MS SQL Server INSERT 和 UPDATE 操作的 SQL 生成和实体保存入口。检查现有的 INSERT OUTPUT 处理,然后确定在这两种操作中应如何返回 identity、timestamp、computed 和 default 等服务器端值;完成的标准是,在创建和更新后无需重新查询即可获得这些值。

由索引模型根据 Issue 内容生成。

描述

enhancement
Description

(MS SQL SERVER) I have many tables with TIMESTAMP columns, computed columns, columns with default values. Most of the tables have auto-incremented (identity) primary key.

I expect that entity will contain those values after record is created or updated.

When I save (create or update) the entity it doesn't query values of such columns.

Expected behavior

All server-side values retrieved on INSERT and UPDATE, not just auto-increment primary key on INSERT. Should be easy to implement using "INSERT ... OUTPUT" or "UPDATE ... OUTPUT" synthax

Actual behavior

At the moment SQLProvider updates only auto-incremented primary key for new entities (generated SQL is "INSERT ... OUTPUT ..." )

Known workarounds
  • re-query entity after it is inserted or updated (ugly)
  • create a stored proc instead
Related information
  • Used database: MS SQL Server (14.0.2014.4)
  • Operating system: Windows 10
  • .NET Core 2.1
主要语言
F#
星标
627
派生
147
平均合并
2 小时 2 分钟
30 天内合并 PR
1

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

fsprojects/SQLProvider 的其他 Issue

查看 fsprojects/SQLProvider 的全部 Issue

相似的 Issue

更多 Databases Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。