specify different column names in SQLModel to match different naming convention #576
Unanswered
matthiasburger
asked this question in
Questions
Replies: 1 comment 2 replies
-
We are using SA Column for this. Had an
So you would do:
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
Our SQL-naming conventions are, that the column-names are written in camelCase. So we should have
managerId
instead ofmanager_id
. But in python we want to use the correct python naming convention in snake_case.I tried to use the event with column_reflect from SQLAlchemy, but it doesn't work - and doesn't change my column names.
edit: I don't want to change each single column, but more change the columns names dynamically with a function. Like the
def __tablename__(cls):
thingy for table-names.Operating System
Windows, macOS
Operating System Details
No response
SQLModel Version
0.0.8
Python Version
3.10.10
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions