()
| 159 | } |
| 160 | |
| 161 | func (l *PostgresTransactionLogger) createTable() error { |
| 162 | var err error |
| 163 | |
| 164 | createQuery := `CREATE TABLE transactions ( |
| 165 | sequence BIGSERIAL PRIMARY KEY, |
| 166 | event_type SMALLINT, |
| 167 | key TEXT, |
| 168 | value TEXT |
| 169 | );` |
| 170 | |
| 171 | _, err = l.db.Exec(createQuery) |
| 172 | if err != nil { |
| 173 | return err |
| 174 | } |
| 175 | |
| 176 | return nil |
| 177 | } |
| 178 | |
| 179 | func NewPostgresTransactionLogger(param PostgresDbParams) (TransactionLogger, error) { |
| 180 | connStr := fmt.Sprintf("host=%s dbname=%s user=%s password=%s sslmode=disable", |
no outgoing calls
no test coverage detected