Space Station 13 - Modules - TypesVar Details - Proc Details

dbcore

Vars

active_queriesList of currenty processing queries
connectionConnection handle. This is an arbitrary handle returned from rust_g.
failed_connection_timeoutTimeout of failed connections
failed_connectionsAmount of failed connections
last_errorLast error to occur
schema_validIs the DB schema valid
total_errorsSQL errors that have occured mid round

Procs

CheckSchemaVersionSchema Version Checker
ConnectConnection Creator
DisconnectDisconnection Handler
ErrorMsgError Message Helper
IsConnectedIsConnected Helper
MassExecuteHandler to allow many queries to be executed en masse
NewQueryNew Query Invoker
ReportErrorError Reporting Helper
SetRoundEndRound End Time Setter
SetRoundIDRound ID Setter
SetRoundStartRound End Time Setter
ShutdownShutdown Handler

Var Details

active_queries

List of currenty processing queries

connection

Connection handle. This is an arbitrary handle returned from rust_g.

failed_connection_timeout

Timeout of failed connections

failed_connections

Amount of failed connections

last_error

Last error to occur

schema_valid

Is the DB schema valid

total_errors

SQL errors that have occured mid round

Proc Details

CheckSchemaVersion

Schema Version Checker

Basically verifies that the DB schema in the config is the same as the version the game is expecting. If it is a valid version, the DB will then connect.

Connect

Connection Creator

This proc basically does a few sanity checks before connecting, then attempts to make a connection When connecting, RUST_G will initialize a thread pool for queries to use to run asynchronously

Disconnect

Disconnection Handler

Tells the DLL to clean up any open connections. This will also reset the failed connection counter

ErrorMsg

Error Message Helper

Returns the last error that the subsystem encountered. Will always report "Database disabled by configuration" if the DB is disabled.

IsConnected

IsConnected Helper

Short helper to check if the DB is connected or not. Does a few sanity checks, then asks the DLL if we are properly connected

MassExecute

Handler to allow many queries to be executed en masse

Feed this proc a list of queries and it will execute them all at once, by the power of async magic!

Arguments:

NewQuery

New Query Invoker

Checks to make sure this query isnt being invoked by admin fuckery, then returns a new /datum/db_query

Arguments:

ReportError

Error Reporting Helper

Pretty much just sets last_error to the error argument

Arguments:

SetRoundEnd

Round End Time Setter

Called during SSticker.declare_completion() Sets the time that the round ended in the DB, as well as some other params

SetRoundID

Round ID Setter

Called during world/New() at the earliest point Declares a round ID in the database and assigns it to a global. Also ensures that server address and ports are set

SetRoundStart

Round End Time Setter

Called during SSticker.setup() Sets the time that the round started in the DB

Shutdown

Shutdown Handler

Called during world/Reboot() as part of the MC shutdown Finalises a round in the DB before disconnecting.