https://github.com/parantapa/sqlpygen3
Generate type annotated Python code from annotated SQL
https://github.com/parantapa/sqlpygen3
Last synced: 2 months ago
JSON representation
Generate type annotated Python code from annotated SQL
- Host: GitHub
- URL: https://github.com/parantapa/sqlpygen3
- Owner: parantapa
- Created: 2023-08-07T03:44:14.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-15T00:24:31.000Z (over 2 years ago)
- Last Synced: 2025-12-15T22:17:22.544Z (6 months ago)
- Language: C
- Size: 68.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
SqlPyGen: Generate Type Annotated Python from Annotated SQL
===========================================================
sqlpygen is a utility to generate
type annotated Python code from annotated SQL.
The current version of the tool only supports
generating code for SQLite3.
Installation
------------
You can install SqlPyGen using pip.
.. code:: bash
$ pip install sqlpygen
Example Usage
-------------
When using sqlpygen to generate Python code from SQL,
one creates a sqlpygen file.
See `examples` directory for syntax of sqlpygen files.
Next use the following command to generate the python code.
.. code:: bash
$ cd examples
$ sqlpygen compile example1.sqlpygen
Executed schema table_stocks successfully
Executed query insert_into_stocks successfully
Executed query select_from_stocks successfully
Executed query count_stocks successfully
Writing output to: example1.py
Module example1 generated successfully.