rspec/rules/S1492/rule.adoc

32 lines
549 B
Plaintext
Raw Normal View History

2020-06-30 12:47:33 +02:00
include::description.adoc[]
include::ask-yourself.adoc[]
include::recommended.adoc[]
== Sensitive Code Example
2020-06-30 12:47:33 +02:00
----
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.
----
2020-06-30 12:47:33 +02:00