File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,6 +48,25 @@ function capitalizeAfterLastDot(input: string): string {
4848 return beforeLastDot + afterLastDot . charAt ( 0 ) . toUpperCase ( ) + afterLastDot . slice ( 1 ) + 'Service' ;
4949}
5050
51+ /**
52+ * Converts a template string with placeholders into a SQL-style
53+ * concatenation expression.
54+ *
55+ * @param template - A template string containing `${variable}` placeholders
56+ * and literal text (e.g. `"${ssn}-${age}"`).
57+ * @returns A SQL concatenation string where placeholders are converted to
58+ * column names, literals are wrapped in single quotes, parts are joined
59+ * with `||`, and the expression is aliased as `businessKey`
60+ * (e.g. `"ssn || '-' || age as businessKey"`).
61+ *
62+ * @example
63+ * convertTemplate("${ssn}-${age}")
64+ * // → "ssn || '-' || age as businessKey"
65+ *
66+ * @example
67+ * convertTemplate("${firstName} ${lastName}")
68+ * // → "firstName || ' ' || lastName as businessKey"
69+ */
5170function convertBusinessKeyToExpr ( template : string ) : string {
5271 const parts = template . split ( TEMPLATE_PART_SPLITTER ) ;
5372
You can’t perform that action at this time.
0 commit comments