Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: added documentations for raw query #82

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

nekomeowww
Copy link
Contributor

@nekomeowww nekomeowww commented Jan 15, 2024

Signed-off-by: Neko Ayaka <neko@ayaka.moe>
Signed-off-by: Neko Ayaka <neko@ayaka.moe>
Copy link
Member

@windsonsea windsonsea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

Signed-off-by: Neko Ayaka <neko@ayaka.moe>
| `whereSQLStatement` | `string` | SQL 语句的 `WHERE` 子句正文。可直接替换现有的 `whereSQL` 字段。通过使用 `?` 作为参数占位符(与 GORM 兼容),允许调用方更安全地发送原生 SQL 查询。 |
| `whereSQLParam` | `string`,`string[]` | 将在 SQL 语句的 `WHERE` 子句中使用的 SQL 语句的实际参数。此字段仅在设置了 `whereSQLStatement` 时有效,否则将被忽略。 |
| `whereSQLJSONParams` | `any[]` | 工作原理与 `whereSQLParam`相同,但在使用 `IN` 或 `JSON` 操作符时,调用方可以通过这个参数发送数组和更复杂的参数。支持任意的 JSON 数组字符串,并且由于查询字符串不能包含 `[]`(方括号),因此需要进行 `base64` 编码。该字段仅在设置了 `whereSQLStatement` 时有效,否则将被忽略。 |

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以加一个 whereSQLParam 和 whereSQLJSONParam 同时传递的描述

Signed-off-by: Neko Ayaka <neko@ayaka.moe>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants