MCPcopy
hub / github.com/andeya/pholcus / SelectAll

Method SelectAll

common/mysql/mysql.go:235–247  ·  view source on GitHub ↗

SelectAll returns all rows from the table. SetTableName must be called first.

()

Source from the content-addressed store, hash-verified

233
234// SelectAll returns all rows from the table. SetTableName must be called first.
235func (t *Table) SelectAll() result.Result[*sql.Rows] {
236 if t.tableName == "" {
237 return result.FmtErr[*sql.Rows]("table name cannot be empty")
238 }
239 t.sqlCode = `SELECT * FROM ` + t.tableName + `;`
240
241 mc := getMysqlConst()
242 mc.maxConnChan <- true
243 defer func() {
244 <-mc.maxConnChan
245 }()
246 return result.Ret(db.Query(t.sqlCode))
247}
248
249func wrapSQLKey(s string) string {
250 return "`" + strings.ReplaceAll(s, "`", "") + "`"

Callers 5

ReadSuccessMethod · 0.80
ReadFailureMethod · 0.80

Calls 2

getMysqlConstFunction · 0.85
QueryMethod · 0.80