Skip to content
This repository was archived by the owner on Jun 9, 2023. It is now read-only.

Commit 5b8635a

Browse files
author
robreid
committed
Simplified example script and added note to fset docs
1 parent 919a7d0 commit 5b8635a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ Note that the apostrophes will wrap the string, turning it into a database strin
162162
Generates a formatted string using placeholder syntax:
163163

164164
```
165-
'{{stringf "%s.%[email protected]" 5 10 "abc" 10000 20000}}',
165+
'{{stringf "%s.%[email protected]" 5 10 "abc" 10000 20000}}'
166166
```
167167

168168
`stringf` the name of the function.<br/>
@@ -264,7 +264,7 @@ Weights can be any number.
264264

265265
##### fset
266266

267-
Selects a random value from a set of possible values contained within a file.
267+
Selects a random value from a set of possible values contained within a file and caches the enumeration so it's not reloaded from disk on every invocation.
268268

269269
```
270270
'{{fset "./examples/types.txt"}}'

examples/script.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ insert into "pet" ("pid", "name", "type") values
1616
{{range $i, $e := ntimes 5 }}
1717
{{if $i}},{{end}}
1818
(
19-
'{{each "owner" "id" $i}}',
19+
'{{ref "owner" "id"}}',
2020
'{{string 10 10 "p-" "abcde"}}',
21-
'{{fset "./examples/types.txt"}}'
21+
'{{wset "dog" 60 "cat" 40}}'
2222
)
2323
{{end}};

0 commit comments

Comments
 (0)