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

Add new auto detection strategy for singular table name #320

Merged

Conversation

suzuki
Copy link
Contributor

@suzuki suzuki commented Oct 18, 2021

About

Add new strategy option "singularTableName" for automatically detect relations.

Motivations

Our projects use the "singular table name" like:

some_table.user_id -> user.id
some_table.post_id -> post.id

We want to detect table relations automatically, so I want to add this new strategy.

Usage

Add strategy to detectVirtualRelations.

detectVirtualRelations:
  enabled: true
  strategy: singularTable

@codecov
Copy link

codecov bot commented Oct 18, 2021

Codecov Report

Merging #320 (779d3dd) into main (70f0e1b) will decrease coverage by 0.13%.
The diff coverage is 46.15%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #320      +/-   ##
==========================================
- Coverage   67.02%   66.88%   -0.14%     
==========================================
  Files          26       26              
  Lines        4318     4331      +13     
==========================================
+ Hits         2894     2897       +3     
- Misses       1132     1140       +8     
- Partials      292      294       +2     
Impacted Files Coverage Δ
config/naming.go 62.16% <46.15%> (-8.68%) ⬇️
datasource/datasource.go 40.14% <0.00%> (-2.12%) ⬇️

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 70f0e1b...779d3dd. Read the comment docs.

@suzuki suzuki marked this pull request as ready for review October 19, 2021 00:06
@k1LoW
Copy link
Owner

k1LoW commented Oct 19, 2021

@suzuki WOW! GREAT!!!!!
Thank you for your wonderful features!

I'll check it out today!

@k1LoW k1LoW added the enhancement New feature or request label Oct 19, 2021
Copy link
Owner

@k1LoW k1LoW left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you!!!

@k1LoW k1LoW merged commit 815c161 into k1LoW:main Oct 19, 2021
@suzuki suzuki deleted the add-auto-detection-strategy-for-singular-table-name branch October 19, 2021 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants