mirror of
https://github.com/metabolist/metatext.git
synced 2024-06-22 23:20:44 +00:00
25 lines
562 B
Swift
25 lines
562 B
Swift
|
// Copyright © 2021 Metabolist. All rights reserved.
|
||
|
|
||
|
import Foundation
|
||
|
import GRDB
|
||
|
|
||
|
public struct AccountList: ContentDatabaseRecord, Hashable {
|
||
|
let id: Id
|
||
|
}
|
||
|
|
||
|
public extension AccountList {
|
||
|
typealias Id = String
|
||
|
}
|
||
|
|
||
|
extension AccountList {
|
||
|
enum Columns {
|
||
|
static let id = Column(CodingKeys.id)
|
||
|
}
|
||
|
|
||
|
static let accountListJoins = hasMany(AccountListJoin.self)
|
||
|
static let accounts = hasMany(
|
||
|
AccountRecord.self,
|
||
|
through: accountListJoins.order(AccountListJoin.Columns.order),
|
||
|
using: AccountListJoin.account)
|
||
|
}
|