Skip to content

Commit

Permalink
Improve code consistency in FilterBuilder and query module
Browse files Browse the repository at this point in the history
Reformatted hash declaration in FilterBuilder to improve readability
and fixed inconsistent spacing in build_aggr_expression method for
better code alignment and legibility.

No functional changes introduced.
  • Loading branch information
eliasjpr committed Sep 20, 2024
1 parent 91ce693 commit 5abc757
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/expression/filter_builder.cr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Expression
class FilterBuilder
@tables : Hash(Symbol,Table) = {} of Symbol => Table
@tables : Hash(Symbol, Table) = {} of Symbol => Table

def initialize(sql_tables : Hash(Symbol, Cql::Table))
sql_tables.each do |name, table|
Expand Down
10 changes: 5 additions & 5 deletions src/query.cr
Original file line number Diff line number Diff line change
Expand Up @@ -698,11 +698,11 @@ module Cql
private def build_aggr_expression(aggr : Symbol, column : Symbol)
col = Expression::Column.new(find_column(column))
case aggr
when :count then Expression::Count.new(col)
when :sum then Expression::Sum.new(col)
when :avg then Expression::Avg.new(col)
when :min then Expression::Min.new(col)
when :max then Expression::Max.new(col)
when :count then Expression::Count.new(col)
when :sum then Expression::Sum.new(col)
when :avg then Expression::Avg.new(col)
when :min then Expression::Min.new(col)
when :max then Expression::Max.new(col)
else
raise "Invalid aggregate function #{aggr}"
end
Expand Down

0 comments on commit 5abc757

Please sign in to comment.