• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

agronholm / sqlacodegen / 19762862247
97%

Build:
DEFAULT BRANCH: master
Ran 28 Nov 2025 11:44AM UTC
Jobs 1
Files 11
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Nov 2025 11:43AM UTC coverage: 97.36% (-0.3%) from 97.64%
19762862247

push

github

web-flow
Add support for rendering dialect kwargs and info, and introduce keep-dialect-types option (#438)

* [Add support for rendering dialect kwargs and info; introduce keep-dialect-types option

### Summary
- Render `Table`/`Column` dialect-specific kwargs and `info` in
generated code.
- Add `keep-dialect-types` generator option to preserve dialect-specific
column types instead of adapting to generic SQLAlchemy types.

### Motivation
- Some dialect features (e.g., engine/storage params, partitioning,
materialized view metadata) are carried in SQLAlchemy `dialect_kwargs`
or `info` but weren’t emitted by sqlacodegen.
- For custom dialects with their own Column types, the current type
“adaptation” step collapses them into generic SQLAlchemy types, losing
fidelity.

### What’s changed
- Render dialect kwargs and info
- Table (Core): include table-level `dialect_kwargs` and `info` in
`Table(...)` kwargs.
- Column (Core/ORM): include column-level `dialect_kwargs` and `info`
in `Column(...)` / `mapped_column(...)`.
- Declarative: include table-level `dialect_kwargs` and `info` in
`__table_args__` dict.
- New option: keep-dialect-types
  - Generator option: `keep_dialect_types`.
  - CLI flag: `--options=keep_dialect_types`.
- Behavior: gates only the type adaptation step in
`fix_column_types()`; Boolean/Enum inference and PostgreSQL sequence
handling remain intact.

### Usage examples

- Core (Table)

```python
t_orders = Table(
    'orders',
    metadata,
    Column('id', INTEGER, primary_key=True, starrocks_aggr_type='SUM'),
    schema='public',
    comment='orders table',

    info={'table_kind': 'view'}
)
```

- Declarative (`__table_args__`)

```python
class Orders(Base):
    __tablename__ = 'orders'
    __table_args__ = (
        {
            'schema': 'public',
            'comment': 'orders table',
            'info': {'table_kind': 'view'},
	    'starrocks_properties': {'replication_num': '1'},
        }
    )
id: Mapped[INTEGER] = mapped_column(primary_... (continued)

71 of 77 new or added lines in 3 files covered. (92.21%)

1512 of 1553 relevant lines covered (97.36%)

4.86 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
99.43
-0.57% tests/test_generator_tables.py
5
96.61
-0.46% src/sqlacodegen/generators.py
Jobs
ID Job ID Ran Files Coverage
1 19762862247.1 28 Nov 2025 11:44AM UTC 11
97.36
GitHub Action Run
Source Files on build 19762862247
  • Tree
  • List 11
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #19762862247
  • dbf04982 on github
  • Prev Build on master (#19193349534)
  • Next Build on master (#19788695672)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc