Git Product home page Git Product logo

Comments (4)

tgulacsi avatar tgulacsi commented on May 29, 2024

stmt.QryRow, stmt.PrepAndQryRow, returning the rset.Row ([]interface{}) and error?

Please create a PR!

from ora.

omerkirk avatar omerkirk commented on May 29, 2024

@tgulacsi I assumed that QueryRow wasn't working since it was written as such in the README. But while I was checking the database/sql code it seems that QueryRow isn't a function dependent on the driver so I tested the QueryRow function in my own apps. Everything is working as expected. Please correct me if I am wrong. This is the implementation of QueryRow in database/sql package

func (db *DB) QueryRow(query string, args ...interface{}) *Row {
        rows, err := db.Query(query, args...)
        return &Row{rows: rows, err: err}
}

And the statement code is similar. So this looks like a utility function around Query. Am I missing something ?

from ora.

tgulacsi avatar tgulacsi commented on May 29, 2024

No, this is a general function - just as everything in database/sql.
I've thought you want a similar utility funtion for the ora-specific
ora.Stmt type.

Be warned though that QueryRow closes the query on return - usually not a
problem, except when it is: when you want to use the returned handler, such
asa LOB handler - in that case, use Query, and close by han d.

omerkirk [email protected] ezt írta (időpont: 2016. febr. 23., K,
17:07):

@tgulacsi https://github.com/tgulacsi I assumed that QueryRow wasn't
working since it was written as such in the README. But while I was
checking the database/sql code it seems that QueryRow isn't a function
dependent on the driver. Please correct me if I am wrong. This is the
implementation:

func (db *DB) QueryRow(query string, args ...interface{}) *Row {
rows, err := db.Query(query, args...)
return &Row{rows: rows, err: err}
}

And the statement code is similar. So this looks like a utility function
around Query. Am I missing something ?


Reply to this email directly or view it on GitHub
#63 (comment).

from ora.

omerkirk avatar omerkirk commented on May 29, 2024

I assumed QueryRow is an optional interface function that the drivers can choose to implement since it is allowed to not support it. Sorry for that. I'll close this issue.

from ora.

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.