You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: utils/website/pg-sql2/api/sql-comment.md
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,15 +3,17 @@ sidebar_position: 10
3
3
title: "sql.comment()"
4
4
---
5
5
6
-
# `sql.comment(text, always)`
6
+
# `sql.comment(text, include)`
7
7
8
8
Creates an SQL comment fragment that can be embedded in queries. Comments are
9
9
useful for documenting query logic, adding debugging information, or providing
10
10
context for complex operations.
11
11
12
12
Comments are ignored during SQL execution by default but
13
-
can be valuable for debugging and maintenance; comments only appear when
14
-
[`GRAPHILE_ENV=development`](../development-mode.md) is set or if `always` is `true`.
13
+
can be valuable for debugging and maintenance. By default, comments only appear when
14
+
[`GRAPHILE_ENV=development`](../development-mode.md) is set, but you can force
15
+
them to appear by setting `include` to `true` (or force them to be hidden via
16
+
`include` set to `false`).
15
17
16
18
:::warning[Do not include user-generated content!]
17
19
@@ -24,12 +26,13 @@ vulnerable SQL.
24
26
## Syntax
25
27
26
28
```typescript
27
-
sql.comment(text: string, always: true): SQL
29
+
sql.comment(text: string, include?:boolean): SQL
28
30
```
29
31
30
32
## Parameters
31
33
32
34
-`text` - The comment text to include
35
+
-`include` - Optional boolean to force inclusion (`true`) or exclusion (`false`) of the comment regardless of environment. Defaults to `undefined`, which means comments are included only in development mode.
0 commit comments