-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate .hrl file with record definitions #194
Comments
Hi Niclas, This is similar in nature to the direction I'd like to take boss_db, in the Though one of the common problems is presented in your snippet (though I I was thinking perhaps a safer way to go about it would be to use Erlang's That said, the record approach isn't bad, and does let us use records, HOWEVER, with maps being recently introduced, I wonder if the flexibility I'm honestly very on the fence about it all. Maps, however, could not be -Jesse On Mon, Aug 11, 2014 at 3:25 PM, Niclas Axelsson [email protected]
Jesse Gumm |
Hi Jesse, I know that the "user"-module already exist and my example therefore would fail if trying to compile it :-). It was just for demonstration purpose. Can you explain a bit further how you want to use the I've also looked at how one could use maps in boss_db, but don't like the thought of removing the clever things you get when using records the way boss_db does. The only positive thing with using maps in boss_db is that you'll get a mutable object that can be updated. |
On a tangent, it would be really cool, in a user-friendly way, to make CB fail to compile the 'user' module in a very friendly way. |
Hi,
I've been working on a new feature for boss_db that generates a .hrl-file containing the record definitions for a specific model. This is so we can support default values.
Example:
This model will result in a .hrl-file looking like this
So lets say that we want to create a user in one of our files:
What do others think about this? Is this something worth to pursue?
The text was updated successfully, but these errors were encountered: