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

TODO: implement sql.Scanner and driver.Value #4

Open
nilslice opened this issue Oct 1, 2017 · 0 comments
Open

TODO: implement sql.Scanner and driver.Value #4

nilslice opened this issue Oct 1, 2017 · 0 comments

Comments

@nilslice
Copy link
Contributor

nilslice commented Oct 1, 2017

Would this be useful? Not 100% sure about how/where driver.Valuer would be used, but a making a *client.APIResponse implement the sql.Scanner interface would let users do:

resp, err := client.Content("Blog", 1)
if err != nil {
    return err
}

// content.Blog is the Blog type imported from user's Ponzu content package
var singleBlogPost content.Blog
resp.Scan(&singleBlogPost)

// then use singleBlogPost and all it's fields
fmt.Println("The title of the blog post is:", singleBlogPost.Title)
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

1 participant