Skip to main content

Type Safed SQL Query Builder for Python

test pypi package

⚠️⚠️⚠️ This library is currently under consideration and is not ready for use in actual products. ⚠️⚠️⚠️

Development Notes

DDL

There are no plans for support.

DDL is often used infrequently as its syntax varies from database to database. It is recommended that it be managed by a separate migration tool.

For Table Relation

If a PrimaryKey or a join key is included as a constraint, it can be expressed as a NewType to match the condition.

Examples

from textwrap import dedent

from tipsql.core.query.builder import QueryBuilder

from your_project.database.public import User, Address


builder = (
    query.chain()
    .from_(
        lambda c: c(User)
        .left_outer_join(
            Address,
        )
        .on(
            lambda c: c(User.id == Address.user_id)
            .and_(Address.city == "Tokyo")
        )
    )
    .select(
        User.id,
        User.name,
    )
)

assert (
    builder.build()
    == dedent(
        """
        SELECT
            users.id,
            users.name
        FROM
            users
            LEFT OUTER JOIN
                addresses
            ON
                users.id = addresses.user_id
                AND addresses.city = 'Tokyo';
        """
    ).strip()
)

Metadata

Release files for tipsql 0.0.14

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

Source distribution (sdist)

Source distribution for tipsql 0.0.14
File Size Uploaded Provenance Actions
tipsql-0.0.14.tar.gz 2.1 kB Without provenance Details for tipsql-0.0.14.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tipsql 0.0.14
File Interpreter ABI Platform Actions
tipsql-0.0.14-py3-none-any.whl Python 3 none any Details for tipsql-0.0.14-py3-none-any.whl

Total release size: 4.0 kB

Release files / tipsql-0.0.14.tar.gz

Download URL tipsql-0.0.14.tar.gz
Size 2.1 kB
Tags Source
SHA-256 checksum
How to use checksums
13d38c1fe51f029f0a1d5f1d936c2274385b551e9784b882d92137b1abeb3697
BLAKE2b-256 checksum
How to use checksums
8cece08a3973b52c16c6aff5b5734656dcdaf124537e6e580489ff386512d505
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.12.0 Linux/6.2.0-1016-azure

Release files / tipsql-0.0.14-py3-none-any.whl

Download URL tipsql-0.0.14-py3-none-any.whl
Size 1.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
595df285eb9abea18b1515087f02f3dde1a852f7a8fc2dba0325379a37fb0858
BLAKE2b-256 checksum
How to use checksums
3ca56d13f86c42a0ab5bd4b142b397854f24c089b5646379ea440c8cdb22f3de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.12.0 Linux/6.2.0-1016-azure

Security for tipsql 0.0.14

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.

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