PyCharm SQL语言注入支持 [英] PyCharm SQL Language Injection support

查看:550
本文介绍了PyCharm SQL语言注入支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用sqlite3软件包编写一些python代码. 我想将一些SQL代码放入字符串文字中. 正如我在此处所发现的那样,Python支持带有标记和编码的注入多种语言的帮助,包括SQL:

I'm writing some python code with the sqlite3 package. I want to put some SQL code into a string literal. As I found here, Python supports Injections with markup and coding assistance for several languages, including SQL:

(例如HTML,CSS,XML,SQL,RegExp等)

(such as HTML, CSS, XML, SQL, RegExp, etc.)

可悲的是,当我想尝试此功能时,我发现支持多种语言,例如HTML或JQL,但是我正在寻找SQL.

Sadly, when I want to try this feature, I found support for several languages like HTML or JQL, but I'm looking for SQL.

根据此帖子,该帖子应该可用从Pycharm 3.0开始.

According to this post, it should be available since Pycharm 3.0.

有什么方法可以运行带有标记和编码帮助的SQL语言注入?

Is there any way to get SQL Language injections with markup and coding assistance running?

推荐答案

经过长时间搜索,我找到了解决此问题的方法:

I found a solution to this problem after long search:

安装插件数据库导航器. (文件->设置->插件->浏览存储库->搜索数据库导航器)

这将为您提供对包括sqlite在内的多种SQL方言的支持. 遗憾的是,代码完成功能不支持大写.

This will provide you with support for several SQL dialects including sqlite. Sadly code-completion features don't support upper-case.

这是SQL支持的样子-第一行以大写字母表示,第二行与小写的自动完成建议

我也可以通过更改SQL的语言设置来解决此问题:
((文件->设置->编辑器-> CodeStyle-> SQL->启用大小写,将大写字母设置为您想要的位置)

I could also solve this problem by changing the language settings for SQL:
(File->Settings->Editor->CodeStyle->SQL->enable Case, set uppercase where you wish to)

这篇关于PyCharm SQL语言注入支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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