Developer Releases PySQLe to Bind Raw SQL Queries to Python Functions
A developer has released PySQLe, a new open-source Python library that links raw SQL queries directly to native Python function definitions. Users subclass a PysqleModule base class and define methods that return SQL strings, then decorate them with result-type decorators such as one, many, or scalar to control execution and output. The library supports standard Python features like type annotations, default parameter values, and positional or keyword arguments, which are passed through to the database at query time. PySQLe uses SQLAlchemy connection strings under the hood and is available on PyPI via pip install pysqle, with source code hosted on Codeberg. The author describes it as a first version and plans future improvements including better type annotation support and compatibility with PugSQL-annotated SQL files.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.



Discussion (0)
Log in to join the discussion and vote.
Log in