Class Sql
Class for compiling and executing sql statements using Simplic Async SQL. This class automatically caches compiled scripts.
Inheritance
Inherited Members
Namespace: SqlDotNet
Assembly: SqlDotNet.dll
Syntax
public class Sql
Constructors
| Improve this Doc View SourceSql(IQueryExecutor, IErrorListener)
Create sql interface
Declaration
public Sql(IQueryExecutor executor, IErrorListener errorListener)
Parameters
Type | Name | Description |
---|---|---|
IQueryExecutor | executor | If statements should be executed and not just compiled, object which definition inherit from IQieryExecuter must be passed. This implementation carries for all sql executions |
IErrorListener | errorListener |
Methods
| Improve this Doc View SourceCompile(String)
Compile sql and return compiled result
Declaration
public CompiledQuery Compile(string sql)
Parameters
Type | Name | Description |
---|---|---|
System.String | sql | Sql-Code to compile |
Returns
Type | Description |
---|---|
CompiledQuery | Result of the compiling process ready for executing |
CompileAndExecute(String, IList<QueryParameter>, Boolean)
Compile and execute a query. Use caching
Declaration
public object CompileAndExecute(string sql, IList<QueryParameter> parameter, bool useCache = true)
Parameters
Type | Name | Description |
---|---|---|
System.String | sql | Sql query as string |
System.Collections.Generic.IList<QueryParameter> | parameter | Parameter as list |
System.Boolean | useCache | if set to true, cached queries will be used |
Returns
Type | Description |
---|---|
System.Object | Return value, amount for none query objects, else query result |
Execute(CompiledQuery, IList<QueryParameter>)
Execute a compiled sql query
Declaration
public ResultSet Execute(CompiledQuery query, IList<QueryParameter> parameter)
Parameters
Type | Name | Description |
---|---|---|
CompiledQuery | query | Compiled query instance |
System.Collections.Generic.IList<QueryParameter> | parameter | List of parameter |
Returns
Type | Description |
---|---|
ResultSet | Return value, amount for none query objects, else query result |
GetTokenizer()
Create a new tokenizer instance
Declaration
public Tokenizer GetTokenizer()
Returns
Type | Description |
---|---|
Tokenizer |