geldata / geldata/gel-python

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

Open
#463 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
415
Forks
50
PR merge metrics
No merged PRs in 30d

Description

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
```edgeql
select 1;
```

```py
# 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

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

how do I achieve this? 🤔

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.