reform icon indicating copy to clipboard operation
reform copied to clipboard

Documentation, examples and spell/grammar checking

Open AlekSi opened this issue 8 years ago • 5 comments

What part of reform needs more documentation? Leave a comment. Where will example help? Leave a comment. Found a typo or grammar error? You can fix it right on GitHub.

We can use GitHub wiki, GitHub Pages, Hugo or GitBook for documentation. GORM docs is a good example. Another one – XORM.

We can also use https://asciinema.org for simple demo in README.

AlekSi avatar May 14 '16 17:05 AlekSi

If you work with dates (like time.Time) from reform, you have to add in your model method afterFind which will convert time zones etc. Am I right?

Maybe it is possible to add some helpful tips for different data type to understand the best way?

rumyantseva avatar Aug 24 '16 08:08 rumyantseva

If you work with dates (like time.Time) from reform, you have to add in your model method afterFind which will convert time zones etc. Am I right?

No, if your database driver is doing a sane thing. But yeah, this need to be documented.

AlekSi avatar Aug 24 '16 10:08 AlekSi

ErrNoRows can be returned from some methods and is never returned from others. General rule probably can be better documented.

AlekSi avatar Aug 25 '16 10:08 AlekSi

How can I use multiple conditions?

// Find records by IDs. persons, err := DB.FindAllFrom(PersonTable, "id", 1, 2) if err != nil { log.Fatal(err) } for _, p := range persons { fmt.Println(p) }

Allows me to select by id, let's say I want to select by 'id' and 'name' or any other field.

What would my code look like?

sebastianmacias avatar Mar 01 '17 23:03 sebastianmacias

Various Find methods accept a single column only. More complex conditions are possible with Select methods:

persons, err := DB.SelectAllFrom(PersonTable, "WHERE id = ? AND name = ?", id, name)

AlekSi avatar Mar 20 '17 05:03 AlekSi