Skip to content

Commit 49e7ed2

Browse files
committed
refactored
1 parent 5b3bcb6 commit 49e7ed2

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

β€ŽREADME.mdβ€Ž

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,19 @@ cp .env.example .env
4848
# Edit `.env` to configure database connection and app settings
4949

5050
# Run database migrations
51-
alembic upgrade head
51+
alembic upgrade head
5252

5353
# Start the development server
5454
uvicorn app.main:app --reload
55+
```
56+
57+
### 🧭 Project Structure
58+
```text
59+
app/
60+
β”œβ”€β”€ api/ # Route declarations
61+
β”œβ”€β”€ core/ # Settings and application config
62+
β”œβ”€β”€ db/ # Database models, sessions, migrations
63+
β”œβ”€β”€ schemas/ # Pydantic data models
64+
β”œβ”€β”€ services/ # Business logic and helpers
65+
└── main.py # FastAPI entry point
66+
```

β€Žapi/base.pyβ€Ž

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,11 @@ def create_equipment(
179179
return adder(session, Equipment, equipment_data)
180180

181181

182-
def make_query(table, query):
182+
def make_query(table, query: str):
183+
# ensure the length of the query is reasonable
184+
if len(query) > 1000:
185+
raise ValueError("Query is too long")
186+
183187
match = QUERY_REGEX.match(query)
184188
column = match.group("field")
185189
value = match.group("value")

0 commit comments

Comments
Β (0)