Title: `sqlalchemy.Column` parameters are not passed forward when set on `sqlmodel.Field` and a column is provided via `sa_column` · Issue #314 · fastapi/sqlmodel · GitHub
Open Graph Title: `sqlalchemy.Column` parameters are not passed forward when set on `sqlmodel.Field` and a column is provided via `sa_column` · Issue #314 · fastapi/sqlmodel
X Title: `sqlalchemy.Column` parameters are not passed forward when set on `sqlmodel.Field` and a column is provided via `sa_column` · Issue #314 · fastapi/sqlmodel
Description: First Check I added a very descriptive title to this issue. I used the GitHub search to find a similar issue and didn't find it. I searched the SQLModel documentation, with the integrated search. I already searched in Google "How to X in...
Open Graph Description: First Check I added a very descriptive title to this issue. I used the GitHub search to find a similar issue and didn't find it. I searched the SQLModel documentation, with the integrated search. I...
X Description: First Check I added a very descriptive title to this issue. I used the GitHub search to find a similar issue and didn't find it. I searched the SQLModel documentation, with the integrated searc...
Opengraph URL: https://github.com/fastapi/sqlmodel/issues/314
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`sqlalchemy.Column` parameters are not passed forward when set on `sqlmodel.Field` and a column is provided via `sa_column`","articleBody":"### First Check\n\n- [X] I added a very descriptive title to this issue.\n- [X] I used the GitHub search to find a similar issue and didn't find it.\n- [X] I searched the SQLModel documentation, with the integrated search.\n- [X] I already searched in Google \"How to X in SQLModel\" and didn't find any information.\n- [X] I already read and followed all the tutorial in the docs and didn't find an answer.\n- [X] I already checked if it is not related to SQLModel but to [Pydantic](https://github.com/samuelcolvin/pydantic).\n- [X] I already checked if it is not related to SQLModel but to [SQLAlchemy](https://github.com/sqlalchemy/sqlalchemy).\n\n### Commit to Help\n\n- [X] I commit to help with one of those options 👆\n\n### Example Code\n\n```python\nname: str = Field(\r\n sa_column=Column(\r\n String,\r\n # ... other attrs not exposed in sqlmodel.Field today\r\n ),\r\n index=True # this is ignored, must be set on `Column` above\r\n)\n```\n\n\n### Description\n\n`sqlmodel.Field` exposes some but not all fields from `sqlalchemy.Column`. This means in some cases it is necessary to provide a `Column` via the `sa_column=` param on `sqlmodel.Field`. However, when this is the case the parameters set on `sqlmodel.Field` are not forwarded to the new `sa_column` object. \r\n\r\nI think the expected behavior here is that parameters set on `Field` would be combined with those from the `sa_column` object. Either this or setting a parameter that will be ignored should trigger a warning/exception along the lines of `\"You have set index but also provided a sqlalchemy.Column object, index will be ignored\"`.\n\n### Operating System\n\nLinux\n\n### Operating System Details\n\n_No response_\n\n### SQLModel Version\n\n0.0.6\n\n### Python Version\n\n3.9.5\n\n### Additional Context\n\n_No response_","author":{"url":"https://github.com/JLHasson","@type":"Person","name":"JLHasson"},"datePublished":"2022-04-26T18:59:26Z","url":"https://github.com/fastapi/sqlmodel/issues/314"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c4ab92ae-0703-06ce-4de1-d68f26a92d8d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D06A:2AB11:A1967B:E2657B:6AFE20AE |
| html-safe-nonce | 2a85f14edb6633b531d57c0a187eb8d967e503dd5a67f847aa483f78f92fa188 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMDZBOjJBQjExOkExOTY3QjpFMjY1N0I6NkFGRTIwQUUiLCJ2aXNpdG9yX2lkIjoiMzc3NzQ1ODcwMzk1NTc5NjE0MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8ec27100b77081eb6df480b95cb6aeadf6280dbb2cdf5ff9a73c9aebb8b48c52 |
| hovercard-subject-tag | issue:1216357112 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/fastapi/sqlmodel/314/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1cb1c8814c50b408c757b790309b318d05049251d397933e10b2a93e0e9467bd/fastapi/sqlmodel/issues/314 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1cb1c8814c50b408c757b790309b318d05049251d397933e10b2a93e0e9467bd/fastapi/sqlmodel/issues/314 |
| og:image:alt | First Check I added a very descriptive title to this issue. I used the GitHub search to find a similar issue and didn't find it. I searched the SQLModel documentation, with the integrated search. I... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JLHasson |
| hostname | github.com |
| expected-hostname | github.com |
| None | e973f9ec3625f3faad8cac5c2d11a214b7ffe45f3cc563b828459b290ecaeed3 |
| turbo-cache-control | no-preview |
| go-import | github.com/fastapi/sqlmodel git https://github.com/fastapi/sqlmodel.git |
| octolytics-dimension-user_id | 156354296 |
| octolytics-dimension-user_login | fastapi |
| octolytics-dimension-repository_id | 399495186 |
| octolytics-dimension-repository_nwo | fastapi/sqlmodel |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 399495186 |
| octolytics-dimension-repository_network_root_nwo | fastapi/sqlmodel |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1f92c367595b9190e0be293896078033886b1913 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width