Skip to content

Commit 3095caf

Browse files
committed
* fixes per CodeRabbit suggestions
1 parent a9e9abf commit 3095caf

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

balta/src/main/scala/za/co/absa/db/balta/classes/QueryResultRow.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class QueryResultRow private[classes](val rowNumber: Int,
3939
def columnCount: Int = fields.length
4040
def columnNumber(columnName: String): Int = {
4141
val columnNameQuoteless = ColumnName(columnName).quoteLess
42-
columnNames.getOrThrow(columnNameQuoteless, new NoSuchElementException(s"Column '$columnNameQuoteless' not found"))
42+
columnNames.getOrThrow(columnNameQuoteless, new NoSuchElementException(s"Column '$columnName' not found"))
4343
}
4444

4545
/**

balta/src/main/scala/za/co/absa/db/balta/classes/inner/Params.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ object Params {
5959
* @param paramName - the name of the parameter
6060
* @return - a list parameters to be used in an SQL prepared statement
6161
*/
62-
@deprecated("Use add(paramName, NULL)", "balta 0.3.0")
62+
@deprecated("Use add(QueryParamType.NULL) or import QueryParamType.NULL", "balta 0.3.0")
6363
def addNull(paramName: String): NamedParams = {
6464
new NamedParams().add(paramName, QueryParamType.NULL)
6565
}
@@ -83,7 +83,7 @@ object Params {
8383
* @tparam T - the type of the parameter value
8484
* @return - a list parameters to be used in an SQL prepared statement
8585
*/
86-
@deprecated("Use add(NULL)", "balta 0.3.0")
86+
@deprecated("Use add(QueryParamType.NULL) or import QueryParamType.NULL", "balta 0.3.0")
8787
def addNull[T: QueryParamType](): OrderedParams = {
8888
new OrderedParams().add(QueryParamType.NULL)
8989
}

balta/src/main/scala/za/co/absa/db/mag/core/SqlEntry.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ class SqlEntry(val entry: String) extends AnyVal {
3939

4040
/** Translates a sequence of SqlEntry entries into a single SqlEntry formatted as a parameter list
4141
*
42-
* @param params - A sequence of SqlEntry to be included as parameters.
43-
* @param foo - A bogus parameter do differentiate this method from the `apply(params: String*)` method, as their
44-
* signatures would be same otherwise after type erasure.
45-
* @return A new SqlEntry that combines the input as a list of parameters/columns for a function or table.
42+
* @param params - A sequence of SqlEntry to be included as parameters.
43+
* @param disambiguator - Unused parameter to differentiate this method from `apply(params: String*)`
44+
* after JVM type erasure (both would have signature `apply(Seq)`)
45+
* @return - A new SqlEntry that combines the input as a list of parameters/columns for a function or table.
4646
*/
47-
def apply(params: Seq[SqlEntry], foo: String = ""): SqlEntry = {
47+
def apply(params: Seq[SqlEntry], disambiguator: String = ""): SqlEntry = {
4848
val paramsEntry = params.mkSqlEntry("(", ",", ")")
4949
this + paramsEntry
5050
}

balta/src/main/scala/za/co/absa/db/mag/core/SqlEntryComposition.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ object SqlEntryComposition {
109109
def BY(columns: ColumnReference*): OrderByFragment = new OrderByFragment(columnsToSqlEntry(columns))
110110

111111
implicit def QueryToSqlEntry(query: Query): SqlEntry = query.sqlEntry
112-
//TODO --- implicit def StringToSqlEntry(string: String): SqlEntry = SqlEntry(string)
113112

114113
private val select = SqlEntry("SELECT")
115114
private val insertInto = SqlEntry("INSERT INTO")

0 commit comments

Comments
 (0)