Lines Matching refs:Query
288 func (dc *driverConn) prepareLocked(query string) (driver.Stmt, error) {
289 si, err := dc.ci.Prepare(query)
845 func (db *DB) Prepare(query string) (*Stmt, error) {
849 stmt, err = db.prepare(query, cachedOrNewConn)
855 return db.prepare(query, alwaysNewConn)
860 func (db *DB) prepare(query string, strategy connReuseStrategy) (*Stmt, error) {
872 si, err := dc.prepareLocked(query)
880 query: query,
889 // Exec executes a query without returning any rows.
890 // The args are for any placeholder parameters in the query.
891 func (db *DB) Exec(query string, args ...interface{}) (Result, error) {
895 res, err = db.exec(query, args, cachedOrNewConn)
901 return db.exec(query, args, alwaysNewConn)
906 func (db *DB) exec(query string, args []interface{}, strategy connReuseStrategy) (res Result, err error) {
921 resi, err := execer.Exec(query, dargs)
932 si, err := dc.ci.Prepare(query)
941 // Query executes a query that returns rows, typically a SELECT.
942 // The args are for any placeholder parameters in the query.
943 func (db *DB) Query(query string, args ...interface{}) (*Rows, error) {
947 rows, err = db.query(query, args, cachedOrNewConn)
953 return db.query(query, args, alwaysNewConn)
958 func (db *DB) query(query string, args []interface{}, strategy connReuseStrategy) (*Rows, error) {
964 return db.queryConn(ci, ci.releaseConn, query, args)
967 // queryConn executes a query on the given connection.
969 func (db *DB) queryConn(dc *driverConn, releaseConn func(error), query string, args []interface{}) (*Rows, error) {
977 rowsi, err := queryer.Query(query, dargs)
996 si, err := dc.ci.Prepare(query)
1024 // QueryRow executes a query that is expected to return at most one row.
1027 func (db *DB) QueryRow(query string, args ...interface{}) *Row {
1028 rows, err := db.Query(query, args...)
1168 func (tx *Tx) Prepare(query string) (*Stmt, error) {
1172 // necessary. Or, better: keep a map in DB of query string to
1188 si, err := dc.ci.Prepare(query)
1201 query: query,
1235 si, err := dc.ci.Prepare(stmt.query)
1244 query: stmt.query,
1253 // Exec executes a query that doesn't return rows.
1255 func (tx *Tx) Exec(query string, args ...interface{}) (Result, error) {
1267 resi, err := execer.Exec(query, dargs)
1278 si, err := dc.ci.Prepare(query)
1288 // Query executes a query that returns rows, typically a SELECT.
1289 func (tx *Tx) Query(query string, args ...interface{}) (*Rows, error) {
1295 return tx.db.queryConn(dc, releaseConn, query, args)
1298 // QueryRow executes a query that is expected to return at most one row.
1301 func (tx *Tx) QueryRow(query string, args ...interface{}) *Row {
1302 rows, err := tx.Query(query, args...)
1317 query string // that created the Stmt
1463 si, err = dc.prepareLocked(s.query)
1477 // Query executes a prepared query statement with the given arguments
1478 // and returns the query results as a *Rows.
1479 func (s *Stmt) Query(args ...interface{}) (*Rows, error) {
1536 rowsi, err := ds.si.Query(dargs)
1544 // QueryRow executes a prepared query statement with the given arguments.
1547 // If the query selects no rows, the *Row's Scan will return ErrNoRows.
1556 rows, err := s.Query(args...)
1601 // Rows is the result of a query. Its cursor starts before the first row
1604 // rows, err := db.Query("SELECT ...")
1729 // pointed at by dest. If more than one row matches the query,
1731 // the query, Scan returns ErrNoRows.
1767 // Make sure the query can be processed to completion with no errors.