ColumnCreator

public protocol ColumnCreator

A protocol defining functions database plugins must implement to build a string representation of a Column

  • Build a string representation of the column

    Declaration

    Swift

    func buildColumn(for column: Column, using queryBuilder: QueryBuilder) -> String?

    Parameters

    column

    The column being built

    Return Value

    A string representation of the column for the implementing database or nil if it cannot be built

  • packType(_:queryBuilder:) Default implementation

    Build an appropriate representation of a passed value for the database A default implementation is provided that can be overriden should a plugin require non-common behaviour

    Default Implementation

    Declaration

    Swift

    func packType(_ item: Any, queryBuilder: QueryBuilder) throws -> String

    Parameters

    item

    The value to convert

    Return Value

    A string representing the value that can be passed into the database

  • getDefaultValue(for:queryBuilder:) Default implementation

    Get the default value for a column

    Default Implementation

    Declaration

    Swift

    func getDefaultValue(for column: Column, queryBuilder: QueryBuilder) throws -> String?

    Parameters

    for

    The Column to get the default value for

    queryBuilder

    The plugin specific queryBuilder

    Return Value

    A string representing the default value for the column or nil if no default value is set