NewStorage creates a new in-memory storage. For now this uses the gorm provider with the gorm.WithInMemory. In the future we want to supply our own independent implementation. It automatically sets the maximum concurrent connections to 1 because the in-memory sqlite driver has problems with more tha
()
| 11 | // to 1 because the in-memory sqlite driver has problems with more than concurrent connection (see |
| 12 | // https://github.com/mattn/go-sqlite3/issues/511). |
| 13 | func NewStorage() (persistence.Storage, error) { |
| 14 | return gorm.NewStorage( |
| 15 | gorm.WithInMemory(), |
| 16 | gorm.WithMaxOpenConns(1), |
| 17 | gorm.WithLogger(logger.Default.LogMode(logger.Silent))) |
| 18 | } |