sqlacodegen 2.3.0__tar.gz → 3.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sqlacodegen-3.0.0/.github/ISSUE_TEMPLATE/bug_report.yaml +66 -0
- sqlacodegen-3.0.0/.github/ISSUE_TEMPLATE/config.yml +1 -0
- sqlacodegen-3.0.0/.github/ISSUE_TEMPLATE/features_request.yaml +35 -0
- sqlacodegen-3.0.0/.github/workflows/publish.yml +59 -0
- sqlacodegen-3.0.0/.github/workflows/test.yml +41 -0
- {sqlacodegen-2.3.0 → sqlacodegen-3.0.0}/.gitignore +2 -0
- sqlacodegen-3.0.0/.pre-commit-config.yaml +38 -0
- sqlacodegen-3.0.0/CHANGES.rst +201 -0
- sqlacodegen-3.0.0/CONTRIBUTING.rst +47 -0
- sqlacodegen-3.0.0/PKG-INFO +246 -0
- sqlacodegen-3.0.0/README.rst +203 -0
- sqlacodegen-3.0.0/pyproject.toml +102 -0
- sqlacodegen-3.0.0/setup.cfg +4 -0
- sqlacodegen-3.0.0/src/sqlacodegen/__main__.py +3 -0
- sqlacodegen-3.0.0/src/sqlacodegen/cli.py +115 -0
- sqlacodegen-3.0.0/src/sqlacodegen/generators.py +1512 -0
- sqlacodegen-3.0.0/src/sqlacodegen/models.py +79 -0
- sqlacodegen-3.0.0/src/sqlacodegen/py.typed +0 -0
- sqlacodegen-3.0.0/src/sqlacodegen/utils.py +204 -0
- sqlacodegen-3.0.0/src/sqlacodegen.egg-info/PKG-INFO +246 -0
- sqlacodegen-3.0.0/src/sqlacodegen.egg-info/SOURCES.txt +32 -0
- sqlacodegen-3.0.0/src/sqlacodegen.egg-info/entry_points.txt +8 -0
- sqlacodegen-3.0.0/src/sqlacodegen.egg-info/requires.txt +24 -0
- sqlacodegen-3.0.0/tests/__init__.py +0 -0
- sqlacodegen-3.0.0/tests/conftest.py +33 -0
- sqlacodegen-3.0.0/tests/test_cli.py +160 -0
- sqlacodegen-3.0.0/tests/test_generator_dataclass.py +270 -0
- sqlacodegen-3.0.0/tests/test_generator_declarative.py +1511 -0
- sqlacodegen-3.0.0/tests/test_generator_sqlmodel.py +188 -0
- sqlacodegen-3.0.0/tests/test_generator_tables.py +998 -0
- sqlacodegen-2.3.0/.travis.yml +0 -74
- sqlacodegen-2.3.0/CHANGES.rst +0 -91
- sqlacodegen-2.3.0/PKG-INFO +0 -140
- sqlacodegen-2.3.0/README.rst +0 -113
- sqlacodegen-2.3.0/pyproject.toml +0 -2
- sqlacodegen-2.3.0/setup.cfg +0 -65
- sqlacodegen-2.3.0/setup.py +0 -12
- sqlacodegen-2.3.0/sqlacodegen/codegen.py +0 -735
- sqlacodegen-2.3.0/sqlacodegen/main.py +0 -53
- sqlacodegen-2.3.0/sqlacodegen.egg-info/PKG-INFO +0 -140
- sqlacodegen-2.3.0/sqlacodegen.egg-info/SOURCES.txt +0 -19
- sqlacodegen-2.3.0/sqlacodegen.egg-info/entry_points.txt +0 -3
- sqlacodegen-2.3.0/sqlacodegen.egg-info/requires.txt +0 -8
- sqlacodegen-2.3.0/tests/test_codegen.py +0 -1509
- sqlacodegen-2.3.0/tox.ini +0 -19
- {sqlacodegen-2.3.0 → sqlacodegen-3.0.0}/LICENSE +0 -0
- {sqlacodegen-2.3.0 → sqlacodegen-3.0.0/src}/sqlacodegen/__init__.py +0 -0
- {sqlacodegen-2.3.0 → sqlacodegen-3.0.0/src}/sqlacodegen.egg-info/dependency_links.txt +0 -0
- {sqlacodegen-2.3.0 → sqlacodegen-3.0.0/src}/sqlacodegen.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
name: Bug Report
|
|
2
|
+
description: File a bug report
|
|
3
|
+
labels: ["bug"]
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: >
|
|
8
|
+
If you observed a crash in the project, or saw unexpected behavior in it, report
|
|
9
|
+
your findings here.
|
|
10
|
+
- type: checkboxes
|
|
11
|
+
attributes:
|
|
12
|
+
label: Things to check first
|
|
13
|
+
options:
|
|
14
|
+
- label: >
|
|
15
|
+
I have searched the existing issues and didn't find my bug already reported
|
|
16
|
+
there
|
|
17
|
+
required: true
|
|
18
|
+
- label: >
|
|
19
|
+
I have checked that my bug is still present in the latest release
|
|
20
|
+
required: true
|
|
21
|
+
- type: input
|
|
22
|
+
id: project-version
|
|
23
|
+
attributes:
|
|
24
|
+
label: Sqlacodegen version
|
|
25
|
+
description: What version of Sqlacodegen were you running?
|
|
26
|
+
validations:
|
|
27
|
+
required: true
|
|
28
|
+
- type: input
|
|
29
|
+
id: sqlalchemy-version
|
|
30
|
+
attributes:
|
|
31
|
+
label: SQLAlchemy version
|
|
32
|
+
description: What version of SQLAlchemy were you running?
|
|
33
|
+
validations:
|
|
34
|
+
required: true
|
|
35
|
+
- type: dropdown
|
|
36
|
+
id: rdbms
|
|
37
|
+
attributes:
|
|
38
|
+
label: RDBMS vendor
|
|
39
|
+
description: >
|
|
40
|
+
What RDBMS (relational database management system) did you run the tool against?
|
|
41
|
+
options:
|
|
42
|
+
- PostgreSQL
|
|
43
|
+
- MySQL (or compatible)
|
|
44
|
+
- SQLite
|
|
45
|
+
- MSSQL
|
|
46
|
+
- Oracle
|
|
47
|
+
- DB2
|
|
48
|
+
- Other
|
|
49
|
+
- N/A
|
|
50
|
+
validations:
|
|
51
|
+
required: true
|
|
52
|
+
- type: textarea
|
|
53
|
+
id: what-happened
|
|
54
|
+
attributes:
|
|
55
|
+
label: What happened?
|
|
56
|
+
description: >
|
|
57
|
+
Unless you are reporting a crash, tell us what you expected to happen instead.
|
|
58
|
+
validations:
|
|
59
|
+
required: true
|
|
60
|
+
- type: textarea
|
|
61
|
+
id: schema
|
|
62
|
+
attributes:
|
|
63
|
+
label: Database schema for reproducing the bug
|
|
64
|
+
description: >
|
|
65
|
+
If applicable, paste the database schema (as a series of `CREATE TABLE` and
|
|
66
|
+
other SQL commands) here.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
blank_issues_enabled: false
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: Feature request
|
|
2
|
+
description: Suggest a new feature
|
|
3
|
+
labels: ["enhancement"]
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: >
|
|
8
|
+
If you have thought of a new feature that would increase the usefulness of this
|
|
9
|
+
project, please use this form to send us your idea.
|
|
10
|
+
- type: checkboxes
|
|
11
|
+
attributes:
|
|
12
|
+
label: Things to check first
|
|
13
|
+
options:
|
|
14
|
+
- label: >
|
|
15
|
+
I have searched the existing issues and didn't find my feature already
|
|
16
|
+
requested there
|
|
17
|
+
required: true
|
|
18
|
+
- type: textarea
|
|
19
|
+
id: feature
|
|
20
|
+
attributes:
|
|
21
|
+
label: Feature description
|
|
22
|
+
description: >
|
|
23
|
+
Describe the feature in detail. The more specific the description you can give,
|
|
24
|
+
the easier it should be to implement this feature.
|
|
25
|
+
validations:
|
|
26
|
+
required: true
|
|
27
|
+
- type: textarea
|
|
28
|
+
id: usecase
|
|
29
|
+
attributes:
|
|
30
|
+
label: Use case
|
|
31
|
+
description: >
|
|
32
|
+
Explain why you need this feature, and why you think it would be useful to
|
|
33
|
+
others too.
|
|
34
|
+
validations:
|
|
35
|
+
required: true
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
name: Publish packages to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "[0-9]+.[0-9]+.[0-9]+"
|
|
7
|
+
- "[0-9]+.[0-9]+.[0-9]+.post[0-9]+"
|
|
8
|
+
- "[0-9]+.[0-9]+.[0-9]+[a-b][0-9]+"
|
|
9
|
+
- "[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
name: Build the source tarball and the wheel
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
environment: release
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
- name: Set up Python
|
|
19
|
+
uses: actions/setup-python@v5
|
|
20
|
+
with:
|
|
21
|
+
python-version: 3.x
|
|
22
|
+
- name: Install dependencies
|
|
23
|
+
run: pip install build
|
|
24
|
+
- name: Create packages
|
|
25
|
+
run: python -m build
|
|
26
|
+
- name: Archive packages
|
|
27
|
+
uses: actions/upload-artifact@v4
|
|
28
|
+
with:
|
|
29
|
+
name: dist
|
|
30
|
+
path: dist
|
|
31
|
+
|
|
32
|
+
publish:
|
|
33
|
+
name: Publish build artifacts to the PyPI
|
|
34
|
+
needs: build
|
|
35
|
+
runs-on: ubuntu-latest
|
|
36
|
+
environment: release
|
|
37
|
+
permissions:
|
|
38
|
+
id-token: write
|
|
39
|
+
steps:
|
|
40
|
+
- name: Retrieve packages
|
|
41
|
+
uses: actions/download-artifact@v4
|
|
42
|
+
- name: Upload packages
|
|
43
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
44
|
+
|
|
45
|
+
release:
|
|
46
|
+
name: Create a GitHub release
|
|
47
|
+
needs: build
|
|
48
|
+
runs-on: ubuntu-latest
|
|
49
|
+
permissions:
|
|
50
|
+
contents: write
|
|
51
|
+
steps:
|
|
52
|
+
- uses: actions/checkout@v4
|
|
53
|
+
- id: changelog
|
|
54
|
+
uses: agronholm/release-notes@v1
|
|
55
|
+
with:
|
|
56
|
+
path: CHANGES.rst
|
|
57
|
+
- uses: ncipollo/release-action@v1
|
|
58
|
+
with:
|
|
59
|
+
body: ${{ steps.changelog.outputs.changelog }}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
name: test suite
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
strategy:
|
|
11
|
+
fail-fast: false
|
|
12
|
+
matrix:
|
|
13
|
+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
18
|
+
uses: actions/setup-python@v5
|
|
19
|
+
with:
|
|
20
|
+
python-version: ${{ matrix.python-version }}
|
|
21
|
+
allow-prereleases: true
|
|
22
|
+
cache: pip
|
|
23
|
+
cache-dependency-path: pyproject.toml
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: pip install -e .[test]
|
|
26
|
+
- name: Test with pytest
|
|
27
|
+
run: coverage run -m pytest
|
|
28
|
+
- name: Upload Coverage
|
|
29
|
+
uses: coverallsapp/github-action@v2
|
|
30
|
+
with:
|
|
31
|
+
parallel: true
|
|
32
|
+
|
|
33
|
+
coveralls:
|
|
34
|
+
name: Finish Coveralls
|
|
35
|
+
needs: test
|
|
36
|
+
runs-on: ubuntu-latest
|
|
37
|
+
steps:
|
|
38
|
+
- name: Finished
|
|
39
|
+
uses: coverallsapp/github-action@v2
|
|
40
|
+
with:
|
|
41
|
+
parallel-finished: true
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# This is the configuration file for pre-commit (https://pre-commit.com/).
|
|
2
|
+
# To use:
|
|
3
|
+
# * Install pre-commit (https://pre-commit.com/#installation)
|
|
4
|
+
# * Copy this file as ".pre-commit-config.yaml"
|
|
5
|
+
# * Run "pre-commit install".
|
|
6
|
+
repos:
|
|
7
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
8
|
+
rev: v5.0.0
|
|
9
|
+
hooks:
|
|
10
|
+
- id: check-toml
|
|
11
|
+
- id: check-yaml
|
|
12
|
+
- id: debug-statements
|
|
13
|
+
- id: end-of-file-fixer
|
|
14
|
+
- id: mixed-line-ending
|
|
15
|
+
args: [ "--fix=lf" ]
|
|
16
|
+
- id: trailing-whitespace
|
|
17
|
+
|
|
18
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
19
|
+
rev: v0.9.7
|
|
20
|
+
hooks:
|
|
21
|
+
- id: ruff
|
|
22
|
+
args: [--fix, --show-fixes]
|
|
23
|
+
- id: ruff-format
|
|
24
|
+
|
|
25
|
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
26
|
+
rev: v1.15.0
|
|
27
|
+
hooks:
|
|
28
|
+
- id: mypy
|
|
29
|
+
additional_dependencies:
|
|
30
|
+
- pytest
|
|
31
|
+
- "sqlalchemy[mypy] < 2.0"
|
|
32
|
+
|
|
33
|
+
- repo: https://github.com/pre-commit/pygrep-hooks
|
|
34
|
+
rev: v1.10.0
|
|
35
|
+
hooks:
|
|
36
|
+
- id: rst-backticks
|
|
37
|
+
- id: rst-directive-colons
|
|
38
|
+
- id: rst-inline-touching-normal
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Version history
|
|
2
|
+
===============
|
|
3
|
+
|
|
4
|
+
**3.0.0**
|
|
5
|
+
|
|
6
|
+
- Dropped support for Python 3.8
|
|
7
|
+
- Changed nullable relationships to include ``Optional`` in their type annotations
|
|
8
|
+
- Fixed SQLModel code generation
|
|
9
|
+
- Fixed two rendering issues in ``ENUM`` columns when a non-default schema is used: an
|
|
10
|
+
unwarranted positional argument and missing the ``schema`` argument
|
|
11
|
+
- Fixed ``AttributeError`` when metadata contains user defined column types
|
|
12
|
+
- Fixed ``AssertionError`` when metadata contains a column type that is a type decorator
|
|
13
|
+
with an all-uppercase name
|
|
14
|
+
- Fixed MySQL ``DOUBLE`` column types being rendered with the wrong arguments
|
|
15
|
+
|
|
16
|
+
**3.0.0rc5**
|
|
17
|
+
|
|
18
|
+
- Fixed pgvector support not working
|
|
19
|
+
|
|
20
|
+
**3.0.0rc4**
|
|
21
|
+
|
|
22
|
+
- Dropped support for Python 3.7
|
|
23
|
+
- Dropped support for SQLAlchemy 1.x
|
|
24
|
+
- Added support for the ``pgvector`` extension (with help from KellyRousselHoomano)
|
|
25
|
+
|
|
26
|
+
**3.0.0rc3**
|
|
27
|
+
|
|
28
|
+
- Added support for SQLAlchemy 2 (PR by rbuffat with help from mhauru)
|
|
29
|
+
- Renamed ``--option`` to ``--options`` and made its values delimited by commas
|
|
30
|
+
- Restored CIText and GeoAlchemy2 support (PR by stavvy-rotte)
|
|
31
|
+
|
|
32
|
+
**3.0.0rc2**
|
|
33
|
+
|
|
34
|
+
- Added support for generating SQLModel classes (PR by Andrii Khirilov)
|
|
35
|
+
- Fixed code generation when a single-column index is unique or does not match the
|
|
36
|
+
dialect's naming convention (PR by Leonardus Chen)
|
|
37
|
+
- Fixed another problem where sequence schemas were not properly separated from the
|
|
38
|
+
sequence name
|
|
39
|
+
- Fixed invalid generated primary/secondaryjoin expressions in self-referential
|
|
40
|
+
many-to-many relationships by using lambdas instead of strings
|
|
41
|
+
- Fixed ``AttributeError`` when the declarative generator encounters a table name
|
|
42
|
+
already in singular form when ``--option use_inflect`` is enabled
|
|
43
|
+
- Increased minimum SQLAlchemy version to 1.4.36 to address issues with ``ForeignKey``
|
|
44
|
+
and indexes, and to eliminate the PostgreSQL UUID column type annotation hack
|
|
45
|
+
|
|
46
|
+
**3.0.0rc1**
|
|
47
|
+
|
|
48
|
+
- Migrated all packaging/testing configuration to ``pyproject.toml``
|
|
49
|
+
- Fixed unwarranted ``ForeignKey`` declarations appearing in column attributes when
|
|
50
|
+
there are named, single column foreign key constraints (PR by Leonardus Chen)
|
|
51
|
+
. Fixed ``KeyError`` when rendering an index without any columns
|
|
52
|
+
- Fixed improper handling of schema prefixes in sequence names in server defaults
|
|
53
|
+
- Fixed identically named tables from different schemas resulting in invalid generated
|
|
54
|
+
code
|
|
55
|
+
- Fixed imports caused by ``server_default`` conflicting with class attribute names
|
|
56
|
+
- Worked around PostgreSQL UUID columns getting ``Any`` as the type annotation
|
|
57
|
+
|
|
58
|
+
**3.0.0b3**
|
|
59
|
+
|
|
60
|
+
- Dropped support for Python < 3.7
|
|
61
|
+
- Dropped support for SQLAlchemy 1.3
|
|
62
|
+
- Added a ``__main__`` module which can be used as an alternate entry point to the CLI
|
|
63
|
+
- Added detection for sequence use in column defaults on PostgreSQL
|
|
64
|
+
- Fixed ``sqlalchemy.exc.InvalidRequestError`` when encountering a column named
|
|
65
|
+
"metadata" (regression from 2.0)
|
|
66
|
+
- Fixed missing ``MetaData`` import with ``DeclarativeGenerator`` when only plain tables
|
|
67
|
+
are generated
|
|
68
|
+
- Fixed invalid data classes being generated due to some relationships having been
|
|
69
|
+
rendered without a default value
|
|
70
|
+
- Improved translation of column names into column attributes where the column name has
|
|
71
|
+
whitespace at the beginning or end
|
|
72
|
+
- Modified constraint and index rendering to add them explicitly instead of using
|
|
73
|
+
shortcuts like ``unique=True``, ``index=True`` or ``primary=True`` when the constraint
|
|
74
|
+
or index has a name that does not match the default naming convention
|
|
75
|
+
|
|
76
|
+
**3.0.0b2**
|
|
77
|
+
|
|
78
|
+
- Fixed ``IDENTITY`` columns not rendering properly when they are part of the primary
|
|
79
|
+
key
|
|
80
|
+
|
|
81
|
+
**3.0.0b1**
|
|
82
|
+
|
|
83
|
+
**NOTE**: Both the API and the command line interface have been refactored in a
|
|
84
|
+
backwards incompatible fashion. Notably several command line options have been moved to
|
|
85
|
+
specific generators and are no longer visible from ``sqlacodegen --help``. Their
|
|
86
|
+
replacement are documented in the README.
|
|
87
|
+
|
|
88
|
+
- Dropped support for Python < 3.6
|
|
89
|
+
- Added support for Python 3.10
|
|
90
|
+
- Added support for SQLAlchemy 1.4
|
|
91
|
+
- Added support for bidirectional relationships (use ``--option nobidi``) to disable
|
|
92
|
+
- Added support for multiple schemas via ``--schemas``
|
|
93
|
+
- Added support for ``IDENTITY`` columns
|
|
94
|
+
- Disabled inflection during table/relationship name generation by default
|
|
95
|
+
(use ``--option use_inflect`` to re-enable)
|
|
96
|
+
- Refactored the old ``CodeGenerator`` class into separate generator classes, selectable
|
|
97
|
+
via ``--generator``
|
|
98
|
+
- Refactored several command line options into generator specific options:
|
|
99
|
+
|
|
100
|
+
- ``--noindexes`` → ``--option noindexes``
|
|
101
|
+
- ``--noconstraints`` → ``--option noconstraints``
|
|
102
|
+
- ``--nocomments`` → ``--option nocomments``
|
|
103
|
+
- ``--nojoined`` → ``--option nojoined`` (``declarative`` and ``dataclass`` generators
|
|
104
|
+
only)
|
|
105
|
+
- ``--noinflect`` → (now the default; use ``--option use_inflect`` instead)
|
|
106
|
+
(``declarative`` and ``dataclass`` generators only)
|
|
107
|
+
- Fixed missing import for ``JSONB`` ``astext_type`` argument
|
|
108
|
+
- Fixed generated column or relationship names colliding with imports or each other
|
|
109
|
+
- Fixed ``CompileError`` when encountering server defaults that contain colons (``:``)
|
|
110
|
+
|
|
111
|
+
**2.3.0**
|
|
112
|
+
|
|
113
|
+
- Added support for rendering computed columns
|
|
114
|
+
- Fixed ``--nocomments`` not taking effect (fix proposed by AzuresYang)
|
|
115
|
+
- Fixed handling of MySQL ``SET`` column types (and possibly others as well)
|
|
116
|
+
|
|
117
|
+
**2.2.0**
|
|
118
|
+
|
|
119
|
+
- Added support for rendering table comments (PR by David Hirschfeld)
|
|
120
|
+
- Fixed bad identifier names being generated for plain tables (PR by softwarepk)
|
|
121
|
+
|
|
122
|
+
**2.1.0**
|
|
123
|
+
|
|
124
|
+
- Dropped support for Python 3.4
|
|
125
|
+
- Dropped support for SQLAlchemy 0.8
|
|
126
|
+
- Added support for Python 3.7 and 3.8
|
|
127
|
+
- Added support for SQLAlchemy 1.3
|
|
128
|
+
- Added support for column comments (requires SQLAlchemy 1.2+; based on PR by koalas8)
|
|
129
|
+
- Fixed crash on unknown column types (``NullType``)
|
|
130
|
+
|
|
131
|
+
**2.0.1**
|
|
132
|
+
|
|
133
|
+
- Don't adapt dialect specific column types if they need special constructor arguments
|
|
134
|
+
(thanks Nicholas Martin for the PR)
|
|
135
|
+
|
|
136
|
+
**2.0.0**
|
|
137
|
+
|
|
138
|
+
- Refactored code for better reuse
|
|
139
|
+
- Dropped support for Python 2.6, 3.2 and 3.3
|
|
140
|
+
- Dropped support for SQLAlchemy < 0.8
|
|
141
|
+
- Worked around a bug regarding Enum on SQLAlchemy 1.2+ (``name`` was missing)
|
|
142
|
+
- Added support for Geoalchemy2
|
|
143
|
+
- Fixed invalid class names being generated (fixes #60; PR by Dan O'Huiginn)
|
|
144
|
+
- Fixed array item types not being adapted or imported
|
|
145
|
+
(fixes #46; thanks to Martin Glauer and Shawn Koschik for help)
|
|
146
|
+
- Fixed attribute name of columns named ``metadata`` in mapped classes (fixes #62)
|
|
147
|
+
- Fixed rendered column types being changed from the original (fixes #11)
|
|
148
|
+
- Fixed server defaults which contain double quotes (fixes #7, #17, #28, #33, #36)
|
|
149
|
+
- Fixed ``secondary=`` not taking into account the association table's schema name
|
|
150
|
+
(fixes #30)
|
|
151
|
+
- Sort models by foreign key dependencies instead of schema and name (fixes #15, #16)
|
|
152
|
+
|
|
153
|
+
**1.1.6**
|
|
154
|
+
|
|
155
|
+
- Fixed compatibility with SQLAlchemy 1.0
|
|
156
|
+
- Added an option to only generate tables
|
|
157
|
+
|
|
158
|
+
**1.1.5**
|
|
159
|
+
|
|
160
|
+
- Fixed potential assignment of columns or relationships into invalid attribute names
|
|
161
|
+
(fixes #10)
|
|
162
|
+
- Fixed unique=True missing from unique Index declarations
|
|
163
|
+
- Fixed several issues with server defaults
|
|
164
|
+
- Fixed potential assignment of columns or relationships into invalid attribute names
|
|
165
|
+
- Allowed pascal case for tables already using it
|
|
166
|
+
- Switched from Mercurial to Git
|
|
167
|
+
|
|
168
|
+
**1.1.4**
|
|
169
|
+
|
|
170
|
+
- Fixed compatibility with SQLAlchemy 0.9.0
|
|
171
|
+
|
|
172
|
+
**1.1.3**
|
|
173
|
+
|
|
174
|
+
- Fixed compatibility with SQLAlchemy 0.8.3+
|
|
175
|
+
- Migrated tests from nose to pytest
|
|
176
|
+
|
|
177
|
+
**1.1.2**
|
|
178
|
+
|
|
179
|
+
- Fixed non-default schema name not being present in __table_args__ (fixes #2)
|
|
180
|
+
- Fixed self referential foreign key causing column type to not be rendered
|
|
181
|
+
- Fixed missing "deferrable" and "initially" keyword arguments in ForeignKey constructs
|
|
182
|
+
- Fixed foreign key and check constraint handling with alternate schemas (fixes #3)
|
|
183
|
+
|
|
184
|
+
**1.1.1**
|
|
185
|
+
|
|
186
|
+
- Fixed TypeError when inflect could not determine the singular name of a table for a
|
|
187
|
+
many-to-1 relationship
|
|
188
|
+
- Fixed _IntegerType, _StringType etc. being rendered instead of proper types on MySQL
|
|
189
|
+
|
|
190
|
+
**1.1.0**
|
|
191
|
+
|
|
192
|
+
- Added automatic detection of joined-table inheritance
|
|
193
|
+
- Fixed missing class name prefix in primary/secondary joins in relationships
|
|
194
|
+
- Instead of wildcard imports, generate explicit imports dynamically (fixes #1)
|
|
195
|
+
- Use the inflect library to produce better guesses for table to class name conversion
|
|
196
|
+
- Automatically detect Boolean columns based on CheckConstraints
|
|
197
|
+
- Skip redundant CheckConstraints for Enum and Boolean columns
|
|
198
|
+
|
|
199
|
+
**1.0.0**
|
|
200
|
+
|
|
201
|
+
- Initial release
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
Contributing to sqlacodegen
|
|
2
|
+
===========================
|
|
3
|
+
|
|
4
|
+
If you wish to contribute a fix or feature to sqlacodegen, please follow the following
|
|
5
|
+
guidelines.
|
|
6
|
+
|
|
7
|
+
When you make a pull request against the main sqlacodegen codebase, Github runs the
|
|
8
|
+
sqlacodegen test suite against your modified code. Before making a pull request, you
|
|
9
|
+
should ensure that the modified code passes tests locally. To that end, the use of tox_
|
|
10
|
+
is recommended. The default tox run first runs ``pre-commit`` and then the actual test
|
|
11
|
+
suite. To run the checks on all environments in parallel, invoke tox with ``tox -p``.
|
|
12
|
+
|
|
13
|
+
To build the documentation, run ``tox -e docs`` which will generate a directory named
|
|
14
|
+
``build`` in which you may view the formatted HTML documentation.
|
|
15
|
+
|
|
16
|
+
sqlacodegen uses pre-commit_ to perform several code style/quality checks. It is
|
|
17
|
+
recommended to activate pre-commit_ on your local clone of the repository (using
|
|
18
|
+
``pre-commit install``) to ensure that your changes will pass the same checks on GitHub.
|
|
19
|
+
|
|
20
|
+
.. _tox: https://tox.readthedocs.io/en/latest/install.html
|
|
21
|
+
.. _pre-commit: https://pre-commit.com/#installation
|
|
22
|
+
|
|
23
|
+
Making a pull request on Github
|
|
24
|
+
-------------------------------
|
|
25
|
+
|
|
26
|
+
To get your changes merged to the main codebase, you need a Github account.
|
|
27
|
+
|
|
28
|
+
#. Fork the repository (if you don't have your own fork of it yet) by navigating to the
|
|
29
|
+
`main sqlacodegen repository`_ and clicking on "Fork" near the top right corner.
|
|
30
|
+
#. Clone the forked repository to your local machine with
|
|
31
|
+
``git clone git@github.com/yourusername/sqlacodegen``.
|
|
32
|
+
#. Create a branch for your pull request, like ``git checkout -b myfixname``
|
|
33
|
+
#. Make the desired changes to the code base.
|
|
34
|
+
#. Commit your changes locally. If your changes close an existing issue, add the text
|
|
35
|
+
``Fixes #XXX.`` or ``Closes #XXX.`` to the commit message (where XXX is the issue
|
|
36
|
+
number).
|
|
37
|
+
#. Push the changeset(s) to your forked repository (``git push``)
|
|
38
|
+
#. Navigate to Pull requests page on the original repository (not your fork) and click
|
|
39
|
+
"New pull request"
|
|
40
|
+
#. Click on the text "compare across forks".
|
|
41
|
+
#. Select your own fork as the head repository and then select the correct branch name.
|
|
42
|
+
#. Click on "Create pull request".
|
|
43
|
+
|
|
44
|
+
If you have trouble, consult the `pull request making guide`_ on opensource.com.
|
|
45
|
+
|
|
46
|
+
.. _main sqlacodegen repository: https://github.com/agronholm/sqlacodegen
|
|
47
|
+
.. _pull request making guide: https://opensource.com/article/19/7/create-pull-request-github
|