SQLite storage baseline#5
Conversation
| return repository, nil | ||
| } | ||
|
|
||
| func (r *SQLiteRepository) Init() error { |
There was a problem hiding this comment.
SQLite schema creation is colocated with the repository implementation. That keeps the first durable store self-contained, while the app service still only sees the repository interface.
| return r.db.Close() | ||
| } | ||
|
|
||
| func (r *SQLiteRepository) Create(image Image) Image { |
There was a problem hiding this comment.
The current repository interface returns the created model without an error, so this implementation panics on unexpected DB failures. This is acceptable for the current narrow slice, but it is a design point to revisit when store errors need to become app-level responses.
| created_at, | ||
| updated_at | ||
| FROM images | ||
| ORDER BY sequence`) |
There was a problem hiding this comment.
The sequence column is used to preserve insertion order for list responses. This mirrors the earlier in-memory ids slice and avoids nondeterministic map iteration in tests.
ba99115 to
6a40197
Compare
ff34ab3 to
a7acbbd
Compare
Summary
Main Review Points
Verification