dalibo / pgtoolkit

Postgres Support from Python
https://pgtoolkit.rtfd.io/
PostgreSQL License
21 stars 9 forks source link

Allow absolute file paths when parsing string configuration #121

Closed dlax closed 1 month ago

dlax commented 1 month ago

We partly remove the previous limitation when parsing a string literal containing include directives. Now directives referencing absolute path, i.e. not relative to the including configuration file, are allowed.

l00ptr commented 1 month ago

LGTM

dlax commented 1 month ago

Are there any cases where relative paths are allowed? It is not very clear to me.

As long as you pass a file path value (or the path as a 'source' argument), relative paths in include directives are allowed because we'll compute the absolute path to included file relatively to the source. See tests/test_conf.py::test_parser_includes().