You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Open Source, production ready Python FastAPI/Postgres app for [NX](https://goldlabel.pro?s=python-nx-ai)
5
5
6
6
```sh
@@ -32,7 +32,8 @@ The API is at <http://localhost:8000>.
32
32
The prospects table includes a `search_vector` column (type: tsvector) that is automatically computed from all text fields on insert. A GIN index is created for this column, enabling fast and scalable full-text search queries.
33
33
34
34
**How it works:**
35
-
- On every insert (via `/prospects/seed` or `/prospects/process`), the `search_vector` is computed from all text columns using PostgreSQL's `to_tsvector('english', ...)`.
35
+
36
+
- On every insert or update, the `search_vector` is computed from all text columns using PostgreSQL's `to_tsvector('english', ...)`.
36
37
- The GIN index (`idx_prospects_search_vector`) allows efficient search queries like:
37
38
38
39
```sql
@@ -45,52 +46,13 @@ This makes searching across all text fields in the prospects table extremely fas
| POST |`/echo`| Echoes the JSON `message` field |
76
-
| GET |`/prospects/seed`| (Re)create prospects table and seed with sample data |
77
-
| DELETE |`/prospects/process`| (Legacy) Empties the prospects table |
78
-
| GET |`/prospects/process`| Process and insert all records from big.csv into prospects table |
79
-
80
56
### Processing Large CSV Files
81
57
82
58
The `/prospects/process` endpoint is designed for robust, scalable ingestion of large CSV files (e.g., 1300+ rows, 300KB+). It follows the same normalization and insertion pattern as `/prospects/seed`, but is optimized for large files:
83
-
84
-
85
-
#### Example usage
86
-
87
-
1. Seed the table structure:
88
-
-`GET /prospects/seed`
89
-
2. (Optional) Empty the table:
90
-
-`DELETE /prospects/empty`
91
-
3. Process the large CSV:
92
-
-`GET /prospects/process`
93
-
94
-
The endpoint will return the number of records inserted. This is the core ingestion workflow for production-scale data.
0 commit comments