Giter Site home page Giter Site logo

Comments (5)

welcome avatar welcome commented on August 20, 2024

Thanks for opening your first issue here! 🎉 Be sure to follow the issue template!

from fiber-go-template.

koddr avatar koddr commented on August 20, 2024

Hi,

What do you mean, “it's working”? What kind of error or stack is output? To give more information, so far, it is not clear either the cause of the error or how to reproduce it to fix it (if it is confirmed, of course).

from fiber-go-template.

dhinojosac avatar dhinojosac commented on August 20, 2024

Sorry for the lack of information.
The function used to get all books in the template was the way to get a single result, for this way the return is always empty:

    // You can also get a single result, a la QueryRow
    jason = Person{}
    err = db.Get(&jason, "SELECT * FROM person WHERE first_name=$1", "Jason")
    fmt.Printf("%#v\n", jason)

But since we want can to obtain the list of all books, we must use this other function (as it says in the documentation of jmoiron/sqlx):

// if you have null fields and use SELECT *, you must use sql.Null* in your struct
    places := []Place{}
    err = db.Select(&places, "SELECT * FROM place ORDER BY telcode ASC")
    if err != nil {
        fmt.Println(err)
        return
    }

That's it! I hope it's useful!
Thanks

from fiber-go-template.

stale avatar stale commented on August 20, 2024

👋 Hello. Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Thank you for your contributions.

from fiber-go-template.

stale avatar stale commented on August 20, 2024

⚡️ This issue has been automatically closed because it has not had recent activity.

from fiber-go-template.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.