SQLite

Check-in [8d3cc928a8]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Additional test case demonstrating the ability to access structure elements using quoted names in the JSON1 extension.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 8d3cc928a8f0c7b2616c5c75af9d3a50bd4f0fe8e4ccab545ab8648cbfbb4b7f
User & Date: drh 2017-10-27 12:27:25.402
Context
2017-10-27
17:09
Handle the Ctrl-C event for the shell on Win32. (check-in: c8aaf37117 user: mistachkin tags: trunk)
12:27
Additional test case demonstrating the ability to access structure elements using quoted names in the JSON1 extension. (check-in: 8d3cc928a8 user: drh tags: trunk)
2017-10-26
20:04
Enhance the min/max optimization so that it works with indexes on expressions. (check-in: 6caec9082b user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/json101.test.
717
718
719
720
721
722
723








































724
725
  /* } */
} {1}
do_execsql_test json-11.3 {
  /* Too deep by one { */
  SELECT json_valid(replace(printf('%.2001c0%.2001c','[','}'),'[','{"a":'));
  /* } */
} {0}









































finish_test







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
  /* } */
} {1}
do_execsql_test json-11.3 {
  /* Too deep by one { */
  SELECT json_valid(replace(printf('%.2001c0%.2001c','[','}'),'[','{"a":'));
  /* } */
} {0}

# 2017-10-27.  Demonstrate the ability to access an element from
# a json structure even though the element name constains a "."
# character, by quoting the element name in the path.
#
do_execsql_test json-12.100 {
  CREATE TABLE t12(x);
  INSERT INTO t12(x) VALUES(
    '{"settings":
        {"layer2":
           {"hapax.legomenon":
              {"forceDisplay":true,
               "transliterate":true,
               "add.footnote":true,
               "summary.report":true},
            "dis.legomenon":
              {"forceDisplay":true,
               "transliterate":false,
               "add.footnote":false,
               "summary.report":true},
            "tris.legomenon":
              {"forceDisplay":true,
               "transliterate":false,
               "add.footnote":false,
               "summary.report":false}
           }
        }
     }');
} {}
do_execsql_test json-12.110 {
  SELECT json_remove(x, '$.settings.layer2."dis.legomenon".forceDisplay')
    FROM t12;
} {{{"settings":{"layer2":{"hapax.legomenon":{"forceDisplay":true,"transliterate":true,"add.footnote":true,"summary.report":true},"dis.legomenon":{"transliterate":false,"add.footnote":false,"summary.report":true},"tris.legomenon":{"forceDisplay":true,"transliterate":false,"add.footnote":false,"summary.report":false}}}}}}
do_execsql_test json-12.120 {
  SELECT json_extract(x, '$.settings.layer2."tris.legomenon"."summary.report"')
    FROM t12;
} {0}




finish_test