(db *DB, t *testing.T)
| 242 | } |
| 243 | |
| 244 | func loadDefaultFixture(db *DB, t *testing.T) { |
| 245 | tx := db.MustBegin() |
| 246 | tx.MustExec(tx.Rebind("INSERT INTO person (first_name, last_name, email) VALUES (?, ?, ?)"), "Jason", "Moiron", "jmoiron@jmoiron.net") |
| 247 | tx.MustExec(tx.Rebind("INSERT INTO person (first_name, last_name, email) VALUES (?, ?, ?)"), "John", "Doe", "johndoeDNE@gmail.net") |
| 248 | tx.MustExec(tx.Rebind("INSERT INTO place (country, city, telcode) VALUES (?, ?, ?)"), "United States", "New York", "1") |
| 249 | tx.MustExec(tx.Rebind("INSERT INTO place (country, telcode) VALUES (?, ?)"), "Hong Kong", "852") |
| 250 | tx.MustExec(tx.Rebind("INSERT INTO place (country, telcode) VALUES (?, ?)"), "Singapore", "65") |
| 251 | if db.DriverName() == "mysql" { |
| 252 | tx.MustExec(tx.Rebind("INSERT INTO capplace (`COUNTRY`, `TELCODE`) VALUES (?, ?)"), "Sarf Efrica", "27") |
| 253 | } else { |
| 254 | tx.MustExec(tx.Rebind("INSERT INTO capplace (\"COUNTRY\", \"TELCODE\") VALUES (?, ?)"), "Sarf Efrica", "27") |
| 255 | } |
| 256 | tx.MustExec(tx.Rebind("INSERT INTO employees (name, id) VALUES (?, ?)"), "Peter", "4444") |
| 257 | tx.MustExec(tx.Rebind("INSERT INTO employees (name, id, boss_id) VALUES (?, ?, ?)"), "Joe", "1", "4444") |
| 258 | tx.MustExec(tx.Rebind("INSERT INTO employees (name, id, boss_id) VALUES (?, ?, ?)"), "Martin", "2", "4444") |
| 259 | tx.Commit() |
| 260 | } |
| 261 | |
| 262 | // Test a new backwards compatible feature, that missing scan destinations |
| 263 | // will silently scan into sql.RawText rather than failing/panicing |
no test coverage detected