Object '""' does not exist or not authorized. #11364
-
I am new to sqlalchemy and I am having an issue querying Snowflake. I get this error. sqlalchemy.exc.ProgrammingError: (snowflake.connector.errors.ProgrammingError) 002003 (42S02): SQL compilation error: If I run the SQL above directly in Snowflake it gives me the same error. Seems like this might be something to do with the query syntax being generated. Surely this should be generated without the quotes. For example. SELECT Post.ID AS "Post_ID", Post.TITLE AS "Post_TITLE", Post.CONTENT AS "Post_CONTENT" This is my code. It's a very simple example so, if someone could educate me, I'd be extremely grateful.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
hi - if you dont want quotes, use all lowercase names: class Post(Base):
"""Class that represents a Post"""
__tablename__: str = "post"
id = Column(Integer, primary_key=True)
title = Column(String(100))
content = Column(String(100)) if you really want those attributes to be UPPERCASE, you can assign a separate name: class Post(Base):
"""Class that represents a Post"""
__tablename__: str = "post"
ID = Column("id", Integer, primary_key=True)
TITLE = Column("title", String(100))
CONTENT = Column("content", String(100)) |
Beta Was this translation helpful? Give feedback.
hi -
if you dont want quotes, use all lowercase names:
if you really want those attributes to be UPPERCASE, you can assign a separate name: