Skip to content

Commit 4ea3e27

Browse files
authored
Testable examples (#236)
* docs: Move Markdown documentation to docs * examples: Test examples as a normal package * README: Update documentation links
1 parent 663405c commit 4ea3e27

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+92
-604
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@ jobs:
2727
go-version: '1.13'
2828

2929
- name: Test sqlc
30-
run: go test -v ./...
31-
32-
- name: Test sqlc/ondeck
33-
run: go test -v ./...
34-
working-directory: internal/dinosql/testdata/ondeck
30+
run: go test --tags=examples -v ./...
3531
env:
3632
PG_USER: postgres
3733
PG_HOST: localhost

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -229,30 +229,30 @@ func (q *Queries) WithTx(tx *sql.Tx) *Queries {
229229

230230
Your favorite PostgreSQL / Go features are supported:
231231
- SQL
232-
- [SELECT](./examples/query_one.md)
233-
- [NULL](./examples/null.md)
234-
- [COUNT](./examples/query_count.md)
235-
- [INSERT](./examples/insert.md)
236-
- [UPDATE](./examples/update.md)
237-
- [DELETE](./examples/delete.md)
238-
- [RETURNING](./examples/returning.md)
239-
- [ANY](./examples/any.md)
240-
- [Transactions](./examples/transactions.md)
241-
- [Prepared queries](./examples/prepared_query.md)
232+
- [SELECT](./docs/query_one.md)
233+
- [NULL](./docs/null.md)
234+
- [COUNT](./docs/query_count.md)
235+
- [INSERT](./docs/insert.md)
236+
- [UPDATE](./docs/update.md)
237+
- [DELETE](./docs/delete.md)
238+
- [RETURNING](./docs/returning.md)
239+
- [ANY](./docs/any.md)
240+
- [Transactions](./docs/transactions.md)
241+
- [Prepared queries](./docs/prepared_query.md)
242242
- PostgreSQL Types
243-
- [Arrays](./examples/arrays.md)
244-
- [Enums](./examples/enums.md)
245-
- [Timestamps](./examples/time.md)
246-
- [UUIDs](./examples/uuid.md)
243+
- [Arrays](./docs/arrays.md)
244+
- [Enums](./docs/enums.md)
245+
- [Timestamps](./docs/time.md)
246+
- [UUIDs](./docs/uuid.md)
247247
- DDL
248-
- [CREATE TABLE](./examples/table.md)
249-
- [ALTER TABLE](./examples/alter_table.md)
248+
- [CREATE TABLE](./docs/table.md)
249+
- [ALTER TABLE](./docs/alter_table.md)
250250
- Go
251-
- [JSON struct tags](./examples/json_tags.md)
252-
- [Migration tools](./examples/migrations.md)
251+
- [JSON struct tags](./docs/json_tags.md)
252+
- [Migration tools](./docs/migrations.md)
253253

254254
A full, end-to-end example can be found in the sample
255-
[`ondeck`](./internal/dinosql/testdata/ondeck) package.
255+
[`ondeck`](./examples/ondeck) package.
256256

257257
## Usage
258258

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)