You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

36 lines
867 B

  1. /datum/BSQL_Operation/Query
  2. var/last_result_json
  3. var/list/last_result
  4. BSQL_PROTECT_DATUM(/datum/BSQL_Operation/Query)
  5. /datum/BSQL_Operation/Query/CurrentRow()
  6. return last_result
  7. /datum/BSQL_Operation/Query/IsComplete()
  8. //whole different ballgame here
  9. if(BSQL_IS_DELETED(connection))
  10. return TRUE
  11. var/result = world._BSQL_Internal_Call("ReadyRow", connection.id, id)
  12. switch(result)
  13. if("DONE")
  14. //load the data
  15. LoadQueryResult()
  16. return TRUE
  17. if("NOTDONE")
  18. return FALSE
  19. else
  20. BSQL_ERROR(result)
  21. /datum/BSQL_Operation/Query/WaitForCompletion()
  22. . = ..()
  23. if(.)
  24. LoadQueryResult()
  25. /datum/BSQL_Operation/Query/proc/LoadQueryResult()
  26. last_result_json = world._BSQL_Internal_Call("GetRow", connection.id, id)
  27. if(last_result_json)
  28. last_result = json_decode(last_result_json)
  29. else
  30. last_result = null