Skip to content

Strongly Typed Migration Creation #793

@GrozianDeveloper

Description

@GrozianDeveloper

Please summarize your feature request

I want to create easy to use and reuse models for easing Migration creation, and make it impossible to make an typing error

Describe the functionality you're seeking in more detail

Idea

Idea is to create Key model that will be translation layer between database and typing. Those keys will be strongly typed, easy to create and will make impossible to make a typing error
(working example is provided)

@field Macro to use

Also it would be great, to create macro, that can access this keys. Currently to use this translation object you need to type Object type, and that access its init (in this example its an enum, with accountID case
@field(key: Key.accountID.rawValue)
So instead it would be great, if it was something like this
@field(key: accountID)

Working example of implementation of FluentKey

Example.swift.md

Have you considered any alternatives?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions