Skip to main content

PugSQL is an anti-ORM that facilitates interacting with databases using SQL in files.

Project description

PugSQL is a simple Python interface for using parameterized SQL, in files, with any SQLAlchemy-supported database.

For more information and full documentation, visit pugsql.org.

import pugsql

# Create a module of database functions from a set of sql files on disk.
queries = pugsql.module('resources/sql')

# Point the module at your database.
queries.connect('sqlite:///foo.db')

# Invoke parameterized queries, receive dicts!
user = queries.find_user(user_id=42)

# -> { 'user_id': 42, 'username': 'mcfunley' }

In the example above, the query would be specified like this:

--- :name find_user :one
select * from users where user_id = :user_id

So throw away your bulky ORM and talk to your database the way the gods intended! Install PugSQL today!

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

pugsql-0.3.5.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

pugsql-0.3.5-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file pugsql-0.3.5.tar.gz.

File metadata

  • Download URL: pugsql-0.3.5.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pugsql-0.3.5.tar.gz
Algorithm Hash digest
SHA256 d47991d67fc7615e5aa14d1df6c3fb08c1f161d35fb4d76291950390c65fb507
MD5 2f2f06e9b47cfa553bae9b90a56fbdb6
BLAKE2b-256 cb84823f076dbc4864ff95aa8d8782848a1cd04e688b1e91e297470bbf36ed8b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pugsql-0.3.5.tar.gz:

Publisher: release.yml on mcfunley/pugsql

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

File details

Details for the file pugsql-0.3.5-py3-none-any.whl.

File metadata

  • Download URL: pugsql-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 14.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pugsql-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a76e2e866860b28291de45d9dfd3293be4c78ecc0d09ec5e764827ec5259c23c
MD5 195aab149e1d68ffe9f40c3ffb73e5bf
BLAKE2b-256 6ba9095c9e4801bc505b8f7b6321cda17840d0c3c0e8e522f0497b28366f60a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pugsql-0.3.5-py3-none-any.whl:

Publisher: release.yml on mcfunley/pugsql

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 Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page