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.18.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.18-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pugsql-0.1.18.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.18.tar.gz
Algorithm Hash digest
SHA256 1cba41ef8eba8ade3441d817e7555774f39f6334412cee16ecec9404f26ede29
MD5 234cf99600efdd55cb8da611111f04cd
BLAKE2b-256 2f0a87bc5ab209afa1e4bc2757389ff2c308ef8520312a7d3c54e754a152f49d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pugsql-0.1.18-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.18-py3-none-any.whl
Algorithm Hash digest
SHA256 39667ca3df3db88f33077e51965e5dc4419cd1e85882b3b70a49b8bf07ced456
MD5 c90f088e7608d99e38f3aed530dc586f
BLAKE2b-256 334ede73076973b5a012aeb0567531a6c29f08a6200b83ec835f0c41084f8434

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