Skip to main content

SQL/PGQ (Property Graph Queries) for Python

Project description

sqlpgq is a Python library for working with SQL/PGQ graph queries.

Example

With the DuckPGQ extension installed, create the following social network tables.

-- Users table
CREATE TABLE users (
    id INTEGER PRIMARY KEY,
    name TEXT,
    age INTEGER
);

-- Friendships table  
CREATE TABLE friendships (
    id INTEGER PRIMARY KEY,
    user_id INTEGER REFERENCES users(id),
    friend_id INTEGER REFERENCES users(id),
    since DATE
);

INSERT INTO users VALUES (1, 'Alice', 30), (2, 'Bob', 25), (3, 'Carol', 35);
INSERT INTO friendships VALUES (1, 1, 2, '2020-01-01'), (2, 2, 3, '2021-06-15');

Then run examples/social_network.py to see the generated SQL/PGQ graph queries.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sqlpgq-0.0.1.tar.gz (26.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sqlpgq-0.0.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file sqlpgq-0.0.1.tar.gz.

File metadata

  • Download URL: sqlpgq-0.0.1.tar.gz
  • Upload date:
  • Size: 26.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sqlpgq-0.0.1.tar.gz
Algorithm Hash digest
SHA256 bd769945304f6d197f17a530bef0e89d88ed28f16a6303fb15f4fc1043147ea7
MD5 98ef415b38dc1f8b4295e345a914951a
BLAKE2b-256 88db4a182e062f8667b3b5f16445b543c153727bc95aff1205774b4bb70aeb45

See more details on using hashes here.

Provenance

The following attestation bundles were made for sqlpgq-0.0.1.tar.gz:

Publisher: ci.yml on cglwn/sqlpgq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sqlpgq-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: sqlpgq-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sqlpgq-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fe9a0b95b49734bb9b9408ee353ef97f17821728d839ab6eb2be3a829926381a
MD5 f89c016d3e51e32bd02dcad121087d68
BLAKE2b-256 b486b6053d5ae31d9f510f70fadd87ddb3fc2243de73a658b397c6cf1da62d7f

See more details on using hashes here.

Provenance

The following attestation bundles were made for sqlpgq-0.0.1-py3-none-any.whl:

Publisher: ci.yml on cglwn/sqlpgq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page