mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
Add the json_check() function, which returns its argument if the argument
is well-formed JSON or which throws an error otherwise. FossilOrigin-Name: 64abb65d4df11e5b3bcc4afc8e7c18e907c6080a
This commit is contained in:
@ -63,4 +63,11 @@ do_execsql_test json1-3.4 {
|
||||
SELECT json_type(json_set('{"a":1,"b":2}','$$.b','{"x":3,"y":4}'),'$.b');
|
||||
} {object}
|
||||
|
||||
do_execsql_test json1-4.1 {
|
||||
SELECT json_check(' [ 1, 2] ');
|
||||
} {[1,2]}
|
||||
do_catchsql_test json1-4.2 {
|
||||
SELECT json_check(' [ 1, 2 ');
|
||||
} {1 {malformed JSON}}
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user