DB returns the default app data.db builder instance. To minimize SQLITE_BUSY errors, it automatically routes the SELECT queries to the underlying concurrent db pool and everything else to the nonconcurrent one. For more finer control over the used connections pools you can call directly Concurrent
()
| 488 | // For more finer control over the used connections pools you can |
| 489 | // call directly ConcurrentDB() or NonconcurrentDB(). |
| 490 | func (app *BaseApp) DB() dbx.Builder { |
| 491 | // transactional or both are nil |
| 492 | if app.concurrentDB == app.nonconcurrentDB { |
| 493 | return app.concurrentDB |
| 494 | } |
| 495 | |
| 496 | return &dualDBBuilder{ |
| 497 | concurrentDB: app.concurrentDB, |
| 498 | nonconcurrentDB: app.nonconcurrentDB, |
| 499 | } |
| 500 | } |
| 501 | |
| 502 | // ConcurrentDB returns the concurrent app data.db builder instance. |
| 503 | // |
no outgoing calls