Skip to content

Commit ca6b46d

Browse files
authored
docs: Split docs into four sections (#882)
1 parent d978853 commit ca6b46d

28 files changed

+495
-530
lines changed

docs/README.md

Lines changed: 0 additions & 504 deletions
This file was deleted.

docs/guides/development.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Developing sqlc
2+
3+
## Building
4+
5+
For local development, install `sqlc` under an alias. We suggest `sqlc-dev`.
6+
7+
```
8+
go build -o ~/go/bin/sqlc-dev ./cmd/sqlc
9+
```
10+
11+
## Running Tests
12+
13+
```
14+
go test ./...
15+
```
16+
17+
To run the tests in the examples folder, use the `examples` tag.
18+
19+
```
20+
go test --tags=examples ./...
21+
```
22+
23+
These tests require locally-running database instances. Run these databases
24+
using [Docker Compose](https://docs.docker.com/compose/).
25+
26+
```
27+
docker-compose up -d
28+
```
29+
30+
The tests use the following environment variables to connect to the
31+
database
32+
33+
### For PostgreSQL
34+
35+
```
36+
Variable Default Value
37+
-------------------------
38+
PG_HOST 127.0.0.1
39+
PG_PORT 5432
40+
PG_USER postgres
41+
PG_PASSWORD mysecretpassword
42+
PG_DATABASE dinotest
43+
```
44+
45+
### For MySQL
46+
47+
```
48+
Variable Default Value
49+
-------------------------
50+
MYSQL_HOST 127.0.0.1
51+
MYSQL_PORT 3306
52+
MYSQL_USER root
53+
MYSQL_ROOT_PASSWORD mysecretpassword
54+
MYSQL_DATABASE dinotest
55+
```
56+
57+
## Regenerate expected test output
58+
59+
If you need to update a large number of expected test output in the
60+
`internal/endtoend/testdata` directory, run the `regenerate.sh` script.
61+
62+
```
63+
make regen
64+
```
65+
66+
Note that this uses the `sqlc-dev` binary, not `sqlc` so make sure you have an
67+
up to date `sqlc-dev` binary.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)