import GRDB /// The SegDenorm struct. /// /// Identifiable conformance supports SwiftUI list animations, and type-safe /// GRDB primary key methods. /// Equatable conformance supports tests. struct SegDenorm: Identifiable, Equatable { /// Int64 is the recommended type for auto-incremented database ids. /// Use nil for players that are not inserted yet in the database. var id: Int64 var body: String // var lineIds: [Int64] var book: String var chap: Int64 } extension SegDenorm { } // MARK: - Persistence /// Make SegDenorm a Codable Record. /// /// See extension SegDenorm: Codable, FetchableRecord, MutablePersistableRecord { // // Define database columns from CodingKeys // fileprivate enum Columns { // static let id = Column(CodingKeys.id) // static let book = Column(CodingKeys.book) // } // /// Updates a player id after it has been inserted in the database. // mutating func didInsert(_ inserted: InsertionSuccess) { // id = inserted.rowID // } } // MARK: - SegDenorm Database Requests /// Define some player requests used by the application. /// /// See /// See extension DerivableRequest { }