MCPcopy Create free account
hub / github.com/AdRoll/baker / prepInsertStatement

Method prepInsertStatement

output/sqlite.go:258–269  ·  view source on GitHub ↗

prepInsertStatement prepares and returns the statement inserting records.

(tx *sql.Tx)

Source from the content-addressed store, hash-verified

256
257// prepInsertStatement prepares and returns the statement inserting records.
258func (c *SQLite) prepInsertStatement(tx *sql.Tx) (*sql.Stmt, error) {
259 var qmarks []string
260 for range c.fieldNames {
261 qmarks = append(qmarks, "?")
262 }
263 if c.isRaw {
264 qmarks = append(qmarks, "?")
265 }
266
267 stmt := fmt.Sprintf("INSERT INTO %s VALUES(%s)", sqliteQuote(c.cfg.TableName), strings.Join(qmarks, ","))
268 return tx.Prepare(stmt)
269}
270
271func (c *SQLite) setDBSettings(conn *sql.DB) error {
272 if c.cfg.PageSize > 0 {

Callers 1

doRunMethod · 0.95

Calls 1

sqliteQuoteFunction · 0.85

Tested by

no test coverage detected