rspec/rules/S1492/rule.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

32 lines
549 B
Plaintext

include::description.adoc[]
include::ask-yourself.adoc[]
include::recommended.adoc[]
== Sensitive Code Example
----
SELECT * FROM db_persons INTO us_persons.
----
== Compliant Solution
[source,text]
----
SELECT * FROM db_persons INTO us_persons WHERE country IS 'US'.
----
== Exceptions
``++SELECT SINGLE++`` and ``++UP TO 1 ROWS++`` result in only one record being read, so such ``++SELECT++``s are ignored by this rule.
----
SELECT SINGLE * FROM db_persons INTO us_persons.
SELECT * FROM db_persons UP TO 1 ROWS INTO us_persons.
----