Skip to content

Commit

Permalink
feat: Fixed doc example and deterministic behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
wwoytenko committed May 8, 2024
1 parent 764c446 commit c608ea2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,6 @@ INSERT INTO personal_data (name, surname, sex) VALUES
- name: "surname"
template: "{{ .LastName }}"
engine: "hash"
dynamic_params:
gender:
column: sex
```
## Example: Populate random first name and last name for table user_profiles in dynamic mode
Expand All @@ -112,7 +109,6 @@ gender
transformers:
- name: "RandomPerson"
params:
gender: "Any"
columns:
- name: "name"
template: "{{ .FirstName }}"
Expand Down
3 changes: 3 additions & 0 deletions internal/generators/transformers/random_person.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package transformers
import (
"encoding/binary"
"fmt"
"slices"

"github.com/greenmaskio/greenmask/internal/generators"
)
Expand Down Expand Up @@ -147,6 +148,8 @@ func NewPersonalDatabase(data Database) *PersonDatabase {
attributes = append(attributes, attrName)
}

slices.Sort(attributes)

return &PersonDatabase{
Db: data,
Attributes: attributes,
Expand Down

0 comments on commit c608ea2

Please sign in to comment.