SqlUtil mixin
A mixin that provides utility functions for working with SQL.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- defaultQuoteChar ↔ String?
-
The default quote character used for wrapping column names.
getter/setter pair
Static Methods
-
columnsFromList(
{required List< String> items, dynamic quoteChar, String dataBaseProvider = ""}) → String - Returns a comma-separated string of wrapped column names from the given list.
-
columnsFromMap<
K, V> ({required Map< K, V> items, dynamic quoteChar, String dataBaseProvider = ""}) → String - Returns a comma-separated string of wrapped column names from the given map.
-
generateSQLSearch(
List values, List< String> columns, [string? quoteChar, String dataBaseProvider = ""]) → String -
getIdentity(
String dataBaseProvider) → String - Returns the appropriate identity function based on the given database provider.
-
isMySql(
String dataBaseProvider) → bool - Checks if the given database provider is MySQL.
-
isSqlServer(
String dataBaseProvider) → bool - Checks if the given database provider is SQL Server.
-
quoteCharFromProvider(
String dataBaseProvider) → String? - Returns the appropriate quote character based on the given database provider.
-
replaceSQLParameters(
string s, JsonRow params, [bool nullAsBlank = true, string parameterMatch = ":"]) → String -
topOrLimit(
String dataBaseProvider, int? count) → String - Returns the appropriate "TOP" or "LIMIT" clause based on the given database provider and count.
-
value<
T> (T? value, [bool nullAsBlank = false, bool quoteStrings = true]) → string -
valuesFromList(
{required Iterable items, bool nullAsBlank = false}) → String - Returns a comma-separated string of SQL values from the given list.
-
valuesFromMap(
{required Map items, bool nullAsBlank = false}) → String - Returns a comma-separated string of SQL values from the given map.
-
wrap(
String objectName, [dynamic quoteChar, String dataBaseProvider = ""]) → dynamic - Wraps the given object name with the specified quote character. If the quote character is not provided and the database provider is specified, it uses the appropriate quote character. Otherwise, it uses the defaultQuoteChar.