Skip to main content

Python 3.10+ Tests Maintainability Rating Coverage

EdgeQL Query Builder

Query builder for EdgeDB

Description

  • Project currently in pre-alpha status. It is not production-ready yet, and It may be buggy and unstable as well.
  • The project is not affiliated with the official developers of EdgeDB.
  • This project only supports a small part of the EdgeDB syntax.
  • The library does not contain any code to connect to the database or to execute queries.
  • The library does not introspect the database and will not check if you made a typo somewhere in a column name. What you write is what you get.
  • Minimal required version of python is 3.10. Not sure if I'll ever do a backport.
  • There is no external dependencies, even on EdgeDB itself.

Usage examples

Many examples of queries are given in the documentation directory.

from edgeql_qb import EdgeDBModel
from edgeql_qb.types import int16
from edgedb.blocking_client import create_client


client = create_client()
Movie = EdgeDBModel('Movie')
Person = EdgeDBModel('Person')

insert = Movie.insert.values(
    title='Blade Runner 2049',
    year=int16(2017),
    director=(
        Person.select()
        .where(Person.c.id == director_id)
        .limit1
    ),
    actors=Person.insert.values(
        first_name='Harrison',
        last_name='Ford',
    ),
).build()


select = (
    Movie.select(
        Movie.c.title,
        Movie.c.year,
        Movie.c.director(
            Movie.c.director.first_name,
            Movie.c.director.last_name,
        ),
        Movie.c.actors(
            Movie.c.actors.first_name,
            Movie.c.actors.last_name,
        ),
    )
    .where(Movie.c.title == 'Blade Runner 2049')
    .build()
)

delete = Movie.delete.where(Movie.c.title == 'Blade Runner 2049').build()

decade = (Movie.c.year // 10).label('decade')
group = Movie.group().using(decade).by(decade).build()

client.query(insert.query, **insert.context)
result = client.query(select.query, **select.context)

movies_by_decade = client.query(group.query, **group.context)

client.query(delete.query, **delete.context)

Status

  • Queries:

  • Types:

    • type casts
    • cal::date_duration
    • cal::relative_duration
    • std::array
    • std::json
    • std::range
    • std::set
    • std::tuple
    • cal::local_date
    • cal::local_date
    • cal::local_datetime
    • cal::local_time
    • std::bigint
    • std::bool
    • std::bytes
    • std::datetime
    • std::decimal
    • std::duration
    • std::float32
    • std::float64
    • std::int16
    • std::int32
    • std::int64
    • std::str
    • std::uuid
  • Functions

    • cal
    • math
    • std
    • sys

Metadata

Release files for elgeql-qb 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for elgeql-qb 0.4.1
File Size Uploaded Provenance Actions
elgeql_qb-0.4.1.tar.gz 17.9 kB Without provenance Details for elgeql_qb-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for elgeql-qb 0.4.1
File Interpreter ABI Platform Actions
elgeql_qb-0.4.1-py3-none-any.whl Python 3 none any Details for elgeql_qb-0.4.1-py3-none-any.whl

Total release size: 41.3 kB

Release files / elgeql_qb-0.4.1.tar.gz

Download URL elgeql_qb-0.4.1.tar.gz
Size 17.9 kB
Tags Source
SHA-256 checksum
How to use checksums
83e49f1d4621d8fe719d3586d5038968913dd27540058d244b9aa4697a3f56e1
BLAKE2b-256 checksum
How to use checksums
821ac22ee51ec74bf3ff13254dbf92059becc9ff50afd102498f5d1efeba603f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.10.6 Linux/5.15.0-53-generic

Release files / elgeql_qb-0.4.1-py3-none-any.whl

Download URL elgeql_qb-0.4.1-py3-none-any.whl
Size 23.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b4302af46c35073e7e183229c1dcc68917d8730ba1ee767adfd7bb4f59bcbece
BLAKE2b-256 checksum
How to use checksums
4bd22010009b91e86fef03d86a07c8349532d22c356db21bf7b3aeed244427fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.10.6 Linux/5.15.0-53-generic

Security for elgeql-qb 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page