Skip to content

Commit bfe7127

Browse files
change examples directory structure (#116)
* change examples directory structure * fix generate_examples script
1 parent a62e489 commit bfe7127

17 files changed

Lines changed: 71 additions & 88 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ jobs:
173173
$env:Path += ";C:\Program Files\MySQL\MySQL Server 8.0\bin"
174174
[Environment]::SetEnvironmentVariable("Path", $env:Path, "Machine")
175175
mysql -u root -e "CREATE DATABASE tests;"
176-
mysql -u root tests --execute="source examples/authors/mysql/schema.sql"
176+
mysql -u root tests --execute="source examples/config/mysql/schema.sql"
177177
178178
- name: Install & Start PostgreSQL
179179
shell: powershell
@@ -185,7 +185,7 @@ jobs:
185185
$env:Path += ";C:\Program Files\PostgreSQL\17\bin"
186186
$env:PGPASSWORD = "pass"
187187
psql -U postgres -c "CREATE DATABASE tests;"
188-
psql -U postgres -d tests -f "examples/authors/postgresql/schema.sql"
188+
psql -U postgres -d tests -f "examples/config/postgresql/schema.sql"
189189
190190
- name: Setup Visual Studio for .NET Framework
191191
uses: microsoft/setup-msbuild@v1

EndToEndTests/EndToEndTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<Content Include="../.env">
1111
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
1212
</Content>
13-
<Content Include="../examples/authors/sqlite/schema.sql">
13+
<Content Include="../examples/config/sqlite/schema.sql">
1414
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
1515
<TargetPath>sqlite.schema.sql</TargetPath>
1616
</Content>

LegacyEndToEndTests/LegacyEndToEndTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<Content Include="../.env">
1010
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
1111
</Content>
12-
<Content Include="../examples/authors/sqlite/schema.sql">
12+
<Content Include="../examples/config/sqlite/schema.sql">
1313
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
1414
<TargetPath>sqlite.schema.sql</TargetPath>
1515
</Content>

README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,32 @@ plugins:
2525
sha256: ${RELEASE_SHA}
2626
sql:
2727
# PostgreSQL Example
28-
- schema: "examples/authors/postgresql/schema.sql"
29-
queries: "examples/authors/postgresql/query.sql"
28+
- schema: "examples/config/postgresql/schema.sql"
29+
queries: "examples/config/postgresql/query.sql"
3030
engine: "postgresql"
3131
codegen:
3232
- plugin: csharp
3333
out: NpgsqlExample
3434
options:
3535
driver: Npgsql
36-
targetFramework: net8.0
37-
generateCsproj: true
3836
# MySQL Example
39-
- schema: "examples/authors/mysql/schema.sql"
40-
queries: "examples/authors/mysql/query.sql"
37+
- schema: "examples/config/mysql/schema.sql"
38+
queries: "examples/config/mysql/query.sql"
4139
engine: "mysql"
4240
codegen:
4341
- plugin: csharp
4442
out: MySqlConnectorExample
4543
options:
4644
driver: MySqlConnector
47-
targetFramework: net8.0
48-
generateCsproj: true
45+
# Sqlite Example
46+
- schema: "examples/config/sqlite/schema.sql"
47+
queries: "examples/config/sqlite/query.sql"
48+
engine: "sqlite"
49+
codegen:
50+
- plugin: csharp
51+
out: SqliteExample
52+
options:
53+
driver: Sqlite
4954
```
5055
5156
### [Generated Code Examples](docs/Examples.md)

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ services:
22

33
mysqldb:
44
container_name: mysqldb
5-
build: examples/authors/mysql
5+
build: examples/config/mysql
66
restart: always
77
ports:
88
- "3306:3306"
@@ -16,7 +16,7 @@ services:
1616

1717
postgresdb:
1818
container_name: postgresdb
19-
build: examples/authors/postgresql
19+
build: examples/config/postgresql
2020
restart: always
2121
ports:
2222
- "5432:5432"

examples/authors/sqlc.yaml

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

0 commit comments

Comments
 (0)