doc: provide a small README
2 files changed, 49 insertions(+), 0 deletions(-)

A => README.md
A => setup.cfg
A => README.md +47 -0
@@ 0,0 1,47 @@ 
+# PYTEST SQLALCHEMY/POSTGRES FIXTURE
+
+
+## AUTOMATIC ENGINE FIXTURE WITH POSTGRES CLUSTER
+
+
+From a conftest.py it is sufficient to write this:
+
+```python
+    from pytest_sa_pg import fixture
+    from myapp import schema
+
+    engine = fixture.engine_fixture(schema.meta, 'data', 5433)
+```
+
+This creates a session-scoped fixture.
+
+The postgres database files for the local test cluster will be then
+created under `data/pgdb`.
+
+From this, in test modules, one can use the fixture as such:
+
+```python
+    def test_foo(engine):
+        name = engine.execute('select name from person where person.id = 42').scalar()
+        assert name == 'Babar'
+```
+
+## DIRECTLY USING THE POSTGRES CLUSTER HANDLER
+
+
+Sometimes the default fixture is not sufficient (e.g. because one uses
+namespace schemas and these are not automatically handled by
+sqlalchemy).
+
+We can use the library as such:
+
+```python
+    import pytest
+    from pytest_sa_pg import db
+
+    @pytest.fixture(scope='session')
+    def engine(request):
+        db.setup_local_pg_cluster(request, 'data', 5433)
+        ...
+```
+

          
A => setup.cfg +2 -0
@@ 0,0 1,2 @@ 
+[metadata]
+description-file = README.md