schema-mapper-serializer
Base serializer class for storage drivers.
usage
To serialize one of the ColumnTypes, Override / implement the method name which is translated the following way: the method name starts with "serialize", then the type follows (first letter is capitalized) and [] is replaced with "Array". Some examples:
string becomes: serializeString(item, column)
string[] becomes: serializeStringArray(item, column)
point[] becomes: serializePointArray(item, column)
The PostgreSQL serializer implementation:
var knex = dialect: 'postgres';var st = knex; ; /** * Serialize a point. * * @protected * @param */ { return this; } /** * Serialize a point array. * * @protected * @param */ { return this; } /** * Serialize a linestring. * * @protected * @param */ { return this; } /** * Serialize a linestring array. * * @protected * @param */ { return this; } /** * Serialize a polygon. * * @protected * @param */ { return this; } /** * Serialize a polygon array. * * @protected * @param */ { return this; } /** * Serialize to geojson. * * @protected * @param */ { if ! valuecrs valuecrs = type: 'name' properties: name: 'EPSG:' + columnsrid || 4326 ; return st; }