Skip to content

Commit c11399b

Browse files
committed
✨ Add the ability to pass the json path as a second arg
Before, to specify a json path, you had to pass the arg jsonpath='$.whatever' Now, you can just write read_json('file', '$.whatever')
1 parent 929ea75 commit c11399b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

module/read_json.go

+3
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ func (m *JSONModule) Connect(c *sqlite3.SQLiteConn, args []string) (sqlite3.VTab
7272

7373
filepath := strings.Trim(args[3], "' \"")
7474
jsonPath := ""
75+
if len(args) > 4 {
76+
jsonPath = strings.Trim(args[4], "' \"")
77+
}
7578

7679
// Parse the args
7780
argsAvailable := []argParam{

0 commit comments

Comments
 (0)