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.11.tar.gz (11.2 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.11-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pugsql-0.1.11.tar.gz
Algorithm Hash digest
SHA256 93e46cb50d26cc919c17521fb6aaaece2c9a084115bdcece8a007623bef6ae63
MD5 a0ec3ef4903ceefdb3afc42c34c67c5f
BLAKE2b-256 964902efcea5998f82100089265a780717cf80eb818f12173637ecce7b3a32f7

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pugsql-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 717d07021d23421a7675aa600f725ff603f79f6f298005617b1e09476bcbf01e
MD5 05ad814184737d0b025d464973772ec4
BLAKE2b-256 5e38610dab3625e1dc8d20ea26c1f8d6b0ebbb2525d87c5b2e512713963b6bc0

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