Skip to content

Instantly share code, notes, and snippets.

@zastrozzi
zastrozzi / EnumArrayProperty.swift
Created June 17, 2024 13:21
Fluent Enum Arrays
import Fluent
import PostgresNIO
import FluentPostgresDriver
import PostgresKit
extension Fields {
public typealias EnumArray<EnumValue> = EnumArrayProperty<Self, EnumValue> where EnumValue: FluentEnumConvertible
}
@propertyWrapper
import SQLKit
import FluentKit
/// Read each method's comments in the order they appear (from `fieldKey(for:)` through `sqlColumn(for:)`) for an
/// _EXTREMELY_ detailed breakdown of how the heck this all works.
extension Fields {
/// Returns the singular `FieldKey` corresponding to a specific property of the model.
///
/// Detailed operation:
///