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

[ISSUE #3088]Standardize sql statement format in xml file #3092

Merged
merged 2 commits into from Mar 23, 2022

Conversation

totalo
Copy link
Member

@totalo totalo commented Mar 22, 2022

For #3088.

Make sure that:

  • You have read the contribution guidelines.
  • You submit test cases (unit or integration tests) that back your changes.
  • Your local test passed mvn clean install -Dmaven.javadoc.skip=true.

<include refid="Base_Column_List"/>
from rule
where id = #{id,jdbcType=VARCHAR}
FROM rule
Copy link
Contributor

Choose a reason for hiding this comment

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

The keyword FROM is not right-aligned.

<include refid="Base_Column_List"/>
from rule
where name = #{name,jdbcType=VARCHAR}
FROM rule
Copy link
Contributor

Choose a reason for hiding this comment

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

The keyword FROM is not right-aligned.

FROM rule
WHERE 1=1
AND name = #{name,jdbcType=VARCHAR}
AND selector_id = #{selectorId,jdbcType=VARCHAR}
Copy link
Contributor

Choose a reason for hiding this comment

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

The keywords are not right-aligned.

</select>

<select id="selectByQuery" parameterType="org.apache.shenyu.admin.model.query.RuleQuery" resultMap="BaseResultMap">
select
SELECT
Copy link
Contributor

Choose a reason for hiding this comment

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

SELECT should be back a space to keep right-aligned

@@ -81,63 +81,62 @@
</select>

<select id="findBySelectorId" parameterType="java.lang.String" resultMap="BaseResultMap">
select
SELECT
Copy link
Contributor

Choose a reason for hiding this comment

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

SELECT should be back a space to keep right-aligned

</select>

<select id="findBySelectorIds" parameterType="java.util.List" resultMap="BaseResultMap">
select
SELECT
Copy link
Contributor

Choose a reason for hiding this comment

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

SELECT should be back a space to keep right-aligned

<foreach item="selectId" collection="list" open="(" separator="," close=")">
#{selectId, jdbcType=VARCHAR}
</foreach>
</select>

<select id="countByQuery" parameterType="org.apache.shenyu.admin.model.query.RuleQuery"
resultType="java.lang.Integer">
select count(1)
from rule
SELECT count(1)
Copy link
Contributor

Choose a reason for hiding this comment

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

SELECT should be back a space to keep right-aligned

</select>

<select id="selectAll" resultType="org.apache.shenyu.admin.model.entity.RuleDO" resultMap="BaseResultMap">
select
SELECT
Copy link
Contributor

Choose a reason for hiding this comment

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

SELECT should be back a space to keep right-aligned

</select>

<select id="existed" resultType="java.lang.Boolean">
select true from rule where id = #{id} limit 1
SELECT true FROM rule WHERE id = #{id} limit 1
Copy link
Contributor

Choose a reason for hiding this comment

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

The keywords are right-aligned and the fields are left-aligned and displayed in multiple lines.

</select>

<insert id="insert" parameterType="org.apache.shenyu.admin.model.entity.RuleDO">
insert into rule (id, date_created, date_updated,
INSERT INTO rule (id, date_created, date_updated,
Copy link
Contributor

Choose a reason for hiding this comment

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

The keywords are right-aligned and the fields are left-aligned and displayed in multiple lines.

update rule
set date_created = #{dateCreated,jdbcType=TIMESTAMP},
UPDATE rule
SET date_created = #{dateCreated,jdbcType=TIMESTAMP},
Copy link
Contributor

Choose a reason for hiding this comment

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

The keywords are right-aligned and the fields are left-aligned and displayed in multiple lines.

delete from rule
where id = #{id,jdbcType=VARCHAR}
DELETE FROM rule
WHERE id = #{id,jdbcType=VARCHAR}
Copy link
Contributor

Choose a reason for hiding this comment

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

WHERE should be right-aligned with FROM.

</delete>

<delete id="deleteByIds" parameterType="java.util.List">
delete from rule
where id in
DELETE FROM rule
Copy link
Contributor

Choose a reason for hiding this comment

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

WHERE should be right-aligned with FROM.

@codecov-commenter
Copy link

codecov-commenter commented Mar 23, 2022

Codecov Report

Merging #3092 (4dda708) into master (4c4ec0b) will increase coverage by 0.11%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##             master    #3092      +/-   ##
============================================
+ Coverage     58.93%   59.04%   +0.11%     
- Complexity     4394     4406      +12     
============================================
  Files           694      694              
  Lines         19934    19934              
  Branches       1800     1800              
============================================
+ Hits          11748    11771      +23     
+ Misses         7184     7163      -21     
+ Partials       1002     1000       -2     
Impacted Files Coverage Δ
...che/shenyu/sync/data/http/HttpSyncDataService.java 80.48% <0.00%> (+3.25%) ⬆️
.../plugin/grpc/loadbalance/AbstractLoadBalancer.java 78.26% <0.00%> (+7.60%) ⬆️
...henyu/plugin/grpc/resolver/ShenyuNameResolver.java 72.34% <0.00%> (+8.51%) ⬆️
...yu/sync/data/http/refresh/AbstractDataRefresh.java 83.33% <0.00%> (+13.33%) ⬆️

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 4c4ec0b...4dda708. Read the comment docs.

@midnight2104 midnight2104 merged commit f61cbb9 into apache:master Mar 23, 2022
@totalo totalo deleted the 3088 branch March 23, 2022 05:06
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.

None yet

3 participants