QuerySubstitutionNames

public enum QuerySubstitutionNames : Int

Enum defining the cases and their index for the substitutions array used by QueryBuilder to account for variances between the various database engines.

Usage Example:

In this example, a QueryBuilder for PostgreSQL is initialized. Parameters are set for PostgreSQL and strings keywords for SQL queries are substituted into the queryBuilder. The QuerySubstitutionNames enum is used to refer to substitutions by name instead of their position in the “substitutions” array.

let queryBuilder = QueryBuilder(withDeleteRequiresUsing: true, withUpdateRequiresFrom: true, createAutoIncrement: createAutoIncrement)
queryBuilder.updateSubstitutions([QueryBuilder.QuerySubstitutionNames.ucase : "UPPER",
   QueryBuilder.QuerySubstitutionNames.lcase : "LOWER",
   QueryBuilder.QuerySubstitutionNames.len : "LENGTH",
   QueryBuilder.QuerySubstitutionNames.numberedParameter : "$",
   QueryBuilder.QuerySubstitutionNames.namedParameter : "",
   QueryBuilder.QuerySubstitutionNames.double : "double precision"
])
  • The SQL UCASE scalar function to convert a string to upper-case.

    Declaration

    Swift

    case ucase
  • The SQL LCASE scalar function to convert a string to lower-case.

    Declaration

    Swift

    case lcase
  • len

    The SQL LEN scalar function to return the length of a string.

    Declaration

    Swift

    case len
  • now

    The SQL NOW scalar function to return the current date and time.

    Declaration

    Swift

    case now
  • mid

    The SQL MID scalar function to return a portion of a string.

    Declaration

    Swift

    case mid
  • The marker for the query numbered parameters.

    Declaration

    Swift

    case numberedParameter
  • The marker for the query named parameters.

    Declaration

    Swift

    case namedParameter
  • The boolean true.

    Declaration

    Swift

    case booleanTrue
  • The boolean false.

    Declaration

    Swift

    case booleanFalse
  • all

    The ALL function for subqueries.

    Declaration

    Swift

    case all
  • The character used to quote identifiers (table name, column name, etc.) with spaces or special characters.

    Declaration

    Swift

    case identifierQuoteCharacter
  • The database type that corresponds to Int32.

    Declaration

    Swift

    case int32
  • The database type that corresponds to Float.

    Declaration

    Swift

    case float
  • The database type that corresponds to Double.

    Declaration

    Swift

    case double
  • The database type that corresponds to char.

    Declaration

    Swift

    case char
  • The database type that corresponds to UUID. Accepts a string representation of UUID.

    Declaration

    Swift

    case uuid
  • Last case, add new values before it.

    Declaration

    Swift

    case namesCount