Skip to content

Instance Method

input(to:)

For each property declared on the type, if that property is marked as having changed since the type was either loaded or created, add the key-value pair for said property to the given database input object. This prepares data in memory to be written to the database.
func input(to input: any DatabaseInput)

Discussion

Note

It is trivial to construct DatabaseInput objects which do not in fact actually transfer their contents to a database. FluentKit itself does this to implement a save/restore operation for model state under certain conditions (see Model).

Default Implementations

Fields Implementations

  • input(to:)
    For each property declared on the type, if that property is marked as having changed since the type was either loaded or created, add the key-value pair for said property to the given database input object. This prepares data in memory to be written to the database.