RepoDB
RepoDB copied to clipboard
Question: Schema creation / validation
Is there support to convert a mapping of class to a Create Table sql statement?
Thanks
@mdissel - no, this is not a feature of this library. If you can provide more context to this, maybe I can refer you to some good and awesome OSS libraries. Are you up for DB Migration?
Context is creating/dropping tables, views, indexes functions, etc. (using postgresql) (preferrable re-using the attribute mapping from repodb )...
Thanks
Have you tried exploring the https://github.com/fluentmigrator/fluentmigrator?
Yes, but does it handle the class /field mapping from repodb attributes?
@mdissel - I would humbly say, RepoDB field mapping attribute is simple and is not extensive/informative enough to construct the schemas. I would suggest, you should not rely on it, instead, use any kind of tool that is designed to cater this scenario / does the migration (i.e: Code First, Model First or even the DB First), as any kind of migration features will never be a part of RepoDB library.
Though, in RepoDB, you can extract the properties and fields via the use of helper classes like FieldCache and PropertyCache. Then, you can construct a migration through the extracted information from specific model, and maybe inject that to the FluentMigrator? It is doable, but it seems for me, a tedious one to maintain and is subtle to rely on.