⭐️ If you like MikroORM, give it a star on GitHub and consider sponsoring its development! ⭐️
This is documentation for version 6.1. For the latest API, see version 6.6.
Version: 6.1
sql
Callable
sql(sql, ...values): any
Alternative to the raw() helper allowing to use it as a tagged template function for the simple cases.
// as a value await em.find(User,{ time: sql`now()`}); // as a key await em.find(User,{[sql`lower(name)`]: name.toLowerCase()}); // value can be empty array await em.find(User,{[sql`(select1=1)`]:[]});
Alternative to the
raw()helper allowing to use it as a tagged template function for the simple cases.