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

Unable to run generating SQLModel PostgreSQL Arrays #66

Open
RyPeck opened this issue Jan 13, 2025 · 1 comment
Open

Unable to run generating SQLModel PostgreSQL Arrays #66

RyPeck opened this issue Jan 13, 2025 · 1 comment

Comments

@RyPeck
Copy link

RyPeck commented Jan 13, 2025

Describe the bug
omymodels unable to generate SQLModel code with Arrays.

To Reproduce
Steps to reproduce the behavior:

Run

from omymodels import create_models


ddl = """
CREATE TABLE test_table (
    id SERIAL PRIMARY KEY,
    names TEXT[]
);
"""

result = create_models(ddl, models_type='sqlmodel')['code']

print(result)

Will receive the following error -

TypeError: string indices must be integers, not 'str'

Expected behavior

SQLModel code generates without errors.

Desktop (please complete the following information):

  • OS: MacOS
  • Version [e.g. 22]
@RyPeck
Copy link
Author

RyPeck commented Jan 13, 2025

cc @cfhowes

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

No branches or pull requests

1 participant