[英]After adding Typeorm to My project I cannot make postgresql queries
Whenver I go to my pgAdmin query console and fire a query then I am not able to query the tables created by TypeOrm当我 go 到我的 pgAdmin 查询控制台并触发查询时,我无法查询由 TypeOrm 创建的表
But whenever I am adding a where clause it does not allow me to query但是,每当我添加 where 子句时,它都不允许我查询
Can someone guide me why can't I query or what mistake am I making here?有人可以指导我为什么我不能查询或我在这里犯了什么错误?
You are mixing up "
and '
. You have to use "
for identifiers (like tablenames, "User"
), but normal strings have to be surrounded with '
( 'Hey'
).您正在混淆
"
和'
。您必须使用"
作为标识符(如表名, "User"
),但普通字符串必须用'
( 'Hey'
) 包围。
So the correct version of you statement is:所以你声明的正确版本是:
SELECT *
FROM "User"
WHERE name = 'Hey';
Small sidenote: It is mostly seen as bad practice to use upper-case identifiers, as you need to quote them with "
always. Usually, the tablename would be user
and you can refer to it using user
or User
.小旁注:使用大写标识符通常被视为不好的做法,因为您需要用
"
总是引用它们。通常,表名是user
,您可以使用user
或User
引用它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.