Update AGENTS.md with complete examples, notebooks, and env var documentation
This commit is contained in:
24
AGENTS.md
24
AGENTS.md
@@ -57,6 +57,17 @@ make test-pg-once
|
|||||||
- `examples/04_async_crud.py` - Async CRUD operations
|
- `examples/04_async_crud.py` - Async CRUD operations
|
||||||
- `examples/05_cheminformatics.py` - Cheminformatics use case
|
- `examples/05_cheminformatics.py` - Cheminformatics use case
|
||||||
- `examples/06_csv_to_sqlmodel.py` - CSV import workflow
|
- `examples/06_csv_to_sqlmodel.py` - CSV import workflow
|
||||||
|
- `examples/07_postgres_minimal.py` - Minimal Postgres workflow with REST-style operations
|
||||||
|
|
||||||
|
### Notebooks
|
||||||
|
- `notebooks/01_cheminformatics_quickstart.ipynb` - End-to-end cheminformatics tutorial
|
||||||
|
- `notebooks/01_sync_crud.ipynb` - Sync CRUD tutorial
|
||||||
|
- `notebooks/02_bulk_and_filters.ipynb` - Bulk insert and filtering
|
||||||
|
- `notebooks/03_relationships.ipynb` - Model relationships
|
||||||
|
- `notebooks/04_async_crud.ipynb` - Async CRUD operations
|
||||||
|
- `notebooks/05_cheminformatics.ipynb` - Cheminformatics step-by-step
|
||||||
|
- `notebooks/06_csv_import.ipynb` - CSV import workflow
|
||||||
|
- `notebooks/07_postgres_minimal.ipynb` - Postgres minimal example
|
||||||
|
|
||||||
### Tests
|
### Tests
|
||||||
- `tests/test_smoke.py` - Fast SQLite tests
|
- `tests/test_smoke.py` - Fast SQLite tests
|
||||||
@@ -74,13 +85,15 @@ make db-logs # View logs
|
|||||||
Environment variables (for Postgres):
|
Environment variables (for Postgres):
|
||||||
```bash
|
```bash
|
||||||
export SQL_HOST=127.0.0.1
|
export SQL_HOST=127.0.0.1
|
||||||
export SQL_PORT=5432
|
export SQL_PORT=5433 # or 5432 for native Postgres
|
||||||
export SQL_USER=postgres
|
export SQL_USER=postgres
|
||||||
export SQL_PASSWORD=change-me-strong
|
export SQL_PASSWORD=change-me-strong
|
||||||
export SQL_DATABASE=appdb
|
export SQL_DATABASE=appdb
|
||||||
export SQL_SSLMODE=disable
|
export SQL_SSLMODE=disable
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Note: The project supports both `SQL_*` and `PG*` environment variables (e.g., `PGHOST`, `PGPORT`, `PGUSER`, `PGPASSWORD`, `PGDATABASE`). Docker Compose uses port `5433` mapped from container's `5432`.
|
||||||
|
|
||||||
## Common Workflows
|
## Common Workflows
|
||||||
|
|
||||||
### Adding a new CRUD operation
|
### Adding a new CRUD operation
|
||||||
@@ -101,9 +114,12 @@ make examples
|
|||||||
|
|
||||||
## Build and Package
|
## Build and Package
|
||||||
|
|
||||||
|
### PyPI
|
||||||
- Build: `uv build`
|
- Build: `uv build`
|
||||||
- Publish to PyPI: `uv publish`
|
- Publish: `uv publish`
|
||||||
- Build conda package: `conda build conda/`
|
|
||||||
|
### Conda
|
||||||
|
- Build conda package: `conda build conda/` (if conda recipe exists)
|
||||||
|
|
||||||
## Important Notes
|
## Important Notes
|
||||||
|
|
||||||
@@ -111,3 +127,5 @@ make examples
|
|||||||
- Postgres is recommended for production and integration tests
|
- Postgres is recommended for production and integration tests
|
||||||
- The project uses `uv` for dependency management (PEP 621/517)
|
- The project uses `uv` for dependency management (PEP 621/517)
|
||||||
- All SQLModel models are registered in `SQLModel.metadata` for `create_all()`
|
- All SQLModel models are registered in `SQLModel.metadata` for `create_all()`
|
||||||
|
- For production, prefer `sslmode=verify-full` and least-privileged DB users
|
||||||
|
- Bring your own Alembic migrations; set `target_metadata = SQLModel.metadata` in env.py
|
||||||
|
|||||||
Reference in New Issue
Block a user