First Check
Commit to Help
Example Code
# SELECT * FROM XYZ.test_sqlmodel
# My table doesnt exit in dbo. It exists in XYZ schema
from typing import Optional
from sqlmodel import Field, Session, SQLModel, create_engine, select
from sqlalchemy import event
class test_sqlmodel(SQLModel, table=True):
id: Optional[int] = Field(default=None, primary_key=True)
name: str
path = 'mssql+pymssql://uid:owd@server/db'
engine = create_engine(path)
def select_tbl():
with Session(engine) as session:
statement = select(test_sqlmodel)
results = session.exec(statement)
for row in results:
print(row)
select_tbl()
Description
When I run the example code, it works as long as my table test_sqlmodel exists in the default schema. But, how can I create a sql model that points to a different one?
Operating System
Linux
Operating System Details
Red Hat 7
SQLModel Version
0.0.4
Python Version
Python 3.8.10
Additional Context
No response
First Check
Commit to Help
Example Code
Description
When I run the example code, it works as long as my table
test_sqlmodelexists in the default schema. But, how can I create a sql model that points to a different one?Operating System
Linux
Operating System Details
Red Hat 7
SQLModel Version
0.0.4
Python Version
Python 3.8.10
Additional Context
No response