|
|
|
|
@ -40,9 +40,23 @@ struct ContentView: View { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func _add() { |
|
|
|
|
let id = (0...1000000).randomElement()! |
|
|
|
|
let club: Club = Club(name: "test\(id)", address: "some address") |
|
|
|
|
self.dataStore.clubs.addOrUpdate(instance: club) |
|
|
|
|
// let id = (0...1000000).randomElement()! |
|
|
|
|
// let club: Club = Club(name: "test\(id)", address: "some address") |
|
|
|
|
// self.dataStore.clubs.addOrUpdate(instance: club) |
|
|
|
|
|
|
|
|
|
for _ in 0...20 { |
|
|
|
|
var clubs: [Club] = [] |
|
|
|
|
for _ in 0...20 { |
|
|
|
|
let id = (0...1000000).randomElement()! |
|
|
|
|
let club: Club = Club(name: "test\(id)", address: "some address") |
|
|
|
|
clubs.append(club) |
|
|
|
|
} |
|
|
|
|
do { |
|
|
|
|
try self.dataStore.clubs.append(contentOfs: clubs) |
|
|
|
|
} catch { |
|
|
|
|
Logger.error(error) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|