EdgeQL Query Builder
Query builder for EdgeDB
Description
- This project is currently in pre-alpha status, meaning that it is not yet production-ready and may be buggy and unstable.
- Please note that this project is not affiliated with the official developers of EdgeDB.
- Additionally, it is important to know that this project only supports a small part of the EdgeDB syntax.
- The library does not include any code for connecting to the database or executing queries.
- It also does not provide database introspection, so it will not check for typos in column names. What you write is what you get.
- Python version 3.10 or higher is required to use this library, and there are currently no plans for backporting to earlier versions.
- There are no external dependencies, including 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:
- select
- nested shapes
- filters for nested shapes
- order by for nested shapes
- limit/offset for nested shapes
- aggregations for nested shapes
- function calls
- computed fields
- filters
- filter by nested paths
- limit & offset
- order by
- backlinks
- subqueries
- polymorphic fields
- link properties (@notation)
- detached
- nested shapes
- group
- columns
- using
- by
- function calls
- update
- function calls
- nested queries
- delete
- delete without filters
- function calls
- limit & offset
- order by
- insert
- function calls
- positional arguments
- keyword arguments
- with block
- with literal
- with subquery
- with module + closure
- with x := subquery select x
- with x := subquery group x
- with x := subquery update x
- with x := Type.column
- if statements
- globals
- for statements
- union statements
- queries without models, like select [1,2,3]
- select
-
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 edgeql_qb 0.4.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| edgeql_qb-0.4.7.tar.gz | 18.0 kB | Without provenance | Details for edgeql_qb-0.4.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| edgeql_qb-0.4.7-py3-none-any.whl | Python 3 | none | any | Details for edgeql_qb-0.4.7-py3-none-any.whl |
Total release size: 42.4 kB
Release files / edgeql_qb-0.4.7.tar.gz
| Download URL | edgeql_qb-0.4.7.tar.gz |
|---|---|
| Size | 18.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c239232be67682063f1fcb8ddd2062478a6d6d80e77a73a3b007ad0295e2756e
|
|
BLAKE2b-256 checksum How to use checksums |
25687d392c551e72e220e1b65dd3e70cd4967cd7f2cda8f13ea54397e1299bac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.11.13 Linux/6.11.0-1018-azure
|
Release files / edgeql_qb-0.4.7-py3-none-any.whl
| Download URL | edgeql_qb-0.4.7-py3-none-any.whl |
|---|---|
| Size | 24.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
94b148f1485b29a44cb9227dba7f931daa90589781e4206c2d34d1b2774dfe98
|
|
BLAKE2b-256 checksum How to use checksums |
ce24c1355cfc3da05cda440d7c1f85ec610f5ec4f7d6a1f284f9989bf2e669db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.11.13 Linux/6.11.0-1018-azure
|
Security for edgeql_qb 0.4.7
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.