ApiLogicServer / ApiLogicServer-src

Create an executable project (API and Admin App) from a database or natural language prompt with 1 command, customize with declarative rules and Python in your IDE, containerize and deploy.
https://apilogicserver.github.io/Docs/
BSD 3-Clause "New" or "Revised" License
30 stars 5 forks source link

MySQL CHAR type inserts 'String' into the model.py import dialect #26

Closed tylerm007 closed 11 months ago

tylerm007 commented 11 months ago

File "/Users/tylerband/dev/ApiLogicServer/stress_mysql/database/models.py", line 3, in from sqlalchemy.dialects.mysql import BIGINT, BIT, CHAR, INTEGER, MEDIUMINT, SET, SMALLINT, String, TIME, TIMESTAMP, TINYINT, TINYTEXT, VARCHAR, YEAR ImportError: cannot import name 'String' from 'sqlalchemy.dialects.mysql' (/Users/tylerband/dev/ApiLogicServer/venv/lib/python3.11/site-packages/sqlalchemy/dialects/mysql/init.py)

tylerm007 commented 11 months ago

codegen.py - should always be from the root package. if type_name == "CHAR":

render_column_type() uses String for CHAR (e.g., oracle hr.countries)

        self.add_literal_import("sqlalchemy", 'String') 
tylerm007 commented 11 months ago

9ba410f..0f7c869 main -> main PUSH FIX - tested