151151Base. getindex (db:: DB , ids:: AbstractArray{<:Integer} ) = getindex .(db, ids)
152152function Base. getindex (db:: DB , :: Colon )
153153 res = execute (db, " SELECT props from nodes" )
154- [ Node (i,row. props) for (i,row) in enumerate (res)]
154+ ( Node (i,row. props) for (i,row) in enumerate (res))
155155end
156156function Base. deleteat! (db:: DB , id:: Integer )
157157 execute (db, " DELETE FROM nodes WHERE id = ?" , (id,))
@@ -166,11 +166,11 @@ function find_nodes(db::DB; kw...)
166166 end , " AND " )
167167
168168 res = execute (db, " SELECT * FROM nodes WHERE $param " )
169- isempty (res) ? nothing : [ Node (row... ) for row in res]
169+ isempty (res) ? nothing : ( Node (row... ) for row in res)
170170end
171171function find_nodes (db:: DB , r:: Regex )
172172 res = execute (db, " SELECT * FROM nodes WHERE props REGEXP ?" , (r. pattern,))
173- isempty (res) ? nothing : [ Node (row... ) for row in res]
173+ isempty (res) ? nothing : ( Node (row... ) for row in res)
174174end
175175
176176
@@ -191,15 +191,15 @@ function Base.getindex(db::DB, is::AbstractArray{<:Integer}, js::AbstractArray{<
191191end
192192function Base. getindex (db:: DB , i:: Integer , :: Colon )
193193 res = execute (db, " SELECT * FROM edges WHERE source=?" , (i,))
194- isempty (res) ? nothing : [ Edge (row... ) for row in res]
194+ isempty (res) ? nothing : ( Edge (row... ) for row in res)
195195end
196196function Base. getindex (db:: DB , :: Colon , j:: Integer )
197197 res = execute (db, " SELECT * FROM edges WHERE target=?" , (j,))
198- isempty (res) ? nothing : [ Edge (row... ) for row in res]
198+ isempty (res) ? nothing : ( Edge (row... ) for row in res)
199199end
200200function Base. getindex (db:: DB , :: Colon , :: Colon )
201201 res = execute (db, " SELECT * from edges" )
202- isempty (res) ? nothing : [ Edge (row... ) for row in res]
202+ isempty (res) ? nothing : ( Edge (row... ) for row in res)
203203end
204204Base. getindex (db:: DB , is:: AbstractArray{<:Integer} , :: Colon ) = filter! (! isnothing, getindex .(db, is, :))
205205Base. getindex (db:: DB , :: Colon , js:: AbstractArray{<:Integer} ) = filter! (! isnothing, getindex .(db, :, js))
@@ -217,11 +217,11 @@ function find_edges(db::DB; kw...)
217217 end , " AND " )
218218
219219 res = execute (db, " SELECT * FROM edges WHERE $param " )
220- isempty (res) ? nothing : [ Edge (row... ) for row in res]
220+ isempty (res) ? nothing : ( Edge (row... ) for row in res)
221221end
222222function find_edges (db:: DB , r:: Regex )
223223 res = execute (db, " SELECT * FROM edges WHERE props REGEXP ?" , (r. pattern,))
224- isempty (res) ? nothing : [ Edge (row... ) for row in res]
224+ isempty (res) ? nothing : ( Edge (row... ) for row in res)
225225end
226226
227227end
0 commit comments