Skip to content

DatabaseRow

Josh Wright edited this page Jan 14, 2021 · 3 revisions

DatabaseRow

A row of data returned from a database. Various database packages can use this as an abstraction around their internal row types.

public protocol DatabaseRow

Requirements

allColumns

The String names of all columns that have values in this DatabaseRow.

var allColumns: [String]

getField(column:​)

Get the DatabaseField of a column from this row.

func getField(column: String) throws -> DatabaseField

Parameters

  • column: The column to get the value for.

Throws

A DatabaseError if the column does not exist on this row.

Returns

The field at column.

decode(_:​)

Decode a Model type D from this row.

func decode<D: Model>(_ type: D.Type) throws -> D

The default implementation of this function populates the properties of D with the value of the column named the same as the property.

Parameters

  • type: The type to decode from this row.
Alchemy
Types
Protocols
Global Typealiases
Global Variables
Global Functions
Fusion
Types
Protocols
Papyrus
Types
Protocols
Clone this wiki locally