Exec implements the Storage abstraction interface.
(dbID string, query string, args ...interface{})
| 117 | |
| 118 | // Exec implements the Storage abstraction interface. |
| 119 | func (s *SQLite3Storage) Exec(dbID string, query string, args ...interface{}) (affectedRows int64, lastInsertID int64, err error) { |
| 120 | var conn *sql.DB |
| 121 | if conn, err = s.getConn(dbID, false); err != nil { |
| 122 | return |
| 123 | } |
| 124 | defer conn.Close() |
| 125 | |
| 126 | var result sql.Result |
| 127 | result, err = conn.Exec(query, args...) |
| 128 | |
| 129 | affectedRows, _ = result.RowsAffected() |
| 130 | lastInsertID, _ = result.LastInsertId() |
| 131 | |
| 132 | return |
| 133 | } |
| 134 | |
| 135 | func (s *SQLite3Storage) getConn(dbID string, readonly bool) (db *sql.DB, err error) { |
| 136 | dbFile := filepath.Join(s.rootDir, dbID+".db3") |
nothing calls this directly
no test coverage detected