-
-
Notifications
You must be signed in to change notification settings - Fork 781
Closed
Labels
questionFurther information is requestedFurther information is requested
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 SQLModel" and didn't find any information.
- I already read and followed all the tutorial in the docs and didn't find an answer.
- I already checked if it is not related to SQLModel but to Pydantic.
- I already checked if it is not related to SQLModel but to SQLAlchemy.
Commit to Help
- I commit to help with one of those options π
Example Code
from typing import Optional
from sqlmodel import SQLModel, Field
# If the actual db table is called `assets`, for example, how can I keep the following model named `Product` but have it refer to the correct table?
class Product(SQLModel, table=True):
id: Optional[int] = Field(None, primary_key=True)
name: strDescription
- I have an existing database with table names that are different than what I would like my model names to be.
- The documentation here under the "SQL Table Names" section notes that there will be information on how to do this in the "Advanced Guide," but that section has not been worked on yet...
Operating System
Linux, macOS
Operating System Details
No response
SQLModel Version
0.0.4
Python Version
3.10.0
Additional Context
No response
acmpo6ou, SamWoolerton, martinralfreindl, da115115, abhyudayasrinet and 4 morejerlich, gaurishg, sanjublk, saurabhyadavz, SamWoolerton and 1 more
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested