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

Method setDBSettings

output/sqlite.go:271–285  ·  view source on GitHub ↗
(conn *sql.DB)

Source from the content-addressed store, hash-verified

269}
270
271func (c *SQLite) setDBSettings(conn *sql.DB) error {
272 if c.cfg.PageSize > 0 {
273 if _, err := conn.Exec(fmt.Sprintf("PRAGMA page_size=%d", c.cfg.PageSize)); err != nil {
274 return fmt.Errorf("PRAGMA page_size=%d failed: %s", c.cfg.PageSize, err)
275 }
276 }
277
278 if c.cfg.Wal {
279 if _, err := conn.Exec("PRAGMA journal_mode=wal"); err != nil {
280 return fmt.Errorf("PRAGMA journal_mode=wal failed: %s", err)
281 }
282 }
283
284 return nil
285}
286
287// maybeTruncate truncates the table (if configured to do so)
288func (c *SQLite) maybeTruncate(tx *sql.Tx) error {

Callers 1

setupMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected