mc738 / Freql

A record mapping library for FSharp and various data sources.
MIT License
2 stars 0 forks source link

Add support for code-first approaches #28

Open mc738 opened 1 month ago

mc738 commented 1 month ago

Is your feature request related to a problem? Please describe. ORMs like EF have support for a code first approach to database development. It would be good to have this in Freql.

Describe the solution you'd like Implement an ability to generate databases based on FSharp records. There should be some conventions (like id and table_name_id representing a primary key). It could be expanded to handle unions in the future.

Describe alternatives you've considered Not implementing it. But it would be a good thing to have for rapid development and prototyping.

Additional context There will need to be a few new attributes to with this.

For example

[<ForeginKey("table", "field")>] for link tables [<Constraint()>] for various constraints [<RawSql()>] for tables/fields that need specific SQL

However, some of this could also be moved to/also defined in methods.

For example if static member ForeignKey() exists, it will be used to generate the foreign keys.

Projects impacted

Platforms