masumsoft / express-cassandra

Cassandra ORM/ODM/OGM for NodeJS with support for Apache Cassandra, ScyllaDB, Datastax Enterprise, Elassandra & JanusGraph.
http://express-cassandra.readthedocs.io
GNU Lesser General Public License v3.0
227 stars 67 forks source link

Model hooks support async/ await #177

Open shatayuD opened 5 years ago

shatayuD commented 5 years ago

Hello,

I'm using ORM and it is very good. But I want to use model hok function for some kind of validation which is database specific.

I will query & check if some data exsists or not depending on that if we have to save or not has to be decided.

Is there any way so that we can use model hooks wait until prmise is returned then take true or false and proceed to save ?

like before_saveAsync or before_save : await finction(){ }

Is anything supported like this ? not in the documentation so asked here.