Anvil
Anvil.API.SQLQuery Class Reference

A SQL Query. More...

+ Inheritance diagram for Anvil.API.SQLQuery:
+ Collaboration diagram for Anvil.API.SQLQuery:

Public Member Functions

void BindParam (string param, float value)
 Binds the specified parameter with the specified value. More...
 
void BindParam (string param, int value)
 Binds the specified parameter with the specified value. More...
 
void BindParam (string param, NwObject value)
 Binds the specified parameter with the specified value. More...
 
void BindParam (string param, string value)
 Binds the specified parameter with the specified value. More...
 
void BindParam (string param, Vector3 value)
 Binds the specified parameter with the specified value. More...
 
void Execute ()
 Executes this query. More...
 
void Reset (bool clearBinds=false)
 Reset this sqlquery, readying it for re-execution after results have been fetched.
Existing BindParam values are kept, unless the clearBinds argument is set to true. More...
 
- Public Member Functions inherited from Anvil.API.EngineStructure
void Dispose ()
 

Static Public Member Functions

static implicit operator SQLQuery (IntPtr intPtr)
 
- Static Public Member Functions inherited from Anvil.API.EngineStructure
static implicit operator IntPtr (EngineStructure engineStructure)
 

Properties

string[] Columns [get]
 Gets the name of the columns declared as a part of this query. More...
 
string Error [get]
 Returns "" if the last Sql command succeeded; or a human-readable error otherwise.
Additionally, all SQL errors are sent to all connected players. More...
 
SQLResult?? Result [get]
 Gets the result of this query.
NOTE: If Results have been enumerated, this will be the last enumerated value. More...
 
IEnumerable< SQLResultResults [get]
 Gets the results of this query.
NOTE: Results can only be enumerated once. Be careful with usage of LINQ extensions and loops. More...
 
override int StructureId [get]
 
- Properties inherited from Anvil.API.EngineStructure
bool IsValid [get]
 Gets if this object is valid. More...
 
abstract int StructureId [get]
 

Additional Inherited Members

- Protected Member Functions inherited from Anvil.API.EngineStructure
 EngineStructure (IntPtr handle, bool memoryOwn)
 

Detailed Description

A SQL Query.

Member Function Documentation

◆ BindParam() [1/5]

void Anvil.API.SQLQuery.BindParam ( string  param,
float  value 
)
inline

Binds the specified parameter with the specified value.

Parameters
paramThe parameter name to bind.
valueThe value to bind to the parameter.

◆ BindParam() [2/5]

void Anvil.API.SQLQuery.BindParam ( string  param,
int  value 
)
inline

Binds the specified parameter with the specified value.

Parameters
paramThe parameter name to bind.
valueThe value to bind to the parameter.

◆ BindParam() [3/5]

void Anvil.API.SQLQuery.BindParam ( string  param,
NwObject  value 
)
inline

Binds the specified parameter with the specified value.

Parameters
paramThe parameter name to bind.
valueThe value to bind to the parameter.

◆ BindParam() [4/5]

void Anvil.API.SQLQuery.BindParam ( string  param,
string  value 
)
inline

Binds the specified parameter with the specified value.

Parameters
paramThe parameter name to bind.
valueThe value to bind to the parameter.

◆ BindParam() [5/5]

void Anvil.API.SQLQuery.BindParam ( string  param,
Vector3  value 
)
inline

Binds the specified parameter with the specified value.

Parameters
paramThe parameter name to bind.
valueThe value to bind to the parameter.

◆ Execute()

void Anvil.API.SQLQuery.Execute ( )
inline

Executes this query.

◆ Reset()

void Anvil.API.SQLQuery.Reset ( bool  clearBinds = false)
inline

Reset this sqlquery, readying it for re-execution after results have been fetched.
Existing BindParam values are kept, unless the clearBinds argument is set to true.

This command only works on successfully-prepared queries that have not errored out.

Parameters
clearBindsTrue if existing bind parameters should be cleared, false if they should be kept.

Property Documentation

◆ Columns

string [] Anvil.API.SQLQuery.Columns
get

Gets the name of the columns declared as a part of this query.

◆ Error

string Anvil.API.SQLQuery.Error
get

Returns "" if the last Sql command succeeded; or a human-readable error otherwise.
Additionally, all SQL errors are sent to all connected players.

◆ Result

SQLResult?? Anvil.API.SQLQuery.Result
get

Gets the result of this query.
NOTE: If Results have been enumerated, this will be the last enumerated value.

◆ Results

IEnumerable<SQLResult> Anvil.API.SQLQuery.Results
get

Gets the results of this query.
NOTE: Results can only be enumerated once. Be careful with usage of LINQ extensions and loops.


The documentation for this class was generated from the following file: