(dbID string, readonly bool)
| 133 | } |
| 134 | |
| 135 | func (s *SQLite3Storage) getConn(dbID string, readonly bool) (db *sql.DB, err error) { |
| 136 | dbFile := filepath.Join(s.rootDir, dbID+".db3") |
| 137 | dbDSN := fmt.Sprintf("file:%s?_journal_mode=WAL&_synchronous=NORMAL", dbFile) |
| 138 | if readonly { |
| 139 | dbDSN += "&mode=ro" |
| 140 | } |
| 141 | |
| 142 | return sql.Open("sqlite3", dbDSN) |
| 143 | } |