Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL DOUBLE(11,2) is converted to Double(11, True) #335

Closed
2 tasks done
luliangce opened this issue Jun 18, 2024 · 0 comments · Fixed by #371
Closed
2 tasks done

MySQL DOUBLE(11,2) is converted to Double(11, True) #335

luliangce opened this issue Jun 18, 2024 · 0 comments · Fixed by #371
Assignees
Labels
Milestone

Comments

@luliangce
Copy link

Things to check first

  • I have searched the existing issues and didn't find my bug already reported there

  • I have checked that my bug is still present in the latest release

Sqlacodegen version

3.0.0rc5

SQLAlchemy version

2.0.29

RDBMS vendor

MySQL (or compatible)

What happened?

when generate from this table

CREATE TABLE `demo` (
  `type_double` double(11,2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

result below

from sqlalchemy import Column, Double, MetaData, Table

metadata = MetaData()


t_demo = Table(
    'demo', metadata,
    Column('type_double', Double(11, True)) # this code  absolutely not working
)

according the code, this is a hack for postgresql float , but didn't check dialect

https://github.com/agronholm/sqlacodegen/blob/3.0.0rc5/src/sqlacodegen/generators.py#L690

Database schema for reproducing the bug

CREATE TABLE demo (
type_double double(11,2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants