This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| public extension Dictionary where Key == String, Value == Any { | |
| fileprivate func _get<T>(path: [String]) -> T? { | |
| var root = self | |
| for idx in 0 ..< path.count - 1 { | |
| guard let _root = root[path[idx]] as? [String: Any] else { | |
| return nil | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // configure.swift | |
| func configure(_ app: Application) throws { | |
| app.migrations.add(Todo(), to: .psql) | |
| try app.migrator.setupIfNeeded().wait() | |
| try app.migrator.prepareBatch().wait() | |
| } | |
| // Todo.swift | |
| final class Todo: Model, Content { |