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
Add a Go linter for the docs/ content contract (#4584)
internal/docs validates the documentation source tree with goldmark and
runs from go test, so doc-breaking changes fail CI without any JavaScript
toolchain. It enforces the contract the external site consumer relies on:
every page parses as GFM and starts with exactly one level-1 heading;
relative links and images resolve to files inside docs/, with anchor
fragments checked against GitHub-style heading slugs; every page appears
exactly once in toc.yaml and every toc.yaml entry names a real page; no
raw HTML other than comments; and no leftover MyST directives.
Fix everything the linter found in the existing docs: convert the eight
remaining MyST admonitions to GitHub alert syntax, add the missing
level-1 heading to the embedding guide, point extensionless and .html
links (which only resolved under Sphinx) at the actual .md files, and
correct anchors that did not match GitHub slugging (#sqlcdb-prepare,
#rules-using-explain--output, #the-go_type-map, and stale
#with-other-tools fragments in the changelog).
Claude-Session: https://claude.ai/code/session_013XDcHxZk9UzfzMLayG66Zq
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/howto/overrides.md
+13-17Lines changed: 13 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,7 @@
1
1
# Overriding types
2
2
3
-
:::{note}
4
-
Type overrides and field renaming are only fully-supported for Go.
5
-
:::
3
+
> [!NOTE]
4
+
> Type overrides and field renaming are only fully-supported for Go.
6
5
7
6
In many cases it's useful to tell `sqlc` explicitly what Go type you want it to
8
7
use for a query input or output. For instance, by default when you use
@@ -39,11 +38,10 @@ sql:
39
38
go_type: "time.Time"
40
39
```
41
40
42
-
:::{tip}
43
-
A single `db_type` override configuration applies to either nullable or non-nullable
44
-
columns, but not both. If you want the same Go type to override regardless of
45
-
nullability, you'll need to configure two overrides: one with `nullable: true` and one without.
46
-
:::
41
+
> [!TIP]
42
+
> A single `db_type` override configuration applies to either nullable or non-nullable
43
+
> columns, but not both. If you want the same Go type to override regardless of
44
+
> nullability, you'll need to configure two overrides: one with `nullable: true` and one without.
47
45
48
46
## The `overrides` list
49
47
@@ -54,7 +52,7 @@ Each element in the `overrides` list has the following keys:
54
52
- `column`:
55
53
- A column name to override. The value should be of the form `table.column` but you can also specify `schema.table.column` or `catalog.schema.table.column`. `column` and `db_type` are mutually exclusive.
56
54
- `go_type`:
57
-
- The fully-qualified name of a Go type to use in generated code. This is usually a string but can also be [a map](#the-go-type-map) for more complex configurations.
55
+
- The fully-qualified name of a Go type to use in generated code. This is usually a string but can also be [a map](#the-go_type-map) for more complex configurations.
58
56
- `go_struct_tag`:
59
57
- A reflect-style struct tag to use in generated code, e.g. `a:"b" x:"y,z"`.
60
58
If you want `json` or `db` tags for all fields, configure `emit_json_tags` or `emit_db_tags` instead.
@@ -68,15 +66,13 @@ Each element in the `overrides` list has the following keys:
68
66
Note that this only applies to `db_type` overrides and has no effect on `column` overrides.
69
67
Defaults to `false`.
70
68
71
-
:::{tip}
72
-
A single `db_type` override configuration applies to either nullable or non-nullable
73
-
columns, but not both. If you want the same Go type to override regardless of nullability, you'll
74
-
need to configure two overrides: one with `nullable: true` and one without.
75
-
:::
69
+
> [!TIP]
70
+
> A single `db_type` override configuration applies to either nullable or non-nullable
71
+
> columns, but not both. If you want the same Go type to override regardless of nullability, you'll
72
+
> need to configure two overrides: one with `nullable: true` and one without.
76
73
77
-
:::{note}
78
-
When generating code, `column` override configurations take precedence over `db_type` configurations.
79
-
:::
74
+
> [!NOTE]
75
+
> When generating code, `column` override configurations take precedence over `db_type` configurations.
Copy file name to clipboardExpand all lines: docs/reference/changelog.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -548,7 +548,7 @@ Like upload, `push` should be run when you tag a release of your application. We
548
548
549
549
#### MySQL support in `createdb`
550
550
551
-
The `createdb` command, added in the last release, now supports MySQL. If you have a cloud project configured, you can use `sqlc createdb` to spin up a new ephemeral database with your schema and print its connection string to standard output. This is useful for integrating with other tools. Read more in the [managed databases](../howto/managed-databases.md#with-other-tools) documentation.
551
+
The `createdb` command, added in the last release, now supports MySQL. If you have a cloud project configured, you can use `sqlc createdb` to spin up a new ephemeral database with your schema and print its connection string to standard output. This is useful for integrating with other tools. Read more in the [managed databases](../howto/managed-databases.md) documentation.
552
552
553
553
#### Plugin interface refactor
554
554
@@ -628,7 +628,7 @@ When you have a cloud project configured, you can use the new `sqlc createdb`
628
628
command to spin up a new ephemeral database with your schema and print its
629
629
connection string to standard output. This is useful for integrating with other
Copy file name to clipboardExpand all lines: docs/reference/config.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -204,7 +204,7 @@ See [Overriding types](../howto/overrides.md) for an in-depth guide to using typ
204
204
205
205
#### kotlin
206
206
207
-
> Removed in v1.17.0 and replaced by the [sqlc-gen-kotlin](https://github.com/sqlc-dev/sqlc-gen-kotlin) plugin. Follow the [migration guide](../guides/migrating-to-sqlc-gen-kotlin) to switch.
207
+
> Removed in v1.17.0 and replaced by the [sqlc-gen-kotlin](https://github.com/sqlc-dev/sqlc-gen-kotlin) plugin. Follow the [migration guide](../guides/migrating-to-sqlc-gen-kotlin.md) to switch.
208
208
209
209
- `package`:
210
210
- The package name to use for the generated code.
@@ -215,7 +215,7 @@ See [Overriding types](../howto/overrides.md) for an in-depth guide to using typ
215
215
216
216
#### python
217
217
218
-
> Removed in v1.17.0 and replaced by the [sqlc-gen-python](https://github.com/sqlc-dev/sqlc-gen-python) plugin. Follow the [migration guide](../guides/migrating-to-sqlc-gen-python) to switch.
218
+
> Removed in v1.17.0 and replaced by the [sqlc-gen-python](https://github.com/sqlc-dev/sqlc-gen-python) plugin. Follow the [migration guide](../guides/migrating-to-sqlc-gen-python.md) to switch.
0 commit comments