Expand allowed functions in the functionList

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dimyy
    Active Community Member
    • Jun 2018
    • 569

    Expand allowed functions in the functionList

    1. Add RAND.

    To add possibility select random data (like this: select * from table order by RAND() limit 10)

    2. Maybe add something like SQL: for universal access to SQL functions
  • yuri
    Member
    • Mar 2014
    • 8510

    #2
    The ability to write SQL will never be added due to security concerns.

    Please provide more details in future requests. It's not clear what do you mean at all.

    The ability to add custom ORM functions is available since the latest release.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • dimyy
      Active Community Member
      • Jun 2018
      • 569

      #3
      I want use this construction

      PHP Code:
       $bots = $em->getRepository('Bot')
      ->select(['id','name'])
      ->order('RAND:')
      ->limit(0,1500)
      ->find(); 
      
      for select 1500 random bots. Now I can't do it without modifying (v.6) application/Espo/ORM/QueryComposer/Functions.php, because 'RAND' function doesn't exist in the $functionList

      Adding RAND to the $functionList solving this problem

      Comment

      Working...