db_query
Datum based handler for all database queries
Holds information regarding inputs, status, and outputs
Vars | |
affected | How many rows were affected by the query |
---|---|
arguments | An associative list of parameters to be substituted into the statement |
connection | The connection being used with this query |
in_progress | Is the query currently in progress |
item | List of data values populated by NextRow() |
last_activity | What was our last activity |
last_activity_time | When was our last activity |
last_error | What was our last error, if any |
last_insert_id | ID of the last inserted row |
next_row_to_take | Counter of the next row to take |
rows | List of all rows returned |
sql | The SQL statement being executed with :parameter placeholders |
Procs | |
Activity | Activity Update Handler |
Execute | Main Execution Handler |
NextRow | Proc to get the next row in a DB query |
run_query | Actual Query Runner |
warn_execute | Wrapped for warning on execution |
Var Details
affected
How many rows were affected by the query
arguments
An associative list of parameters to be substituted into the statement
connection
The connection being used with this query
in_progress
Is the query currently in progress
item
List of data values populated by NextRow()
last_activity
What was our last activity
last_activity_time
When was our last activity
last_error
What was our last error, if any
last_insert_id
ID of the last inserted row
next_row_to_take
Counter of the next row to take
rows
List of all rows returned
sql
The SQL statement being executed with :parameter placeholders
Proc Details
Activity
Activity Update Handler
Sets the last activity text to the argument input, as well as updating the activity time
Arguments:
- activity - Last activity text
Execute
Main Execution Handler
Invoked by [warn_execute()] This handles query error logging, as well as invoking the actual runner Arguments:
- async - Are we running this query asynchronously
- log_error - Do we want to log errors this creates? Disable this if you are running sensitive queries where you dont want errors logged in plain text (EG: Auth token stuff)
NextRow
Proc to get the next row in a DB query
Cycles item
to the next row in the DB query, if multiple were fetched
run_query
Actual Query Runner
This does the main query with the database and the rust calls themselves
Arguments:
- async - Are we running this query asynchronously
warn_execute
Wrapped for warning on execution
You should use this proc when running the SQL statement. It will auto inform the user and the online admins if a query fails
Arguments:
- async - Are we running this query asynchronously
- log_error - Do we want to log errors this creates? Disable this if you are running sensitive queries where you dont want errors logged in plain text (EG: Auth token stuff)