Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guanzhongcai/sqlstatementquote
给SQL语句中的字段名和表名添加双引号
https://github.com/guanzhongcai/sqlstatementquote
Last synced: about 2 months ago
JSON representation
给SQL语句中的字段名和表名添加双引号
- Host: GitHub
- URL: https://github.com/guanzhongcai/sqlstatementquote
- Owner: guanzhongcai
- Created: 2020-12-24T01:54:05.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2020-12-24T02:03:21.000Z (about 4 years ago)
- Last Synced: 2023-08-07T02:07:56.052Z (over 1 year ago)
- Language: C++
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SqlStatementQuote
给SQL语句中的字段名和表名添加双引号## example
把sql语句中的字段名和表名:
``` sql
select Id, PatientName from Person where "Id"=:id
```
添加双引号:
``` sql
select "Id", "PatientName" from "Person" where "Id"=:id
```在使用[soci](http://soci.sourceforge.net/doc/release/4.0/)项目访问postgresql时,因为后者是大小写敏感的,所以sql语句中字段名和表名需要添加双引号。为了解决编码过程中不需要写很多\"的转义字符,封装了此wrapper类.