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
{{ message }}
Repository navigation
Commit 7cec97c
Browse filesBrowse the repository at this point in the historyBrowse files
examples: make the examples a module of their own, and run Spanner Omni in CI
The examples' drivers were becoming dependencies of sqlc itself, and the
DuckDB driver, being cgo, had to live in a module apart. Move every
example into one module under examples/, which requires sqlc through a
replace, so the drivers are its dependencies alone and cgo can stay on
for all of it; sqlc's own go.mod loses them, and lib/pq with them, since
only the examples imported it. The DuckDB example rejoins the authors
example beside the others, and the test helpers for ClickHouse, SQL
Server and Spanner move into the examples module, since the drivers they
need are what kept them out of sqlc. The end-to-end suite skips the
directory under examples that holds those helpers rather than treating
it as an example.
sqlc-test-setup now installs Spanner Omni from its standalone server
release, checked against a pinned SHA-256, and starts a single server in
the background on port 15000, so CI runs the Spanner example against it
alongside the ClickHouse and SQL Server services. The Makefile and CI
run the examples from their module.
Drop the clearing of a column's type expression in combineAnalysis: the
compiler builds a live-database analyzer only on the legacy path and
returns before doing so on the core path, so the two never meet and the
expression is never set where the analyzer runs.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015rfiHyC4iRLyRWc3UmYEtT
Copy file name to clipboardExpand all lines: CLAUDE.md
+14-5Lines changed: 14 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ This document provides essential information for working with the sqlc codebase,
12
12
13
13
## Database Setup with sqlc-test-setup
14
14
15
-
The `sqlc-test-setup` tool (`cmd/sqlc-test-setup/`) automates installing and starting PostgreSQLand MySQL for tests. Both commands are idempotent and safe to re-run.
15
+
The `sqlc-test-setup` tool (`cmd/sqlc-test-setup/`) automates installing and starting PostgreSQL, MySQL and Spanner Omni for tests. Both commands are idempotent and safe to re-run.
16
16
17
17
### Install databases
18
18
@@ -24,6 +24,7 @@ This will:
24
24
- Configure the apt proxy (if `http_proxy` is set, e.g. in Claude Code remote environments)
25
25
- Install PostgreSQL via apt
26
26
- Download and install MySQL 26.7 from Oracle's deb bundle
27
+
- Download the Spanner Omni standalone server release into the user cache (linux/amd64 only)
27
28
- Resolve all dependencies automatically
28
29
- Skip anything already installed
29
30
@@ -36,12 +37,16 @@ go run ./cmd/sqlc-test-setup start
36
37
This will:
37
38
- Start PostgreSQL and configure password auth (`postgres`/`postgres`)
38
39
- Start MySQL via `mysqld_safe` and set root password (`mysecretpassword`)
39
-
- Verify both connections
40
+
- Start a Spanner Omni single server in the background, serving plaintext gRPC on port 15000
41
+
- Verify the connections
40
42
- Skip steps that are already done (running services, existing config)
ClickHouse and SQL Server are not installed by the tool; `docker-compose.yml` runs them locally and CI runs them as services. Their tests read `CLICKHOUSE_SERVER_URI` and `MSSQL_SERVER_URI` and skip when unset.
45
50
46
51
### Run tests
47
52
@@ -172,9 +177,13 @@ them as an artifact.
172
177
173
178
### Example Tests
174
179
175
-
-**Location:**`/examples/` directory
176
-
-**Requirements:** Tagged with "examples", requires live databases
0 commit comments