Repository navigation
v0.1.0
🔄 Changed
Query(path=...)takes aPathto the SQL file and checks that the file exists when the query is constructed, so a wrong path fails on import rather than on the first request.{% include %}inside a template resolves relative to the template's directory.SQLBaserecognises adapters declared on an intermediate base class: a subclass of yourSQLclass no longer fails with "Subclasses must define at least one adapter". The check no longer instantiates adapters with an emptysql.SQL.postgresaccessed on the class returns theAdapterDescriptoritself, likeproperty; on an instance it still returns the adapter bound to that query.- Minimum Python is 3.11 (was 3.9); requires
ddutils >= 0.2.0.
⚠️ Breaking changes
-
The
SQL_TEMPLATES_DIRenvironment variable is gone. Build the full path in the application and pass it toQuery:SQL_TEMPLATES_DIR = Path(__file__).parent / 'templates' / 'sql' query = Query(model=User, path=SQL_TEMPLATES_DIR / 'users' / 'get_by_id.sql')
-
Query(path=...)acceptsPathonly, notstr.
Full Changelog: v0.0.4...v0.1.0