title: Insert Room data from WorkManager Worker?
body: <p>I am following the Android room tutorial.. but have a slightly different requirement than it.  I want to run a job in the background.. and insert a database item there, instead of with a button or on startup like they have it.  I cannot find a way to do this?</p>
  <pre><code>override fun doWork(): Result {
      try {
    
        val appContext = applicationContext
  
    ......
        
        val newDataItem = DataItem(param1 = &quot;Title&quot;, iso_datetime_msg_received = &quot;RIGHTNOW&quot;, alert_message = &quot;HI!!!&quot;, uuid = 1231)
  
      
        // THE LINE BELOW IS WHAT I WANT BUT GET AN ERROR 
        // Suspend function 'insert' should be called only from a coroutine or another suspend function
  
      CustomRoomDatabase.getDatabase(myContext).dataItemDao().insert(newDataItem)
        return Result.success(result)
      } catch(error: Throwable) {
          Log.i(TAG, &quot;RetrieveDataItemWorker got error:&quot; + error)
          return Result.retry()
      }
  }
  </code></pre>