Class Database
Inherited Members
Namespace: Slipe.Sql
Assembly: Slipe.Sql.dll
Syntax
public class Database
Constructors
| Improve this Doc View SourceDatabase(MySqlConnectionString, String, String, SqlOptions)
Creates a connection with a MySql server
Declaration
public Database(MySqlConnectionString connectionString, string username = "", string password = "", SqlOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| MySqlConnectionString | connectionString | |
| String | username | |
| String | password | |
| SqlOptions | options |
Database(String, SqlOptions)
Creatse a connection with a sqlite daTabase
Declaration
public Database(string filepath, SqlOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| String | filepath | |
| SqlOptions | options |
Database(String, String, String, SqlOptions)
Creates a connection with a MySql server
Declaration
public Database(string connectionString, string username = "", string password = "", SqlOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| String | connectionString | |
| String | username | |
| String | password | |
| SqlOptions | options |
Methods
| Improve this Doc View SourceExec(String, Object[])
Runs an SQL query discarding the results
Declaration
public void Exec(string query, params object[] parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| String | query | sql query |
| Object[] | parameters | parameters for the SQL query |
Query(String, Object[])
Runs an SQL query and resturns the results asynchronously
Declaration
public Task<Dictionary<string, SqlValue>[]> Query(string query, params object[] parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| String | query | sql query |
| Object[] | parameters | parameters for the SQL query |
Returns
| Type | Description |
|---|---|
| Task<Dictionary<String, SqlValue>[]> | An array of dictionaries representing the resulting rows of the query |