Skip to content

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 02 Oct 18:24
· 16 commits to main since this release
08452ae

🔄 Changed

  • Query(path=...) takes a Path to 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.
  • SQLBase recognises adapters declared on an intermediate base class: a subclass of your SQL class no longer fails with "Subclasses must define at least one adapter". The check no longer instantiates adapters with an empty sql.
  • SQL.postgres accessed on the class returns the AdapterDescriptor itself, like property; 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_DIR environment variable is gone. Build the full path in the application and pass it to Query:

    SQL_TEMPLATES_DIR = Path(__file__).parent / 'templates' / 'sql'
    query = Query(model=User, path=SQL_TEMPLATES_DIR / 'users' / 'get_by_id.sql')
  • Query(path=...) accepts Path only, not str.

Full Changelog: v0.0.4...v0.1.0