geldata / geldata/gel-python

Support dataclasses for queries

Open
#358 0 comments 3 reactions 1 assignee Claimed by @fantix View on GitHub
enhancement
Dominant language
Python
Stars
415
Forks
50
PR merge metrics
No merged PRs in 30d

Description

Seeing as this client library does not yet support a query builder, I would love to be able to pass in dataclasses when I'm making queries with EdgeQL. It would be something like this:

```py
@dataclass
class QueryStruct:
foo: str = "bar"
... # Ellipsis intended
```

Additionally, if possible, I'd like to see if we could get support for other dependencies such as `attrs` or `pydantic`. Especially with `attrs`, we could support converters and validators to help ensure with the query building process that data is properly being sent.

```py
import edgedb

@attrs.define()
class QueryStruct:
foo: QueryStruct = attrs.field(converter=QueryStruct, validator=edgedb.validate_query_struct)
...
```

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.