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

agronholm / sqlacodegen
98%

Build:
DEFAULT BRANCH: master
Repo Added 28 Dec 2016 02:40PM UTC
Files 11
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

LAST BUILD ON BRANCH master
branch: SELECT
CHANGE BRANCH
x
  • No branch selected
  • 2.0.0
  • 2.0.1
  • 2.1.0
  • 2.2.0
  • 2.3.0
  • autoincrement-multiple-primary-keys
  • better-field-name-for-relationships
  • cli-schemas-arg-spaces
  • dependabot
  • dependabot/github_actions/dot-github/workflows/actions/download-artifact-4.1.7
  • dependabot/github_actions/github-actions-7d67a68ff8
  • dependabot/github_actions/github-actions-985357984d
  • domain_check_textclause
  • double-pluralization-of-names
  • enum-generation-value-mapping
  • feat.support_dialect
  • feature/multi-file-output-pr
  • filter-empty-dialect-args
  • fix-285-char-collation
  • fix-465
  • fix-510
  • fix-issue340-pgvector-genarating
  • fix-mysql-double
  • fix-sqlmodel-onetomany-multiref
  • fix-tablename-pylance-types-and-add-missing-metadata-ref-for-sqlmodel-tables
  • fix-typedecorator-adapt
  • fix-usertypes-adapt
  • fix/identity-decimal-serialization
  • fix/mssql-sysname-reflection
  • fix/postgresql-array-dialect-type
  • fix/use-logging-instead-of-print
  • maintainer
  • master
  • pre-commit-ci-update-config
  • precommit-quarterly
  • py314
  • python-native-enums
  • remove-engine-dependency
  • render_column_type
  • security-policy
  • shared-name-import-fix
  • sheinbergon/constraint-sa-version
  • sheinbergon/domains-inherited-from-json
  • sheinbergon/enum-generation-fixes
  • sheinbergon/explicit_nullability_definition
  • sheinbergon/not-implemented-python-type-handling
  • sheinbergon/sqlalchemy-2_0_42-regression-fix
  • spdx-license
  • support-enum-arrays
  • tidelift

08 Jun 2026 05:20AM UTC coverage: 97.794% (-0.05%) from 97.839%
27117669432

push

github

web-flow
Preserve dialect-specific ARRAY types instead of adapting to generic ARRAY (#480)

When reflecting a PostgreSQL ``text[]`` (or any dialect-specific ARRAY) column, sqlacodegen previously walked the type's MRO in ``get_adapted_type`` and substituted ``sqlalchemy.dialects.postgresql.ARRAY`` with the generic ``sqlalchemy.ARRAY``. The generic ARRAY does not implement operators like ``.contains()``, ``.any()`` or ``.all()`` -- calling them on a generated model raises::

    NotImplementedError: ARRAY.contains() not implemented for the base ARRAY type; please use the dialect-specific ARRAY type

The workaround was to pass ``--options keep_dialect_types``, but that also forces every other type back to its dialect-specific form (``INTEGER`` instead of ``Integer``, etc.), which is more than the user wants.

This change special-cases ARRAY in ``get_adapted_type``: when the column type is a subclass of the generic ARRAY (i.e. a dialect-specific ARRAY), the original class is kept and only the item type is adapted. Plain generic ``sqlalchemy.ARRAY`` inputs are unaffected, and no other type's adaptation behavior changes.

The existing ``test_arrays`` is updated to expect the dialect-specific import, and a new ``test_array_preserves_dialect_for_runtime_operators`` test locks in the regression scenario described in the issue.

Fixes #441.

7 of 7 new or added lines in 2 files covered. (100.0%)

1 existing line in 1 file now uncovered.

1862 of 1904 relevant lines covered (97.79%)

4.89 hits per line

Relevant lines Covered
Build:
Build:
1904 RELEVANT LINES 1862 COVERED LINES
4.89 HITS PER LINE
Source Files on master
  • Tree
  • List 11
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
27117669432 master Preserve dialect-specific ARRAY types instead of adapting to generic ARRAY (#480) When reflecting a PostgreSQL ``text[]`` (or any dialect-specific ARRAY) column, sqlacodegen previously walked the type's MRO in ``get_adapted_type`` and substituted... push 08 Jun 2026 05:21AM UTC web-flow github
97.79
27097745110 fix/postgresql-array-dialect-type Merge 32c2eed01 into 42b3b39a3 Pull #480 07 Jun 2026 04:08PM UTC web-flow github
97.79
27067649426 fix/postgresql-array-dialect-type Merge ff9f661c2 into 42b3b39a3 Pull #480 06 Jun 2026 04:28PM UTC web-flow github
97.79
26876120067 feature/multi-file-output-pr Merge 03464f21f into 42b3b39a3 Pull #479 03 Jun 2026 09:31AM UTC web-flow github
97.8
26856935252 feature/multi-file-output-pr Merge 4dede9450 into 42b3b39a3 Pull #479 03 Jun 2026 12:50AM UTC web-flow github
97.8
24046095339 master [pre-commit.ci] pre-commit autoupdate (#477) updates: - [github.com/astral-sh/ruff-pre-commit: v0.14.10 → v0.15.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.14.10...v0.15.9) - [github.com/pre-commit/mirrors-mypy: v1.19.1 → v1.20.0](... push 06 Apr 2026 06:59PM UTC web-flow github
97.84
24043627213 pre-commit-ci-update-config Merge 1cb8434a1 into f91638770 Pull #477 06 Apr 2026 06:00PM UTC web-flow github
97.84
23857140736 fix/use-logging-instead-of-print Merge fea7cf8cd into f91638770 Pull #476 01 Apr 2026 03:40PM UTC web-flow github
97.84
23857127459 fix/use-logging-instead-of-print Merge 1687c77af into f91638770 Pull #476 01 Apr 2026 03:40PM UTC web-flow github
97.84
23846115828 master Autoincrement multiple primary keys (#474) * feat(added autoincrement to primary key columns) * test(added test to show autoincrement behavior works) * update(added new changelog) * [pre-commit.ci] auto fixes from pre-commit.com hooks for mor... push 01 Apr 2026 11:23AM UTC web-flow github
97.84
See All Builds (643)
  • Repo on GitHub
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