func (s *stringer) compileAndReplacePlaceholders(stmt *exql.Statement) (query string) { buf := stmt.Compile(s.t) j := 1 for i := range buf { if buf[i] == '?' { query = query + "$" + strconv.Itoa(j) j++ } else { query = query + string(buf[i]) } } return query }
// CompileStatement allows sqladapter to compile the given statement into the // format MySQL expects. func (d *database) CompileStatement(stmt *exql.Statement, args []interface{}) (string, []interface{}) { return sqlbuilder.Preprocess(stmt.Compile(template), args) }
func (p *exprProxy) StatementQueryRow(stmt *exql.Statement, args ...interface{}) (*sql.Row, error) { s := stmt.Compile(p.t) return p.db.QueryRow(s, args...), nil }
func (p *exprProxy) StatementExec(stmt *exql.Statement, args ...interface{}) (sql.Result, error) { s := stmt.Compile(p.t) return p.db.Exec(s, args...) }
// CompileStatement allows sqladapter to compile the given statement into the // format SQLite expects. func (d *database) CompileStatement(stmt *exql.Statement, args []interface{}) (string, []interface{}) { query, args := sqlbuilder.Preprocess(stmt.Compile(template), args) return sqladapter.ReplaceWithDollarSign(query), args }