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.1.17.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

pugsql-0.1.17-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pugsql-0.1.17.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.16 CPython/3.7.3 Darwin/18.7.0

File hashes

Hashes for pugsql-0.1.17.tar.gz
Algorithm Hash digest
SHA256 2e33fa6906037af060f7f9ef3326156b53fd61c05fd4612248ed05097ad13e63
MD5 f9437e3357e43949cef548ef4f71fa3a
BLAKE2b-256 01eb66294d0b1c339e0c8885905689dc2a557826238b448ed8bfbb4406a90b78

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pugsql-0.1.17-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.16 CPython/3.7.3 Darwin/18.7.0

File hashes

Hashes for pugsql-0.1.17-py3-none-any.whl
Algorithm Hash digest
SHA256 7b9b835c8b4b1216c8881413b9db1269ce2c9153ecf19e12b4a52a9a24b7261d
MD5 10ed9a7deab752c9502eaa11ae3ee43c
BLAKE2b-256 d94041d1c78d222648be4631dc29a19d56c441a29fa47084a7008919bb1bd64c

See more details on using hashes here.

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