Space Station 13 - Modules - TypesVar Details - Proc Details

db_query

Datum based handler for all database queries

Holds information regarding inputs, status, and outputs

Vars

affectedHow many rows were affected by the query
argumentsAn associative list of parameters to be substituted into the statement
connectionThe connection being used with this query
in_progressIs the query currently in progress
itemList of data values populated by NextRow()
last_activityWhat was our last activity
last_activity_timeWhen was our last activity
last_errorWhat was our last error, if any
last_insert_idID of the last inserted row
next_row_to_takeCounter of the next row to take
rowsList of all rows returned
sqlThe SQL statement being executed with :parameter placeholders

Procs

ActivityActivity Update Handler
ExecuteMain Execution Handler
NextRowProc to get the next row in a DB query
run_queryActual Query Runner
warn_executeWrapped 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:

Execute

Main Execution Handler

Invoked by [warn_execute()] This handles query error logging, as well as invoking the actual runner Arguments:

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:

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: