gogf / gf

GoFrame is a modular, powerful, high-performance and enterprise-class application development framework of Golang.
https://goframe.org
MIT License
11.46k stars 1.57k forks source link

database Statement splicing suggestions #3165

Open yimuysl001 opened 9 months ago

yimuysl001 commented 9 months ago

目前dm和sqlserver 拼接语句存在bug,如果是数据库自带的关键字作为字段名称,sql语句执行会报错。目前mysql 是加 “``”符号处理的,但dm和sqlserver 不支持此特殊符号,建议的是dm也在底层加一下 "" ,SQLSERVER加一下[],避免执行报错

Issues-translate-bot commented 9 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Currently, there is a bug in the splicing statements of dm and sqlserver. If the keywords that come with the database are used as field names, an error will be reported when the sql statement is executed. Currently, mysql is processed by adding the "``" symbol, but dm and sqlserver do not support this special symbol. It is recommended that dm also add "" at the bottom and SQLSERVER add [] to avoid execution errors