Update deps
Initial
EXPERIMENTAL types generator for use with edgeql-queries.
Add it to your project's development dependencies via Poetry:
$ poetry add -D git+https://git.sr.ht/~refi64/edgeql-typegen
or just add it to your venv:
$ pip install git+https://git.sr.ht/~refi64/edgeql-typegen
$ edgeql-typegen queries.edgeql queries.py
(Using -
for the input or output will use stdin/stdout, respectively.)
This will generate a module with a Queries
type inside it that can be used to run
async queries:
import query_types
queries: query_types.Queries = edgeql_queries.from_path('input-queries.edgeql')
You can use --format-command COMMAND
to send the generated file to the given command's
stdin, then save the command's stdout, i.e. "piping" the output through your formatter.
For example:
# Format via black & arrange imports via isort
$ edgeql-typegen --format-command 'black -q - | isort -' queries.edgeql query_types.py
Please see the guide for submitting patches on
git.sr.ht. (If you choose to use
git send-email
, the patches should be sent to
~refi64/edgeql-typegen-devel@lists.sr.ht.)
Install Poetry, then poetry install
to install all the
dependencies.
# An updated fork of blue (https://github.com/grantjenks/blue) used for formatting:
$ poetry run blue
# Run linting:
$ poetry run poe flake8
# Run type checking:
$ poetry run poe mypy
# Run unit tests:
$ poetry run poe test
# Run all of the above:
$ poetry run poe check
.vscode/
contains a pre-configured VSCode workspace with all settings set properly for
this project.