Skip to content
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

修复 Mysql 教程 update 失败的问题 #2165

Merged
merged 2 commits into from
Mar 26, 2018
Merged

修复 Mysql 教程 update 失败的问题 #2165

merged 2 commits into from
Mar 26, 2018

Conversation

OnedayLiu
Copy link
Contributor

Checklist
  • npm test passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)
Description of change

update 方法,如果自定义主键名称不是 id,以下写法会报错:

const row = {
  custom_id: 123,
  name: 'xx'
};
const result = await this.app.mysql.update('posts', row); 

image

@OnedayLiu OnedayLiu requested a review from dead-horse March 5, 2018 11:19
@OnedayLiu
Copy link
Contributor Author

ping @dead-horse

@codecov
Copy link

codecov bot commented Mar 5, 2018

Codecov Report

Merging #2165 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2165   +/-   ##
=======================================
  Coverage   99.59%   99.59%           
=======================================
  Files          29       29           
  Lines         749      749           
=======================================
  Hits          746      746           
  Misses          3        3

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0eabce6...a36e227. Read the comment docs.

@popomore popomore merged commit a86334c into master Mar 26, 2018
@popomore popomore deleted the mysql-fix branch March 26, 2018 03:19
popomore pushed a commit that referenced this pull request Mar 26, 2018
docs: example for custom id when mysql update (#2165)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants