Fossil

Check-in [57e75eb7]
Login

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

Overview
Comment:Fixed a C99-ism, removed a couple ancient #if blocks. Re-added uuid to /json/timeline/event output (because it's useful in ways which the event name is not).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | ben-json-timeline
Files: files | file ages | folders
SHA3-256: 57e75eb7f034ee787bfe46dca3d4c1ec7696e702bcc8c0c91eeac6930a3a46c6
User & Date: stephan 2018-06-20 18:15:36
Context
2018-08-03
21:06
Merged in ben-json-timeline (adds /json/timeline/event). check-in: 74c908e7 user: stephan tags: trunk
2018-06-20
18:15
Fixed a C99-ism, removed a couple ancient #if blocks. Re-added uuid to /json/timeline/event output (because it's useful in ways which the event name is not). Closed-Leaf check-in: 57e75eb7 user: stephan tags: ben-json-timeline
10:29
Fix SQL to find name for /json/timeline/event check-in: 2488996f user: ben tags: ben-json-timeline
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/json_timeline.c.

550
551
552
553
554
555
556
557


558

559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
#if 0
  /* only for testing! */
  cson_object_set(pay, "timelineSql", cson_value_new_string(blob_buffer(&sql),strlen(blob_buffer(&sql))));
#endif
  db_multi_exec("%s", blob_buffer(&sql) /*safe-for-%s*/);
  blob_reset(&sql);
  db_prepare(&q, "SELECT"
             // uuid is not useful for events


             " substr((SELECT tagname FROM tag AS tn WHERE tn.tagid=json_timeline.tagId AND tagname LIKE 'event-%%'),7) AS name,"

             " mtime AS timestamp,"
#if 0
             " timestampString AS timestampString,"
#endif
             " comment AS comment, "
             " user AS user,"
             " eventType AS eventType"
#if 0
             /* TODO implement tags for events */
             " tags AS tags," /*FIXME: split this into
                                a JSON array*/
             " tagId AS tagId,"
#endif
             " FROM json_timeline"
             " ORDER BY rowid");
  list = cson_new_array();
  json_stmt_to_array_of_obj(&q, list);
  cson_object_set(pay, "timeline", cson_array_value(list));
  goto ok;
  error:







|
>
>

>

<
<
<



<
<
<
<
<
<







550
551
552
553
554
555
556
557
558
559
560
561
562



563
564
565






566
567
568
569
570
571
572
#if 0
  /* only for testing! */
  cson_object_set(pay, "timelineSql", cson_value_new_string(blob_buffer(&sql),strlen(blob_buffer(&sql))));
#endif
  db_multi_exec("%s", blob_buffer(&sql) /*safe-for-%s*/);
  blob_reset(&sql);
  db_prepare(&q, "SELECT"
             /* For events, the name is generally more useful than
                the uuid, but the uuid is unambiguous and can be used
                with commands like 'artifact'. */
             " substr((SELECT tagname FROM tag AS tn WHERE tn.tagid=json_timeline.tagId AND tagname LIKE 'event-%%'),7) AS name,"
             " uuid as uuid,"
             " mtime AS timestamp,"



             " comment AS comment, "
             " user AS user,"
             " eventType AS eventType"






             " FROM json_timeline"
             " ORDER BY rowid");
  list = cson_new_array();
  json_stmt_to_array_of_obj(&q, list);
  cson_object_set(pay, "timeline", cson_array_value(list));
  goto ok;
  error: