Configurable illegal constructs
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
Direzione di ricerca
Inizia leggendo ASTMapping.fs per comprendere i pattern di visitor SQL esistenti, quindi esamina la documentazione sulla configurazione di rzsql.json. Definisci l'ambito della configurazione del linter per i costrutti elencati, inclusi i confronti con NULL e le clausole WHERE mancanti. Il lavoro è completato quando il progetto può selezionare i costrutti consentiti e vietati e segnalare le violazioni configurate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Motivation
There are some constructs that are legal SQL but are almost certainly mistakes if found in a static, handwritten query.
The primary examples that come to mind are:
NULL comparison is always false.
select * from Foo where Bar = null
-- `expr = null` is always false, should probably be `Bar IS null`
UPDATE/DELETE without WHERE clause is usually a mistake
update User set Email = @newEmail
-- uhhh... you probably forgot to put `where Id = @userId`
Idea
RZSQL should have some "linters" that implement a visitor for SQL statements and expressions (like ASTMapping.fs but without any output). There should be a separate linter class for each type of bogus construct we can think of.
In rzsql.json there could be an option like so, to determine which linters will run on the SQL statements in the project.
"constructs": {
"allowed": ["MissingWhereClause"],
"banned": ["NullComparison", "UnsafeInjectRawSQL"]
}
This would let you override the linters enabled/disabled. Having both a whitelist and blacklist would let us pick a reasonable set of default linters that wouldn't be overly strict or overly lenient.
Linters would be named after the construct they throw an error upon recognizing. This way the constructs configuration setting reads like a list of what kinds of SQL are allowed and banned in your project. The goal here is to avoid the double-negative confusion that would result from something like the below, where we are effectively saying "we DON'T want the linter that checks for NOT having a where clause, because we DO want those statements in our SQL code".
"linters": {
"blacklist": ["NoMissingWhereClause"],
"whitelist": ["NullComparisonAlwaysFalse", "NoUnsafeInjectRawSQL"]
}
- Lingua principale
- F#
- Stelle
- 680
- Fork
- 23
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di fsprojects/Rezoom.SQL
-
fsprojects onboarding Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 20/100
fsprojects/Rezoom.SQL#57 · 1 commento ·
-
Dacpac support info Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
fsprojects/Rezoom.SQL#56 · 1 commento ·
-
Create / Drop Schema support Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
fsprojects/Rezoom.SQL#52 · 1 commento ·
-
Support for Geography types Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
fsprojects/Rezoom.SQL#50 ·
-
Data type/column type: array Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
fsprojects/Rezoom.SQL#48 · 3 commenti ·
Tutte le issue di fsprojects/Rezoom.SQL
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
bradcypert/plum#58 ·
-
flang:fir-hlfir
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
llvm/llvm-project#225935 ·
-
Hand Tail: Brass Herald Apertaarea:cards hand-tail ready-for-agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
fil-donadoni/tolaria#4446 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
objectionary/eo#8923 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100