(db Database)
| 13 | } |
| 14 | |
| 15 | func NewDryRunDatabase(db Database) (*DryRunDatabase, error) { |
| 16 | txQueries := db.GetTransactionQueries() |
| 17 | |
| 18 | dryRunDriverName := fmt.Sprintf("dry-run-%p", db) // Unique name per database instance |
| 19 | sql.Register(dryRunDriverName, &dryRunDriver{txQueries: txQueries}) |
| 20 | |
| 21 | dryRunDB, err := sql.Open(dryRunDriverName, "dry-run") |
| 22 | if err != nil { |
| 23 | return nil, err |
| 24 | } |
| 25 | |
| 26 | return &DryRunDatabase{ |
| 27 | wrapped: db, |
| 28 | dryRunDB: dryRunDB, |
| 29 | }, nil |
| 30 | } |
| 31 | |
| 32 | func (d *DryRunDatabase) ExportDDLs() (string, error) { |
| 33 | return d.wrapped.ExportDDLs() |
no test coverage detected