-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
enhance: add Save
operation support for pgsql #3053
#3324
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oldme-git
force-pushed
the
enhance/#3053
branch
from
February 25, 2024 12:23
ffe280d
to
44b60cf
Compare
oldme-git
force-pushed
the
enhance/#3053
branch
from
February 25, 2024 14:14
0d64a19
to
c090ba2
Compare
gqcn
requested changes
Feb 27, 2024
gqcn
requested changes
Feb 29, 2024
gqcn
approved these changes
Mar 4, 2024
gqcn
changed the title
enhance #3053
enhance: add Mar 4, 2024
Save
operation support for pgsql #3053
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
resolved #3053
Dear reviewer:
增加对 PgSQL 的
gbd.save
支持,使用ON CONFLICT
子句实现变更的方法
type DB interface
新增DoFormatUpsert
它用作替代原有
formatOnDuplicate
写死的方法,用以格式化处理不同数据库 upsert 的实现,它可以被 driver 覆盖。 比如 mysql 处理成ON DUPLICATE KEY UPDATE ...
, PgSQL 格式化成ON CONFLICT ...
公开
gdb.core
的isSoftCreatedFieldName
它用作
save
更新时忽略created_at
,以便提供给DoFormatUpsert
使用gbd.Model
新增OnConflict
链式方法部分数据库
upsert
时可能需要指定冲突键,PgSQL 中使用ON CONFLICT(id)
备注
合并后, 需要更新文档。