krasenyp

krasenyp

Yes but usually when you reach the particular scale, you never decouple from the database. Schemas keep bubbling up to views and so on.

1
Post #11
joey_the_snake

joey_the_snake

I put the module doc which describes what the fields of my schema are and then I call a macro which abstracts Ecto’s schema macro.

The macro is defined in my EctoAbstractionMacros module and takes in two arguments: the first is the name of the source and the second is an anonymous function. The anonymous function is defined through a module attribute and returns a list of the field names and types. Right now it can’t do anything fancy like parameterized types but I’ll get there.

Then inside of my schema abstraction macro it calls a changeset abstraction macro to get my changeset functions. These are defined through a DSL I created just to abstract the definition of my changeset functions.

Right now I can’t get past all the errors the compiler is throwing at me but I know one day this will all be worth it.

1
Post #12
dimitarvp

dimitarvp

You can still open a repo and link it here. Your idea sounds interesting.

0
Post #14
— All posts loaded —