DbScripts
Assembly: ServiceStack.OrmLite.dll
View Source
public class DbScripts : ScriptMethods
Properties
DbFactory
View Source
public IDbConnectionFactory DbFactory { get; set; }
Inherited Properties
Context
View Source
public ScriptContext Context { get; set; }
InvokerCache
View Source
public ConcurrentDictionary<string, MethodInvoker> InvokerCache { get; }
Pages
View Source
public ISharpPages Pages { get; set; }
Methods
OpenDbConnection(ScriptScopeContext, Dictionary<String, Object>)
View Source
public IDbConnection OpenDbConnection(ScriptScopeContext scope, Dictionary<string, object> options)
Returns
IDbConnection
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
Dictionary<System.String,System.Object> | options |
useDb(ScriptScopeContext, Dictionary<String, Object>)
View Source
public IgnoreResult useDb(ScriptScopeContext scope, Dictionary<string, object> dbConnOptions)
Returns
ServiceStack.Script.IgnoreResult
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
Dictionary<System.String,System.Object> | dbConnOptions |
dbSelect(ScriptScopeContext, String)
View Source
public object dbSelect(ScriptScopeContext scope, string sql)
Returns
System.Object
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | sql |
dbSelect(ScriptScopeContext, String, Dictionary<String, Object>)
View Source
public object dbSelect(ScriptScopeContext scope, string sql, Dictionary<string, object> args)
Returns
System.Object
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | sql |
Dictionary<System.String,System.Object> | args |
dbSelect(ScriptScopeContext, String, Dictionary<String, Object>, Object)
View Source
public object dbSelect(ScriptScopeContext scope, string sql, Dictionary<string, object> args, object options)
Returns
System.Object
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | sql |
Dictionary<System.String,System.Object> | args |
System.Object | options |
dbSingle(ScriptScopeContext, String)
View Source
public object dbSingle(ScriptScopeContext scope, string sql)
Returns
System.Object
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | sql |
dbSingle(ScriptScopeContext, String, Dictionary<String, Object>)
View Source
public object dbSingle(ScriptScopeContext scope, string sql, Dictionary<string, object> args)
Returns
System.Object
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | sql |
Dictionary<System.String,System.Object> | args |
dbSingle(ScriptScopeContext, String, Dictionary<String, Object>, Object)
View Source
public object dbSingle(ScriptScopeContext scope, string sql, Dictionary<string, object> args, object options)
Returns
System.Object
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | sql |
Dictionary<System.String,System.Object> | args |
System.Object | options |
dbScalar(ScriptScopeContext, String)
View Source
public object dbScalar(ScriptScopeContext scope, string sql)
Returns
System.Object
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | sql |
dbScalar(ScriptScopeContext, String, Dictionary<String, Object>)
View Source
public object dbScalar(ScriptScopeContext scope, string sql, Dictionary<string, object> args)
Returns
System.Object
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | sql |
Dictionary<System.String,System.Object> | args |
dbScalar(ScriptScopeContext, String, Dictionary<String, Object>, Object)
View Source
public object dbScalar(ScriptScopeContext scope, string sql, Dictionary<string, object> args, object options)
Returns
System.Object
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | sql |
Dictionary<System.String,System.Object> | args |
System.Object | options |
dbCount(ScriptScopeContext, String)
View Source
public long dbCount(ScriptScopeContext scope, string sql)
Returns
System.Int64
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | sql |
dbCount(ScriptScopeContext, String, Dictionary<String, Object>)
View Source
public long dbCount(ScriptScopeContext scope, string sql, Dictionary<string, object> args)
Returns
System.Int64
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | sql |
Dictionary<System.String,System.Object> | args |
dbCount(ScriptScopeContext, String, Dictionary<String, Object>, Object)
View Source
public long dbCount(ScriptScopeContext scope, string sql, Dictionary<string, object> args, object options)
Returns
System.Int64
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | sql |
Dictionary<System.String,System.Object> | args |
System.Object | options |
dbExists(ScriptScopeContext, String)
View Source
public bool dbExists(ScriptScopeContext scope, string sql)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | sql |
dbExists(ScriptScopeContext, String, Dictionary<String, Object>)
View Source
public bool dbExists(ScriptScopeContext scope, string sql, Dictionary<string, object> args)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | sql |
Dictionary<System.String,System.Object> | args |
dbExists(ScriptScopeContext, String, Dictionary<String, Object>, Object)
View Source
public bool dbExists(ScriptScopeContext scope, string sql, Dictionary<string, object> args, object options)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | sql |
Dictionary<System.String,System.Object> | args |
System.Object | options |
dbExec(ScriptScopeContext, String)
View Source
public int dbExec(ScriptScopeContext scope, string sql)
Returns
System.Int32
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | sql |
dbExec(ScriptScopeContext, String, Dictionary<String, Object>)
View Source
public int dbExec(ScriptScopeContext scope, string sql, Dictionary<string, object> args)
Returns
System.Int32
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | sql |
Dictionary<System.String,System.Object> | args |
dbExec(ScriptScopeContext, String, Dictionary<String, Object>, Object)
View Source
public int dbExec(ScriptScopeContext scope, string sql, Dictionary<string, object> args, object options)
Returns
System.Int32
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | sql |
Dictionary<System.String,System.Object> | args |
System.Object | options |
dbNamedConnections()
View Source
public List<string> dbNamedConnections()
Returns
List<System.String>
dbTableNames(ScriptScopeContext)
View Source
public List<string> dbTableNames(ScriptScopeContext scope)
Returns
List<System.String>
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
dbTableNames(ScriptScopeContext, Dictionary<String, Object>)
View Source
public List<string> dbTableNames(ScriptScopeContext scope, Dictionary<string, object> args)
Returns
List<System.String>
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
Dictionary<System.String,System.Object> | args |
dbTableNames(ScriptScopeContext, Dictionary<String, Object>, Object)
View Source
public List<string> dbTableNames(ScriptScopeContext scope, Dictionary<string, object> args, object options)
Returns
List<System.String>
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
Dictionary<System.String,System.Object> | args |
System.Object | options |
dbTableNamesWithRowCounts(ScriptScopeContext)
View Source
public List<KeyValuePair<string, long>> dbTableNamesWithRowCounts(ScriptScopeContext scope)
Returns
List<KeyValuePair<System.String,System.Int64>>
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
dbTableNamesWithRowCounts(ScriptScopeContext, Dictionary<String, Object>)
View Source
public List<KeyValuePair<string, long>> dbTableNamesWithRowCounts(ScriptScopeContext scope, Dictionary<string, object> args)
Returns
List<KeyValuePair<System.String,System.Int64>>
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
Dictionary<System.String,System.Object> | args |
dbTableNamesWithRowCounts(ScriptScopeContext, Dictionary<String, Object>, Object)
View Source
public List<KeyValuePair<string, long>> dbTableNamesWithRowCounts(ScriptScopeContext scope, Dictionary<string, object> args, object options)
Returns
List<KeyValuePair<System.String,System.Int64>>
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
Dictionary<System.String,System.Object> | args |
System.Object | options |
dbColumnNames(ScriptScopeContext, String)
View Source
public string[] dbColumnNames(ScriptScopeContext scope, string tableName)
Returns
System.String[]
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | tableName |
dbColumnNames(ScriptScopeContext, String, Object)
View Source
public string[] dbColumnNames(ScriptScopeContext scope, string tableName, object options)
Returns
System.String[]
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | tableName |
System.Object | options |
dbColumns(ScriptScopeContext, String)
View Source
public ColumnSchema[] dbColumns(ScriptScopeContext scope, string tableName)
Returns
ServiceStack.OrmLite.ColumnSchema[]
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | tableName |
dbColumns(ScriptScopeContext, String, Object)
View Source
public ColumnSchema[] dbColumns(ScriptScopeContext scope, string tableName, object options)
Returns
ServiceStack.OrmLite.ColumnSchema[]
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | tableName |
System.Object | options |
dbDesc(ScriptScopeContext, String)
View Source
public ColumnSchema[] dbDesc(ScriptScopeContext scope, string sql)
Returns
ServiceStack.OrmLite.ColumnSchema[]
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | sql |
dbDesc(ScriptScopeContext, String, Object)
View Source
public ColumnSchema[] dbDesc(ScriptScopeContext scope, string sql, object options)
Returns
ServiceStack.OrmLite.ColumnSchema[]
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | sql |
System.Object | options |
sqlQuote(ScriptScopeContext, String)
View Source
public string sqlQuote(ScriptScopeContext scope, string name)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | name |
sqlConcat(ScriptScopeContext, IEnumerable<Object>)
View Source
public string sqlConcat(ScriptScopeContext scope, IEnumerable<object> values)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
IEnumerable<System.Object> | values |
sqlCurrency(ScriptScopeContext, String)
View Source
public string sqlCurrency(ScriptScopeContext scope, string fieldOrValue)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | fieldOrValue |
sqlCurrency(ScriptScopeContext, String, String)
View Source
public string sqlCurrency(ScriptScopeContext scope, string fieldOrValue, string symbol)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | fieldOrValue |
System.String | symbol |
sqlCast(ScriptScopeContext, Object, String)
View Source
public string sqlCast(ScriptScopeContext scope, object fieldOrValue, string castAs)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.Object | fieldOrValue |
System.String | castAs |
sqlBool(ScriptScopeContext, Boolean)
View Source
public string sqlBool(ScriptScopeContext scope, bool value)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.Boolean | value |
sqlTrue(ScriptScopeContext)
View Source
public string sqlTrue(ScriptScopeContext scope)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
sqlFalse(ScriptScopeContext)
View Source
public string sqlFalse(ScriptScopeContext scope)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
sqlLimit(ScriptScopeContext, Nullable<Int32>, Nullable<Int32>)
View Source
public string sqlLimit(ScriptScopeContext scope, int? offset, int? limit)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.Nullable<System.Int32> | offset |
System.Nullable<System.Int32> | limit |
sqlLimit(ScriptScopeContext, Nullable<Int32>)
View Source
public string sqlLimit(ScriptScopeContext scope, int? limit)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.Nullable<System.Int32> | limit |
sqlSkip(ScriptScopeContext, Nullable<Int32>)
View Source
public string sqlSkip(ScriptScopeContext scope, int? offset)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.Nullable<System.Int32> | offset |
sqlTake(ScriptScopeContext, Nullable<Int32>)
View Source
public string sqlTake(ScriptScopeContext scope, int? limit)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.Nullable<System.Int32> | limit |
sqlOrderByFields(ScriptScopeContext, String)
View Source
public string sqlOrderByFields(ScriptScopeContext scope, string orderBy)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | orderBy |
ormliteVar(ScriptScopeContext, String)
View Source
public string ormliteVar(ScriptScopeContext scope, string name)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | name |
sqlVerifyFragment(String)
View Source
public string sqlVerifyFragment(string sql)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | sql |
isUnsafeSql(String)
View Source
public bool isUnsafeSql(string sql)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | sql |
isUnsafeSqlFragment(String)
View Source
public bool isUnsafeSqlFragment(string sql)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | sql |
Inherited Methods
GetInvoker(String, Int32, InvokerType)
View Source
public MethodInvoker GetInvoker(string name, int argsCount, InvokerType type)
Returns
Parameters
Type | Name |
---|---|
System.String | name |
System.Int32 | argsCount |
ServiceStack.Script.InvokerType | type |
QueryFilters(String)
View Source
public List<MethodInfo> QueryFilters(string filterName)
Returns
System.Collections.Generic.List<System.Reflection.MethodInfo>
Parameters
Type | Name |
---|---|
System.String | filterName |