Skip to content

Commit bc37e81

Browse files
committed
docs: Add v1.19 release notes
1 parent 1fea9f7 commit bc37e81

File tree

10 files changed

+557
-18
lines changed

10 files changed

+557
-18
lines changed

docs/_static/customize.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
11
.wy-side-nav-search img {
22
padding: 5px 60px !important;
33
}
4+
5+
#banner {
6+
text-align: center;
7+
background: #2980b9;
8+
border: 1px solid rgb(52, 49, 49);
9+
color: #F0F0F4;
10+
padding: 10px;
11+
margin-bottom: 1.618em;
12+
}
13+
14+
#banner > div > a {
15+
color: #F0F0F4;
16+
text-decoration: underline;
17+
}

docs/_templates/breadcrumbs.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{% extends "!breadcrumbs.html" %}
2+
3+
{% block breadcrumbs %}
4+
{% if show_banner %}
5+
<header id="banner">
6+
<div><strong>Big news:</strong> we're working full-time on sqlc. Read more <a href="https://sqlc.dev/posts/2023/07/06/working-on-sqlc-full-time">here</a>.</div>
7+
</header>
8+
{% endif %}
9+
{{ super() }}
10+
{% endblock %}

docs/_templates/layout.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{% extends "!layout.html" %}
2+
23
{% block extrahead %}
34
<script defer data-domain="docs.sqlc.dev" src="https://plausible.io/js/plausible.js"></script>
45
{{ super() }}
5-
{% endblock %}
6+
{% endblock %}

docs/conf.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# add these directories to sys.path here. If the directory is relative to the
1111
# documentation root, use os.path.abspath to make it absolute, like shown here.
1212
#
13-
# import os
13+
import os
1414
# import sys
1515
# sys.path.insert(0, os.path.abspath('.'))
1616
import sphinx_rtd_theme
@@ -22,7 +22,7 @@
2222
author = 'Kyle Conroy'
2323

2424
# The full version, including alpha/beta/rc tags
25-
release = '1.18.0'
25+
release = '1.19.0'
2626

2727

2828
# -- General configuration ---------------------------------------------------
@@ -61,6 +61,10 @@
6161
'logo_only': True,
6262
}
6363

64+
html_context = {
65+
'show_banner': 'SHOW_LAUNCH_BANNER' in os.environ,
66+
}
67+
6468
def setup(app):
6569
app.add_css_file('customize.css')
6670

docs/howto/ci-cd.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Suggested CI/CD setup
2+
3+
If your project has more than a single developer, we suggest running `sqlc` as
4+
part of your CI/CD pipeline. The two commands you'll want to run are `diff` and `vet`
5+
6+
`sqlc diff` ensures that code is up to date. New developers to a project may
7+
forget to run `sqlc generate`. They also might edit generated code. `diff` will
8+
catch both scenarios.
9+
10+
```diff
11+
% sqlc-dev diff
12+
--- a/postgresql/query.sql.go
13+
+++ b/postgresql/query.sql.go
14+
@@ -55,7 +55,7 @@
15+
16+
const listAuthors = `-- name: ListAuthors :many
17+
SELECT id, name, bio FROM authors
18+
-ORDER BY name
19+
+ORDER BY bio
20+
`
21+
```
22+
23+
`sqlc vet` runs a set of lint checks against your SQL queries. These checks are
24+
helpful in catching anti-patterns before they make it into production. Please
25+
see the [vet](../reference/cli.html#vet) documentation for a complete guide on adding checks to your
26+
project.
27+
28+
## General setup
29+
30+
Install `sqlc` using the [suggested instructions](../overview/install).
31+
32+
Create two steps in your pipelines, one for `sqlc diff`and one for `sqlc vet`.
33+
34+
## GitHub Actions
35+
36+
We provide the [setup-sqlc](https://github.com/marketplace/actions/setup-sqlc)
37+
GitHub Action to install `sqlc`. The action uses the built-in
38+
[tool-cache](https://github.com/actions/toolkit/blob/main/packages/tool-cache/README.md)
39+
to speed up the installation process.
40+
41+
The following workflow runs `sqlc diff` on every push.
42+
43+
```yaml
44+
name: sqlc
45+
on: [push]
46+
jobs:
47+
diff:
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@v3
51+
- uses: sqlc-dev/setup-sqlc@v3
52+
with:
53+
sqlc-version: '1.19.0'
54+
- run: sqlc diff
55+
```
56+
57+
We also encourage running [`sqlc vet`](../reference/cli.html#vet). To get the most value out of `vet`,
58+
you'll want to set up a running database. See the [vet] documentation for a
59+
complete guide on adding checks to your project.
60+
61+
```yaml
62+
name: sqlc
63+
on: [push]
64+
jobs:
65+
vet:
66+
runs-on: ubuntu-latest
67+
services:
68+
postgres:
69+
image: "postgres:15"
70+
env:
71+
POSTGRES_DB: postgres
72+
POSTGRES_PASSWORD: postgres
73+
POSTGRES_USER: postgres
74+
ports:
75+
- 5432:5432
76+
# needed because the postgres container does not provide a healthcheck
77+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
78+
env:
79+
PG_PORT: ${{ job.services.postgres.ports['5432'] }}
80+
81+
steps:
82+
- uses: actions/checkout@v3
83+
- uses: sqlc-dev/setup-sqlc@v3
84+
with:
85+
sqlc-version: '1.19.0'
86+
# Connect and migrate your database here. This is an example which runs
87+
# commands from a `schema.sql` file.
88+
- run: psql -h localhost -U postgres -p $PG_PORT -d postgres -f schema.sql
89+
env:
90+
PGPASSWORD: postgres
91+
- run: sqlc vet
92+
```

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ code ever again.
5454
howto/ddl.md
5555
howto/structs.md
5656

57+
howto/ci-cd.md
5758
howto/upload.md
5859

5960
.. toctree::

docs/overview/install.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ docker run --rm -v "%cd%:/src" -w /src kjconroy/sqlc generate
4848

4949
## Downloads
5050

51-
Get pre-built binaries for *v1.18.0*:
51+
Get pre-built binaries for *v1.19.0*:
5252

53-
- [Linux](https://github.com/kyleconroy/sqlc/releases/download/v1.18.0/sqlc_1.18.0_linux_amd64.tar.gz)
54-
- [macOS](https://github.com/kyleconroy/sqlc/releases/download/v1.18.0/sqlc_1.18.0_darwin_amd64.zip)
55-
- [Windows (MySQL only)](https://github.com/kyleconroy/sqlc/releases/download/v1.18.0/sqlc_1.18.0_windows_amd64.zip)
53+
- [Linux](https://github.com/kyleconroy/sqlc/releases/download/v1.19.0/sqlc_1.19.0_linux_amd64.tar.gz)
54+
- [macOS](https://github.com/kyleconroy/sqlc/releases/download/v1.19.0/sqlc_1.19.0_darwin_amd64.zip)
55+
- [Windows (MySQL only)](https://github.com/kyleconroy/sqlc/releases/download/v1.19.0/sqlc_1.19.0_windows_amd64.zip)
5656

5757
See [downloads.sqlc.dev](https://downloads.sqlc.dev/) for older versions.

0 commit comments

Comments
 (0)