Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Can we have template for code generation? #463

Open
triumph1 opened this issue Sep 26, 2023 · 0 comments
Open

[Feature Request] Can we have template for code generation? #463

triumph1 opened this issue Sep 26, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@triumph1
Copy link

Hi! thanks for making the great database!
I'm happily learning edgedb nowdays. 馃槅

can we have template for code generation?

example

below edgeql generates below python code

select 1;
# AUTOGENERATED FROM 'app/queries/test.edgeql' WITH:
#     $ edgedb-py


from __future__ import annotations
import edgedb


async def test(
    executor: edgedb.AsyncIOExecutor,
) -> int:
    return await executor.query_single(
        """\
        select 1;\
        """,
    )

but this code doesn't pass strict mypy check since query_single is returning Any.

cast?

I want to use typing.cast() to pass mypy check

return cast(int, await executor.query_single(
        """\
        select 1;\
        """,
    ))

how do I achieve this? 馃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants