C# Class UserDefinedFunctions, J-SQL

ファイルを表示 Open project: jgcoding/J-SQL Class Usage Examples

Public Properties

Property Type Description
jsUnixDate Regex
rxIncludedKey Regex
rxIsUUID Regex
rxJsonAll Regex
rxJsonAll_old Regex
rxJsonIndexDocument Regex
rxJsonMapIndex Regex
rxJsonMergeIndex Regex
rxJsonReduceIndex Regex
rxKey Regex
rxKeyInUrl Regex
rxParseArrayOfObjects Regex
rxSimpleNumericArray Regex
rxSimpleStringArray Regex
rxUrl Regex
rxUrlAncestry Regex
sc StringComparison

Public Methods

Method Description
FormatColumnForJson ( String colName, String sdt, String alias, Boolean nullable ) : String
FormatColumnInput ( String colName, String sdt ) : String
JsonEscape ( String unescaped ) : String
JsonFormat ( SqlDataReader dr, Int32 colno ) : String

Converts an individual SqlDataReader row referenced by its column index integer into JSON

NewID ( List orows, List irows ) : Int32

returns the last ObjectID from the inner collection

SqlErrorMessage ( SqlException sqlex ) : String
StringifiedRows ( object row, SqlGuid &ItemID, SqlString &Json ) : void

Converts a result set returned from SQL Server into JSON formatted array of objects and values

StringifySqlColumn ( String colName, String sdt ) : String
TemplateJsonUrl ( String url ) : String

Each Group item represents a named capture group defined in the pattern. This function can be used to parse and re-assemble each url into a template used in indexing by replacing each Within each group the actual values captured by the pattern are collected. "Url" is the complete address of an Item in a parsed collection of JSON elements. "Node" represents each object or array within the hierarchy of the URL. "NodeKey" represents UUID for each object or array providing ownership and identifiable differences within a collection of the same. "itemKey" is the key in the key/value pair of any Json element.

Private Methods

Method Description
ConcatFormatColumns ( SqlString objName, SqlString cols, SqlString alias, SqlBoolean nullable ) : SqlString
FromJsUnixTime ( String jsunixdate ) : DateTime
FromUnixTime ( Double udt ) : DateTime
ParseJson ( JsonRow eroot, Int32 newID ) : List

Returns a list of strongly-typed row objects

ParseJson_experimental ( JsonRow eroot, Int32 newID ) : List

An experimental, work-in-progress effort to return a list of strongly-typed row objects more efficiently than the original ParseJson

ParsedRows ( Object row, Int32 &ParentID, Int32 &ObjectID, String &Node, String &itemKey, String &itemValue, String &itemType ) : void

The strongly typed row result object from a ToJsonTable call

SqlDecrypt ( string json, int strength ) : string
SqlEncrypt ( string json, int strength ) : byte[]
SqlStringifyRow ( String objName, String pKeyName, SqlGuid pKeyValue, String cols, String where, String misc ) : IEnumerable
SqlStringifyRow2 ( SqlGuid docid, SqlString query ) : IEnumerable
SqlStringifySet ( String objName, String criteria, String cols ) : SqlString
StringifyColumn ( String key, String value, String dt ) : String
ToJavaScriptDate ( DateTime dt ) : String
ToJsonTable ( String json ) : IEnumerable
ToUnixTime ( DateTime dt ) : Double
blockSqlInjection ( String query ) : String

Examines the columns to be included in the operation for key words utilized in SQL injection attacks.

blockSqlInjection ( String objName, String cols ) : String

Examines a fully qualified SQL object and the columns to be included in the operation for key words utilized in SQL injection attacks.

buildQueryString ( String objName, String criteria, String cols ) : StringBuilder

construct the core query header

rxContains ( String json, String value ) : Boolean
sqlErrorMessage ( SqlException sqlex ) : String

construct and manage sql server error messages

Method Details

FormatColumnForJson() public static method

public static FormatColumnForJson ( String colName, String sdt, String alias, Boolean nullable ) : String
colName String
sdt String
alias String
nullable Boolean
return String

FormatColumnInput() public static method

public static FormatColumnInput ( String colName, String sdt ) : String
colName String
sdt String
return String

JsonEscape() public static method

public static JsonEscape ( String unescaped ) : String
unescaped String
return String

JsonFormat() public static method

Converts an individual SqlDataReader row referenced by its column index integer into JSON
public static JsonFormat ( SqlDataReader dr, Int32 colno ) : String
dr SqlDataReader SqlDataReader - the row returned from the SQL select operation
colno Int32 The column index used to look up the column meta-data
return String

NewID() public static method

returns the last ObjectID from the inner collection
public static NewID ( List orows, List irows ) : Int32
orows List The collection of outer rows
irows List The collection of inner rows
return Int32

SqlErrorMessage() public static method

public static SqlErrorMessage ( SqlException sqlex ) : String
sqlex SqlException
return String

StringifiedRows() public static method

Converts a result set returned from SQL Server into JSON formatted array of objects and values
public static StringifiedRows ( object row, SqlGuid &ItemID, SqlString &Json ) : void
row object A SQL row return from any SQL Set-based operation
ItemID SqlGuid The unique identifier for the row. The row key.
Json SqlString The output result as a JSON formatted string
return void

StringifySqlColumn() public static method

public static StringifySqlColumn ( String colName, String sdt ) : String
colName String
sdt String
return String

TemplateJsonUrl() public static method

Each Group item represents a named capture group defined in the pattern. This function can be used to parse and re-assemble each url into a template used in indexing by replacing each Within each group the actual values captured by the pattern are collected. "Url" is the complete address of an Item in a parsed collection of JSON elements. "Node" represents each object or array within the hierarchy of the URL. "NodeKey" represents UUID for each object or array providing ownership and identifiable differences within a collection of the same. "itemKey" is the key in the key/value pair of any Json element.
public static TemplateJsonUrl ( String url ) : String
url String JsonUrl for a parsed Json element
return String

Property Details

jsUnixDate public_oe static_oe property

public static Regex jsUnixDate
return Regex

rxIncludedKey public_oe static_oe property

public static Regex rxIncludedKey
return Regex

rxIsUUID public_oe static_oe property

public static Regex rxIsUUID
return Regex

rxJsonAll public_oe static_oe property

public static Regex rxJsonAll
return Regex

rxJsonAll_old public_oe static_oe property

public static Regex rxJsonAll_old
return Regex

rxJsonIndexDocument public_oe static_oe property

public static Regex rxJsonIndexDocument
return Regex

rxJsonMapIndex public_oe static_oe property

public static Regex rxJsonMapIndex
return Regex

rxJsonMergeIndex public_oe static_oe property

public static Regex rxJsonMergeIndex
return Regex

rxJsonReduceIndex public_oe static_oe property

public static Regex rxJsonReduceIndex
return Regex

rxKey public_oe static_oe property

public static Regex rxKey
return Regex

rxKeyInUrl public_oe static_oe property

public static Regex rxKeyInUrl
return Regex

rxParseArrayOfObjects public_oe static_oe property

public static Regex rxParseArrayOfObjects
return Regex

rxSimpleNumericArray public_oe static_oe property

public static Regex rxSimpleNumericArray
return Regex

rxSimpleStringArray public_oe static_oe property

public static Regex rxSimpleStringArray
return Regex

rxUrl public_oe static_oe property

public static Regex rxUrl
return Regex

rxUrlAncestry public_oe static_oe property

public static Regex rxUrlAncestry
return Regex

sc public_oe static_oe property

public static StringComparison sc
return StringComparison