Transform Functions

Transform functions are used to extract and/or reformat data returned by a hydrate function into the desired type/format for a column. You can call your own transform function with From, but you probably don't need to write one -- The SDK provides many that cover the most common cases. You can chain transforms together, but the transform chain must be started with a From function:

NameDescription
FromConstantReturn a constant value (specified by 'param').
FromFieldGenerate a value by retrieving a field from the source item.
FromValueGenerate a value by returning the raw hydrate item.
FromCamelGenerate a value by converting the given field name to camel case and retrieving from the source item.
FromGoGenerate a value by converting the given field name to camel case and retrieving from the source item.
FromGenerate a value by calling a 'transformFunc'.
FromJSONTagGenerate a value by finding a struct property with the json tag matching the column name.
FromTagGenerate a value by finding a struct property with the tag 'tagName' matching the column name.
FromPGenerate a value by calling 'transformFunc' passing param.

Additional functions can be chained after a From function to transform the data:

NameDescription
TransformApply an arbitrary transform to the data (specified by 'transformFunc').
TransformPApply an arbitrary transform to the data, passing a parameter.
NullIfEqualIf the input value equals the transform param, return nil.
NullIfZeroIf the input value equals the zero value of its type, return nil.