Skip to content

Commit 4645117

Browse files
authored
Merge pull request #25 from queryverse/create-pull-request/patch
[AUTO] Format files using DocumentFormat
2 parents 8242da9 + a8757f1 commit 4645117

6 files changed

Lines changed: 108 additions & 111 deletions

File tree

coverage/submit.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
submit(
1010
filter(
1111
let prefix = joinpath(pwd(), "src", "")
12-
coverage -> startswith(coverage.filename, prefix)
13-
end,
12+
coverage->startswith(coverage.filename, prefix)
13+
end,
1414
readfolder(".")
1515
)
1616
)

src/iterate.jl

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
function generate_namedtuple(::Type{NamedTuple{names, types}}, q) where {names, types}
1+
function generate_namedtuple(::Type{NamedTuple{names,types}}, q) where {names,types}
22
if @generated
33
vals = Tuple(:(getvalue(q, $i, $(fieldtype(types, i)))) for i = 1:fieldcount(types))
4-
return :(NamedTuple{names, types}(($(vals...),)))
4+
return :(NamedTuple{names,types}(($(vals...),)))
55
else
6-
return NamedTuple{names, types}(Tuple(getvalue(q, i, fieldtype(types, i)) for i = 1:fieldcount(types)))
6+
return NamedTuple{names,types}(Tuple(getvalue(q, i, fieldtype(types, i)) for i = 1:fieldcount(types)))
77
end
88
end
99

@@ -44,14 +44,14 @@ function getvalue(cursor::SQLiteCursor, column_number::Int, ::Type{Value}) where
4444
julia_type = juliatype(column_type) # native SQLite Int, Float, and Text types
4545
sqlitevalue(
4646
if julia_type === Any
47-
if !isbitstype(Value)
48-
Value
49-
else
50-
julia_type
51-
end
47+
if !isbitstype(Value)
48+
Value
5249
else
5350
julia_type
54-
end, handle, column_number)
51+
end
52+
else
53+
julia_type
54+
end, handle, column_number)
5555
end
5656
end
5757

@@ -118,14 +118,11 @@ function getiterator(source_code::SourceCode)
118118
handle = statement.handle
119119
schema = ntuple(
120120
let handle = handle
121-
column_number -> name_and_type(handle, column_number)
122-
end,
121+
column_number->name_and_type(handle, column_number)
122+
end,
123123
sqlite3_column_count(handle)
124124
)
125-
SQLiteCursor{NamedTuple{
126-
Tuple(map(first, schema)),
127-
Tuple{map(second, schema)...}
128-
}}(statement, Ref(status), Ref(0))
125+
SQLiteCursor{NamedTuple{Tuple(map(first, schema)),Tuple{map(second, schema)...}}}(statement, Ref(status), Ref(0))
129126
end
130127

131128
# Use default show methods from the queryverse

src/model_row.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ function model_row_call(::typeof(getproperty), source_tables::Database, table_na
2828
source_row = SourceRow(source, table_name)
2929
NamedTuple{column_names}(
3030
map(column_names) do column_name
31-
get_column(source_row, column_name)
32-
end
31+
get_column(source_row, column_name)
32+
end
3333
)
3434
end
3535

@@ -39,7 +39,7 @@ function model_row_call(::typeof(QueryOperators.map), iterator, call, call_expre
3939
end
4040

4141
# Grouped rows have their own dedicated model type
42-
struct GroupRow{Group, Row}
42+
struct GroupRow{Group,Row}
4343
group::Group
4444
row::Row
4545
end

src/translate.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function nest(sql_expression)
1010
SQLExpression(:AS, SQLExpression(:FROM, sql_expression), :__TABLE__)
1111
end
1212

13-
function translate(something::Union{Char, AbstractString}; _primary = true)
13+
function translate(something::Union{Char,AbstractString}; _primary = true)
1414
repr(something)
1515
end
1616

@@ -29,11 +29,11 @@ end
2929
function translate_default(location, function_type, SQL_call)
3030
result = :(
3131
function translate_call($function_type, arguments...; _primary = true)
32-
$SQLExpression($SQL_call, $map(
33-
argument -> $translate(argument; _primary = _primary),
32+
$SQLExpression($SQL_call, $map(
33+
argument->$translate(argument; _primary = _primary),
3434
arguments
3535
)...)
36-
end
36+
end
3737
)
3838
result.args[2].args[1] = location
3939
result
@@ -161,7 +161,7 @@ function translate_call(::typeof(QueryOperators.join), source1, source2, key1, k
161161
),
162162
# mark both as not _primary to always be explicit about table
163163
Generator(
164-
pair -> as(pair; _primary = false),
164+
pair->as(pair; _primary = false),
165165
pairs(combine(model_row_1, model_row_2))
166166
)...
167167
)
@@ -179,7 +179,7 @@ function translate_call(::typeof(QueryOperators.map), select_table, call, call_e
179179
SQLExpression(
180180
:SELECT, inner,
181181
Generator(
182-
pair -> as(pair; _primary = _primary),
182+
pair->as(pair; _primary = _primary),
183183
pairs(call(model_row(select_table)))
184184
)...
185185
)

src/utilities.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ end
44

55
split_keyword(keyword::Expr) =
66
if keyword.head === :kw
7-
Pair(keyword.args[1], keyword.args[2])
8-
else
9-
error("Cannot split keyword $keyword")
10-
end
7+
Pair(keyword.args[1], keyword.args[2])
8+
else
9+
error("Cannot split keyword $keyword")
10+
end
1111

1212
# Split a function call into its pieces
1313
# Normalize non-function-like patterns into function calls

0 commit comments

Comments
 (0)