OsSql - oversight-group/ossql GitHub Wiki

Builder

Builder class contains SQL query construction methods.

public class OsSql.Builder

Static Methods

Type Name Summary
String ColTypeSQLTitle(ColumnType type) Gets the SQL column type name based on ColumnType element.
ColumnType ColumnTypeFromObjectType(Type type) Gets a ColumnType of object by its type.
String GetCreationQuery(ICollection<Table> list) Generates a full database creation query based on a collection of tables.
String GetCreationQuery(Structure structure) Generates a full database creation query based on a collection of tables.
String GetCreationQuery(Table[] list) Generates a full database creation query based on a collection of tables.
Object GetObject(Object content, Nullable<ColumnType> type, Boolean save, Boolean& success, Type pt = null) Gets an object value with its relevant type.
List<Parameter> ListAllClassValues(Object classPointer, Table table, String name = , Boolean skipnull = False) Creates a list of OsSqlTypes.Parameter of all class properties in order to manipulate data (insert/update).

IOsSqlElement

An interface for a class that is being used with OsSql in order to save value in the database.

public interface OsSql.IOsSqlElement

Methods

Type Name Summary
Int32 GetID() Saves the key value of the current class. Mostly this one should return an ID, or AI integer key of data enteries.

OsSqlDebugger

Handles the internal debugger of OsSql.

public class OsSql.OsSqlDebugger

Static Methods

Type Name Summary
void Error(String msg) Sends a debug error message.
void Message(String msg) Sends a debug information message.
void Query(MySqlCommand cmd) Query debug.

Static Events

Type Name Summary
DebugDelegate OnOsSqlDebugMessage An event used to trace OsSql debug messages.
DebugDelegate OnOsSqlQuery An event used to trace OsSql queries.

OsSqlTypes

Contains any type that is being used with OsSql.

public class OsSql.OsSqlTypes

SQL

SQL class allows to handle the MySQL database.

public class OsSql.SQL

Fields

Type Name Summary
MySqlConnection Connection Represents a connection to an SQL server database.
MySqlConnectionStringBuilder ConnectionDetails Represents the connection details.

Methods

Type Name Summary
void AddColumn(String table, ColumnType type, String column, Boolean ai = False) Adds a new column to a table.
Int32 AutoInsert(Object classPointer, Table table, String name = , Boolean skipnull = False) Auto-inserts database row. This means that any existing data within a classPointer will be inserted to the database.
T AutoLoad(Table table, String condition, Dictionary2&data,Stringname = ,Parameter[]` conditionparams)
List<Dictionary<String, Object>> AutoSelect(Table table, String condition, String name = , Parameter[] conditionparams) Auto-reads from the database based on the synchronized table parameter. This is just a regular select statement, filtered only with fields that are both in the class and in the database.
void AutoUpdate(Object classPointer, Table table, String condition, String name = , Boolean skipnull = False, Parameter[] conditionparams) Auto-updates database rows. This means that any existing data within a classPointer will be updated in the database.
Boolean Connect() Creates a direct connection for the purpose of reading and writing to the database.
Int32 Count(String table, String condition = , Parameter[] conditionparams) Returns the number of rows based on a condition.
Int32 Count(Table table, String condition = , Parameter[] conditionparams) Returns the number of rows based on a condition.
void Delete(String table, String condition, Parameter[] conditionparams) Deletes a row from the table.
void Delete(Table table, String condition, Parameter[] conditionparams) Deletes a row from the table.
void Disconnect() Closes the connection to the database.
void DropColumn(String table, String column) Deletes a column from a table.
Int32 Insert(String table, Parameter[] parameters) Adds a new entry to the table.
Int32 Insert(Table table, Parameter[] parameters) Adds a new entry to the table.
Boolean IsColumnExists(String table, String column) Checks if column exists in a table.
void Query(String query, Parameter[] parameters) Sends a query to the database.
DataTable Read(String table, String condition = , String key = *, Parameter[] conditionparams) Select statement for SQL based on a new instance of DataTable.
DataTable Read(Table table, String condition = , String key = *, Parameter[] conditionparams) Select statement for SQL based on a new instance of DataTable.
DataTable Read(DataSet& ds, String table, String condition = , String key = *, Parameter[] conditionparams) Select statement for SQL based on a new instance of DataTable.
DataTable Read(DataSet& ds, Table table, String condition = , String key = *, Parameter[] conditionparams) Select statement for SQL based on a new instance of DataTable.
List<Dictionary<String, Object>> Select(String table, String condition = , String key = *, Parameter[] conditionparams) Select statement for SQL.
List<Dictionary<String, Object>> Select(Table table, String condition = , String key = *, Parameter[] conditionparams) Select statement for SQL.
void Update(String table, String condition, Parameter[] parameters) Updates the database.
void Update(Table table, String condition, Parameter[] parameters) Updates the database.
void UpdateColumns(Table table, String sqlname = , Boolean delete = False) Updates the table columns in database to match the table that defined in the code.
void UpdateStructure(Structure structure, Boolean updateTables = False, Boolean delete = False) Updates the database tables columns to match the tables that defined in a specific structure.
⚠️ **GitHub.com Fallback** ⚠️