简体   繁体   English

将 Typeorm 添加到我的项目后,我无法进行 postgresql 查询

[英]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 子句时,它都不允许我查询

我的 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 ,您可以使用userUser引用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 Typeorm 向 PostgresQL 数据库添加“关系”? - How do I add a `relation` to my PostgresQL database using Typeorm? 在PostgreSQL中添加全文索引会加快我使用LIKE的常规查询吗? - Will adding a full text index in PostgreSQL speed up my regular queries which use LIKE? 如何在PostgreSQL中一次查询多个SELECT? - How to make multiple SELECT queries at once in PostgreSQL? 如何使我的 PostgreSQL select 查询更短? - How can I make my PostgreSQL select query shorter? 我的SQL查询中有统计数据,该如何处理才能使我的应用程序更快? - I have statistical data on my SQL queries, what can I do with that to make my app faster? 如何在Postgresql中加入2个子查询? - How can I join 2 sub queries in postgresql? 如何将MS Access查询转换为PostgreSql查询? - How do I convert MS Access queries to PostgreSql queries? Joomla:死链接后,很多查询使我的网站性能变差 - Joomla: Lot of queries make my site-performance bad after going to dead-link 我应该在每次查询后关闭ResultSet还是在完成所有查询后将其关闭? - Should I close ResultSet after each query or close it after doing all my queries? 如何在Active Record迁移中向字段添加索引以加快查询速度? - How can I add an index to a field in my Active Record migration to make queries faster?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM