Open tombola opened 8 months ago
Use srvcs to provide and clean up database connection.
Consider also using protocols to define the shape of query builders etc?
It seems srvcs
is pretty reliant on integration with a web framework, basically because it uses the request object to store the registry/container that holds the db conection etc, and the web framework teardown to close the connection
There is a FastAPI integration built in, so it should work when accessing the API endpoints, but not for the CLI, which is dissapointing, or for most tests.
Get Pypika working with pytests for FM SQL syntax, eg dates. Wrap this with a very simple database connection model using pypyodbc, again with tests.
This package intended to be used by a simple ORM.
* make swappable with pyodbc
See https://github.com/vitalseeds/vs-data-api/issues/4#issuecomment-1826380597