prepInsertStatement prepares and returns the statement inserting records.
(tx *sql.Tx)
| 256 | |
| 257 | // prepInsertStatement prepares and returns the statement inserting records. |
| 258 | func (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 | |
| 271 | func (c *SQLite) setDBSettings(conn *sql.DB) error { |
| 272 | if c.cfg.PageSize > 0 { |