Allow adding prefix for fields with extends tag #1284

Merged
mskrip merged 2 commits from same-type-extends into master 2019-06-23 02:44:45 +00:00
mskrip commented 2019-04-30 10:22:52 +00:00 (Migrated from github.com)

Added new syntax like extends('Prefix') to enable matching all
extended fields as PrefixFieldName.

Close go-xorm/xorm#1270

Added new syntax like `extends('Prefix')` to enable matching all extended fields as `PrefixFieldName`. Close go-xorm/xorm#1270
codecov-io commented 2019-04-30 10:27:42 +00:00 (Migrated from github.com)

Codecov Report

Merging #1284 into master will increase coverage by 0.06%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1284      +/-   ##
==========================================
+ Coverage   57.37%   57.44%   +0.06%     
==========================================
  Files          44       44              
  Lines        7813     7837      +24     
==========================================
+ Hits         4483     4502      +19     
- Misses       2773     2777       +4     
- Partials      557      558       +1
Impacted Files Coverage Δ
tag.go 79.31% <100%> (+2.21%) ⬆️
engine.go 61.79% <100%> (+0.21%) ⬆️
rows.go 52.38% <0%> (-3.76%) ⬇️
session_exist.go 62.26% <0%> (-0.7%) ⬇️

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 f1b4f83...7842419. Read the comment docs.

# [Codecov](https://codecov.io/gh/go-xorm/xorm/pull/1284?src=pr&el=h1) Report > Merging [#1284](https://codecov.io/gh/go-xorm/xorm/pull/1284?src=pr&el=desc) into [master](https://codecov.io/gh/go-xorm/xorm/commit/f1b4f83684597bbd71ee21462f7f8cd85c9bbf66?src=pr&el=desc) will **increase** coverage by `0.06%`. > The diff coverage is `100%`. [![Impacted file tree graph](https://codecov.io/gh/go-xorm/xorm/pull/1284/graphs/tree.svg?width=650&token=yB5nO1krEe&height=150&src=pr)](https://codecov.io/gh/go-xorm/xorm/pull/1284?src=pr&el=tree) ```diff @@ Coverage Diff @@ ## master #1284 +/- ## ========================================== + Coverage 57.37% 57.44% +0.06% ========================================== Files 44 44 Lines 7813 7837 +24 ========================================== + Hits 4483 4502 +19 - Misses 2773 2777 +4 - Partials 557 558 +1 ``` | [Impacted Files](https://codecov.io/gh/go-xorm/xorm/pull/1284?src=pr&el=tree) | Coverage Δ | | |---|---|---| | [tag.go](https://codecov.io/gh/go-xorm/xorm/pull/1284/diff?src=pr&el=tree#diff-dGFnLmdv) | `79.31% <100%> (+2.21%)` | :arrow_up: | | [engine.go](https://codecov.io/gh/go-xorm/xorm/pull/1284/diff?src=pr&el=tree#diff-ZW5naW5lLmdv) | `61.79% <100%> (+0.21%)` | :arrow_up: | | [rows.go](https://codecov.io/gh/go-xorm/xorm/pull/1284/diff?src=pr&el=tree#diff-cm93cy5nbw==) | `52.38% <0%> (-3.76%)` | :arrow_down: | | [session\_exist.go](https://codecov.io/gh/go-xorm/xorm/pull/1284/diff?src=pr&el=tree#diff-c2Vzc2lvbl9leGlzdC5nbw==) | `62.26% <0%> (-0.7%)` | :arrow_down: | ------ [Continue to review full report at Codecov](https://codecov.io/gh/go-xorm/xorm/pull/1284?src=pr&el=continue). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta) > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/go-xorm/xorm/pull/1284?src=pr&el=footer). Last update [f1b4f83...7842419](https://codecov.io/gh/go-xorm/xorm/pull/1284?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

Join Table Alias Name or prefix of the name, which is better?

SELECT <extends_name>.width, <extends_name>.height

instead of

SELECT <extends_name>width, <extends_name>height
Join Table Alias Name or prefix of the name, which is better? ``` SELECT <extends_name>.width, <extends_name>.height ``` instead of ``` SELECT <extends_name>width, <extends_name>height ```
mskrip commented 2019-05-01 17:17:20 +00:00 (Migrated from github.com)

IMO having just prefix is better here since it refers to what the column name of the query result should be changed to, it doesn't have to have anything in common with the table (the prefix I mean).

IMO having just prefix is better here since it refers to what the column name of the query result should be changed to, it doesn't have to have anything in common with the table (the prefix I mean).
mskrip commented 2019-05-14 08:19:08 +00:00 (Migrated from github.com)

Sorry to bother you, but would I be able to get an ETA on this review? This is kind of a blocking change for me.

Sorry to bother you, but would I be able to get an ETA on this review? This is kind of a blocking change for me.

How to handle SizeClosed *Size xorm:"extends('')"` ?

How to handle `SizeClosed *Size `xorm:"extends('')"` ?
mskrip commented 2019-05-16 11:31:58 +00:00 (Migrated from github.com)

Maybe as if there was no argument? So the same as just xorm:"extends" ?

Maybe as if there was no argument? So the same as just `xorm:"extends"` ?

@mskrip I think it's reasonable.

@mskrip I think it's reasonable.
mskrip commented 2019-05-21 09:19:55 +00:00 (Migrated from github.com)

@lunny Added test for that case

@lunny Added test for that case
mskrip commented 2019-06-11 09:07:06 +00:00 (Migrated from github.com)

@lunny ping

@lunny ping

@mskrip will do last review tomorrow morning.

@mskrip will do last review tomorrow morning.
mskrip commented 2019-06-21 08:47:28 +00:00 (Migrated from github.com)

@lunny Okay, thank you

@lunny Okay, thank you

@mskrip Thanks!

@mskrip Thanks!
Sign in to join this conversation.
No description provided.