Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation, examples and spell/grammar checking #8

Open
AlekSi opened this issue May 14, 2016 · 5 comments
Open

Documentation, examples and spell/grammar checking #8

AlekSi opened this issue May 14, 2016 · 5 comments

Comments

@AlekSi
Copy link
Member

AlekSi commented May 14, 2016

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 AlekSi changed the title Documentation and spell/grammar checking Documentation, examples and spell/grammar checking Aug 10, 2016
@AlekSi AlekSi self-assigned this Aug 10, 2016
@AlekSi AlekSi added this to the v1.3.0 milestone Aug 10, 2016
@rumyantseva
Copy link
Collaborator

rumyantseva commented Aug 24, 2016

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?

@AlekSi
Copy link
Member Author

AlekSi commented Aug 24, 2016

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 AlekSi removed their assignment Aug 24, 2016
@AlekSi
Copy link
Member Author

AlekSi commented Aug 25, 2016

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

@sebastianmacias
Copy link

sebastianmacias commented Mar 1, 2017

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?

@AlekSi
Copy link
Member Author

AlekSi commented Mar 20, 2017

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 AlekSi modified the milestones: v1.3.0, v1.4.0 Oct 2, 2017
@AlekSi AlekSi pinned this issue Mar 20, 2019
@AlekSi AlekSi modified the milestones: v1.4.0, v1.5.0 Jul 19, 2020
@AlekSi AlekSi unpinned this issue Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants