feat: add SQL/SQLite, AppSec, Capstone incident-tracker, Gitea Actions CI and spaced repetition
Test and Lint / quality (push) Successful in 34s
Test and Lint / quality (push) Successful in 34s
This commit is contained in:
1 parent
0ac80d60d4
commit
9430a194c3
18 files changed
+422
-7
No files matched your search
@@ -0,0 +1,14 @@
|
||||
# 05 — SQL i SQLite (`sqlite3`, parametryzowane zapytania, ochrona przed SQLi)
|
||||
|
||||
Teoria: [notes/06-sql-and-databases.md](../../../notes/06-sql-and-databases.md)
|
||||
|
||||
## Zadania (`sql_sqlite.py`)
|
||||
Zaimplementuj `ServiceRegistry` na wbudowanym `sqlite3`:
|
||||
1. `init_schema()` — utwórz tabelę `services(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT UNIQUE NOT NULL, owner TEXT NOT NULL)`.
|
||||
2. `register(name: str, owner: str) -> int` — wstaw rekord **parametryzowanym zapytaniem** (`?`) i zwróć `lastrowid`.
|
||||
3. `find_by_owner(owner: str) -> list[str]` — zwróć posortowaną listę nazw serwisów danego właściciela (bez podatności na SQL Injection!).
|
||||
|
||||
## Uruchomienie testów
|
||||
```bash
|
||||
make test MOD=03-ecosystems/05-sql-sqlite
|
||||
```
|
||||
Reference in new issue
Block a user