Skip to content

Commit f5e596b

Browse files
committed
wip
1 parent b9f546b commit f5e596b

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,17 @@ db[:, 2] # all incoming edges to node 2
5454
- multiple keyword args are a logical "AND"
5555

5656
```julia
57-
SQLiteGraph.findnodes(db, x=1)
57+
find_nodes(db, x=1)
5858

59-
SQLiteGraph.findedges(db, b=2)
59+
find_edges(db, b=2)
60+
```
61+
62+
- You can also query based on Regex matches of the `TEXT` properties:
63+
64+
```julia
65+
find_nodes(db, r"x")
66+
67+
find_edges(db, r"\"b\":2")
6068
```
6169

6270
## Attribution

src/SQLiteGraph.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ function single_result_execute(db, stmt, args...)
1414
isempty(ex) ? nothing : values(first(ex))[1]
1515
end
1616

17+
#-----------------------------------------------------------------------------# Node
1718
struct Node{T}
1819
id::Int
1920
props::T
@@ -24,6 +25,7 @@ function Base.show(io::IO, o::Node)
2425
print(io, o.props)
2526
end
2627

28+
#-----------------------------------------------------------------------------# Edge
2729
struct Edge{T}
2830
source::Int
2931
target::Int
@@ -49,11 +51,11 @@ as `TEXT` (see [https://www.sqlite.org/datatype3.html](https://www.sqlite.org/da
4951
5052
- `nodes`
5153
- `id INTEGER NOT NULL UNIQUE`
52-
- `props TEXT` (JSON.write)
54+
- `props TEXT` (via JSON3.write)
5355
- `edges`
5456
- `source INTEGER`
5557
- `target INTEGER`
56-
- `props TEXT` (JSON.write)
58+
- `props TEXT` (via JSON3.write)
5759
5860
# Examples
5961

0 commit comments

Comments
 (0)