Class PostgreSQLRDBMSWeekdayOfDateFunction
java.lang.Object
com.kingsrook.qqq.backend.module.postgres.fieldfunctions.PostgreSQLRDBMSWeekdayOfDateFunction
- All Implemented Interfaces:
BackendFieldFunctionAdapterInterface,RDBMSFieldFunctionAdapterInterface,Serializable
public class PostgreSQLRDBMSWeekdayOfDateFunction
extends Object
implements RDBMSFieldFunctionAdapterInterface
PostgreSQL adapter for the
WeekdayOfDateFunction
that generates EXTRACT(ISODOW FROM col) SQL expressions.
PostgreSQL's ISODOW function naturally matches QQQ's ISO-8601
weekday standard (Monday=1 … Sunday=7), so no offset is needed.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionwrapColumnName(String escapedColumnName, FieldFunction fieldFunction, Function<String, String> fieldNameToColumnReference) Returns anEXTRACT(ISODOW FROM col)expression — PostgreSQL's ISODOW directly matches ISO-8601 (Monday=1 … Sunday=7).wrapColumnNameForOrderBy(String escapedColumnName, FieldFunction fieldFunction, Function<String, String> fieldNameToColumnReference) Returns the ORDER BY expression; when sortSundayFirst is true, appends% 7so Sunday (value 7) sorts as 0 before Monday.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.kingsrook.qqq.backend.module.rdbms.fieldfunctions.RDBMSFieldFunctionAdapterInterface
getParams
-
Constructor Details
-
PostgreSQLRDBMSWeekdayOfDateFunction
public PostgreSQLRDBMSWeekdayOfDateFunction()
-
-
Method Details
-
wrapColumnName
public String wrapColumnName(String escapedColumnName, FieldFunction fieldFunction, Function<String, String> fieldNameToColumnReference) Returns anEXTRACT(ISODOW FROM col)expression — PostgreSQL's ISODOW directly matches ISO-8601 (Monday=1 … Sunday=7).- Specified by:
wrapColumnNamein interfaceRDBMSFieldFunctionAdapterInterface- Parameters:
escapedColumnName- a fully qualified and escaped SQL column name for the 'main' field that this function works with (e.g.,FieldFunction#withFieldName(String). Looks like:`my_table`.`my_field`.fieldFunction- the function with arguments, being used.fieldNameToColumnReference- resolves a QQQ field name to its fully- qualified escaped SQL column reference (e.g.,"timeZone"→`t1`.`time_zone`). Useful when the function expression needs to reference additional columns on the same row.
-
wrapColumnNameForOrderBy
public String wrapColumnNameForOrderBy(String escapedColumnName, FieldFunction fieldFunction, Function<String, String> fieldNameToColumnReference) Returns the ORDER BY expression; when sortSundayFirst is true, appends% 7so Sunday (value 7) sorts as 0 before Monday.- Specified by:
wrapColumnNameForOrderByin interfaceRDBMSFieldFunctionAdapterInterface
-