Skip to content

Commit

Permalink
Updated the changelog and README
Browse files Browse the repository at this point in the history
  • Loading branch information
agronholm committed Apr 25, 2022
1 parent 52d4818 commit ea31798
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Version history
===============

**UNRELEASED**

- Added support for generating SQLModel classes (PR by Andrii Khirilov)
- Fixed code generation when a single-column index is unique or does not match the
dialect's naming convention (PR by Leonardus Chen)

**3.0.0rc1**

- Migrated all packaging/testing configuration to ``pyproject.toml``
Expand Down
14 changes: 11 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ The following built-in generators are available:
* ``tables`` (only generates ``Table`` objects, for those who don't want to use the ORM)
* ``declarative`` (the default; generates classes inheriting from ``declarative_base()``
* ``dataclasses`` (generates dataclass-based models; v1.4+ only)
* ``sqlmodel`` (generates model classes for SQLModel_)

.. _SQLModel: https://sqlmodel.tiangolo.com/

Generator-specific options
==========================
Expand Down Expand Up @@ -98,6 +101,10 @@ multiple times):

* all the options from ``declarative``

* ``sqlmodel``

* all the options from ``declarative``

Model class generators
----------------------

Expand Down Expand Up @@ -131,7 +138,8 @@ Relationships are detected based on existing foreign key constraints as follows:
* **many-to-one**: a foreign key constraint exists on the table
* **one-to-one**: same as **many-to-one**, but a unique constraint exists on the
column(s) involved
* **many-to-many**: an association table is found to exist between two tables
* **many-to-many**: (not implemented on the ``sqlmodel`` generator) an association table
is found to exist between two tables

A table is considered an association table if it satisfies all of the following
conditions:
Expand Down Expand Up @@ -165,10 +173,10 @@ whichever methods you need, and then add an `entry point`_ in the
is in place (you typically have to install the project with ``pip install``), you can
use ``--generator <yourentrypoint>`` to invoke your custom code generator.

For examples, you can look at sqlacodegen's own entry points in its `setup.cfg`_.
For examples, you can look at sqlacodegen's own entry points in its `pyproject.toml`_.

.. _entry point: https://setuptools.readthedocs.io/en/latest/userguide/entry_point.html
.. _setup.cfg: https://github.com/agronholm/sqlacodegen/blob/master/setup.cfg
.. _pyproject.toml: https://github.com/agronholm/sqlacodegen/blob/master/pyproject.toml

Getting help
============
Expand Down

0 comments on commit ea31798

Please sign in to comment.