Creating a attribute and Using it one 1 transaction


Is this possible and if it is, how do you do it?

My system is adding new questions to the database but each time a question is added. A new attribute is created to put the answer into it. Creating a new attribute allowed me to cross check if the answer belong to the question or not. That’s the reason why I create new attribute for any new question. On top of that, I can force a question to accept only number or date or something else depending on question.



What you want is possible by using d/with to stage the schema change, and then query against the d/with returned dbval. You’ll need two transactions in the end. But, altering schema in response to userland commands, seems abusive.


It is what it is…
Basically it is an admin tool which is used to create and change questions… but each new question we create a new attribute so we can use it like a safe type checking(Java) instead of duck typing(Javascript).