TypeORM 是否支持输入和输出的原始 SQL 查询? [英] Does TypeORM supports raw SQL queries for input and output?

查看:66
本文介绍了TypeORM 是否支持输入和输出的原始 SQL 查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道TypeORM是否有一个功能支持插入更新删除选择等的原始sql查询.

I would like to know if there is a feature of TypeORM that supports raw sql queries for Insert Update Delete Select etc..

推荐答案

根据这个 issue comment,TypeORM 使您可以使用任何查询到您的心的内容.使用 entityManager.query() 这是文档.

According to this issue comment, TypeORM enables you to use any queries to your heart's content. using entityManager.query() Here is the documentation.

更新

上面的链接已过时,请尝试使用 entity-manager-api.>

Link above is outdated, try this instead entity-manager-api.

const rawData = await manager.query(`SELECT * FROM USERS`);

这篇关于TypeORM 是否支持输入和输出的原始 SQL 查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆