Skip to content

Commit e5db2af

Browse files
Updated README.md and Github actions
1 parent df6f78a commit e5db2af

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
strategy:
66
matrix:
77
go-version: [1.17.x, 1.18.x]
8-
os: [ubuntu-latest, macos-latest]
8+
os: [ubuntu-latest]
99
runs-on: ${{ matrix.os }}
1010
steps:
1111
- name: Install Go

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,19 @@ Register(namespace string, templateRoot string, extensions string) error
5353
sqlt := sqlTemplate.NewQueryTemplateEngine()
5454
sqlt.Register("users", "queries/users", ".tsql");
5555

56-
criteria := map[string]interface{}{"Id": "1", "Order": "id"}
57-
tmpl, _ := sqlt.ParseWithValuesFromMap("users", "findById", criteria)
56+
criteria := map[string]interface{}{"Name": "Bill", "Order": "id"}
57+
tmpl, _ := sqlt.ParseWithValuesFromMap("users", "findByName", criteria)
5858

5959
fmt.Printf("query %v\n", tmpl.GetQuery())
6060
fmt.Printf("query parameters %v\n", tmpl.GetParams())
6161
```
6262

6363
```sql
6464
-- File ./queries/users/users.tsql
65-
{{define "findById"}}
65+
{{define "findByName"}}
6666
SELECT *
6767
FROM users
68-
WHERE id={{bind .Id}}
68+
WHERE name={{bind .Name}}
6969
{{if .Order}}ORDER BY {{.Order}}{{end}}
7070
{{end}}
7171
```

0 commit comments

Comments
 (0)