{"html_url": "https://github.com/dogsheep/healthkit-to-sqlite/issues/1#issuecomment-513437463", "issue_url": "https://api.github.com/repos/dogsheep/healthkit-to-sqlite/issues/1", "id": 513437463, "node_id": "MDEyOklzc3VlQ29tbWVudDUxMzQzNzQ2Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-07-20T05:19:59Z", "updated_at": "2019-07-20T05:19:59Z", "author_association": "MEMBER", "body": "I ran xml_analyser against the XML HealthKit `export.xml` file and got the following results:\r\n\r\n```python\r\n{\r\n 'ActivitySummary': {'attr_counts': {'activeEnergyBurned': 980,\r\n 'activeEnergyBurnedGoal': 980,\r\n 'activeEnergyBurnedUnit': 980,\r\n 'appleExerciseTime': 980,\r\n 'appleExerciseTimeGoal': 980,\r\n 'appleStandHours': 980,\r\n 'appleStandHoursGoal': 980,\r\n 'dateComponents': 980},\r\n 'child_counts': {},\r\n 'count': 980,\r\n 'parent_counts': {'HealthData': 980}},\r\n 'Correlation': {'attr_counts': {'creationDate': 1,\r\n 'endDate': 1,\r\n 'sourceName': 1,\r\n 'sourceVersion': 1,\r\n 'startDate': 1,\r\n 'type': 1},\r\n 'child_counts': {'MetadataEntry': 1, 'Record': 2},\r\n 'count': 1,\r\n 'parent_counts': {'HealthData': 1}},\r\n 'ExportDate': {'attr_counts': {'value': 1},\r\n 'child_counts': {},\r\n 'count': 1,\r\n 'parent_counts': {'HealthData': 1}},\r\n 'HealthData': {'attr_counts': {'locale': 1},\r\n 'child_counts': {'ActivitySummary': 980,\r\n 'Correlation': 1,\r\n 'ExportDate': 1,\r\n 'Me': 1,\r\n 'Record': 2672231,\r\n 'Workout': 663},\r\n 'count': 1,\r\n 'parent_counts': {}},\r\n 'HeartRateVariabilityMetadataList': {'attr_counts': {},\r\n 'child_counts': {'InstantaneousBeatsPerMinute': 93653},\r\n 'count': 2318,\r\n 'parent_counts': {'Record': 2318}},\r\n 'InstantaneousBeatsPerMinute': {'attr_counts': {'bpm': 93653, 'time': 93653},\r\n 'child_counts': {},\r\n 'count': 93653,\r\n 'parent_counts': {'HeartRateVariabilityMetadataList': 93653}},\r\n 'Location': {'attr_counts': {'altitude': 398683,\r\n 'course': 398683,\r\n 'date': 398683,\r\n 'horizontalAccuracy': 398683,\r\n 'latitude': 398683,\r\n 'longitude': 398683,\r\n 'speed': 398683,\r\n 'verticalAccuracy': 398683},\r\n 'child_counts': {},\r\n 'count': 398683,\r\n 'parent_counts': {'WorkoutRoute': 398683}},\r\n 'Me': {'attr_counts': {'HKCharacteristicTypeIdentifierBiologicalSex': 1,\r\n 'HKCharacteristicTypeIdentifierBloodType': 1,\r\n 'HKCharacteristicTypeIdentifierDateOfBirth': 1,\r\n 'HKCharacteristicTypeIdentifierFitzpatrickSkinType': 1},\r\n 'child_counts': {},\r\n 'count': 1,\r\n 'parent_counts': {'HealthData': 1}},\r\n 'MetadataEntry': {'attr_counts': {'key': 290449, 'value': 290449},\r\n 'child_counts': {},\r\n 'count': 290449,\r\n 'parent_counts': {'Correlation': 1,\r\n 'Record': 287974,\r\n 'Workout': 1928,\r\n 'WorkoutRoute': 546}},\r\n 'Record': {'attr_counts': {'creationDate': 2672233,\r\n 'device': 2665111,\r\n 'endDate': 2672233,\r\n 'sourceName': 2672233,\r\n 'sourceVersion': 2671779,\r\n 'startDate': 2672233,\r\n 'type': 2672233,\r\n 'unit': 2650012,\r\n 'value': 2672232},\r\n 'child_counts': {'HeartRateVariabilityMetadataList': 2318,\r\n 'MetadataEntry': 287974},\r\n 'count': 2672233,\r\n 'parent_counts': {'Correlation': 2, 'HealthData': 2672231}},\r\n 'Workout': {'attr_counts': {'creationDate': 663,\r\n 'device': 230,\r\n 'duration': 663,\r\n 'durationUnit': 663,\r\n 'endDate': 663,\r\n 'sourceName': 663,\r\n 'sourceVersion': 663,\r\n 'startDate': 663,\r\n 'totalDistance': 663,\r\n 'totalDistanceUnit': 663,\r\n 'totalEnergyBurned': 663,\r\n 'totalEnergyBurnedUnit': 663,\r\n 'workoutActivityType': 663},\r\n 'child_counts': {'MetadataEntry': 1928,\r\n 'WorkoutEvent': 2094,\r\n 'WorkoutRoute': 340},\r\n 'count': 663,\r\n 'parent_counts': {'HealthData': 663}},\r\n 'WorkoutEvent': {'attr_counts': {'date': 2094,\r\n 'duration': 837,\r\n 'durationUnit': 837,\r\n 'type': 2094},\r\n 'child_counts': {},\r\n 'count': 2094,\r\n 'parent_counts': {'Workout': 2094}},\r\n 'WorkoutRoute': {'attr_counts': {'creationDate': 340,\r\n 'endDate': 340,\r\n 'sourceName': 340,\r\n 'sourceVersion': 340,\r\n 'startDate': 340},\r\n 'child_counts': {'Location': 398683, 'MetadataEntry': 546},\r\n 'count': 340,\r\n 'parent_counts': {'Workout': 340}}}\r\n```\r\n\r\nThe most interesting bit is this:\r\n\r\n```python\r\n 'HealthData': {'attr_counts': {'locale': 1},\r\n 'child_counts': {'ActivitySummary': 980,\r\n 'Correlation': 1,\r\n 'ExportDate': 1,\r\n 'Me': 1,\r\n 'Record': 2672231,\r\n 'Workout': 663},\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 470637068, "label": "Use XML Analyser to figure out the structure of the export XML"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/healthkit-to-sqlite/issues/2#issuecomment-513439411", "issue_url": "https://api.github.com/repos/dogsheep/healthkit-to-sqlite/issues/2", "id": 513439411, "node_id": "MDEyOklzc3VlQ29tbWVudDUxMzQzOTQxMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-07-20T05:58:57Z", "updated_at": "2019-07-20T05:58:57Z", "author_association": "MEMBER", "body": "```python\r\n 'Workout': {'attr_counts': {'creationDate': 663,\r\n 'device': 230,\r\n 'duration': 663,\r\n 'durationUnit': 663,\r\n 'endDate': 663,\r\n 'sourceName': 663,\r\n 'sourceVersion': 663,\r\n 'startDate': 663,\r\n 'totalDistance': 663,\r\n 'totalDistanceUnit': 663,\r\n 'totalEnergyBurned': 663,\r\n 'totalEnergyBurnedUnit': 663,\r\n 'workoutActivityType': 663},\r\n 'child_counts': {'MetadataEntry': 1928,\r\n 'WorkoutEvent': 2094,\r\n 'WorkoutRoute': 340},\r\n 'count': 663,\r\n 'parent_counts': {'HealthData': 663}},\r\n 'WorkoutEvent': {'attr_counts': {'date': 2094,\r\n 'duration': 837,\r\n 'durationUnit': 837,\r\n 'type': 2094},\r\n 'child_counts': {},\r\n 'count': 2094,\r\n 'parent_counts': {'Workout': 2094}},\r\n 'WorkoutRoute': {'attr_counts': {'creationDate': 340,\r\n 'endDate': 340,\r\n 'sourceName': 340,\r\n 'sourceVersion': 340,\r\n 'startDate': 340},\r\n 'child_counts': {'Location': 398683, 'MetadataEntry': 546},\r\n 'count': 340,\r\n 'parent_counts': {'Workout': 340}}}\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 470637152, "label": "Import workouts"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/537#issuecomment-513439736", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/537", "id": 513439736, "node_id": "MDEyOklzc3VlQ29tbWVudDUxMzQzOTczNg==", "user": {"value": 14834132, "label": "SteadBytes"}, "created_at": "2019-07-20T06:05:01Z", "updated_at": "2019-07-20T06:05:01Z", "author_association": "NONE", "body": "The asgi spec doesn't explicitly specify (at least as far as I can tell) whether the scope is immutable/mutable https://asgi.readthedocs.io/en/latest/specs/lifespan.html#scope . @simonw using a header for this would be a nice approach. It would also potentially increase the portability of any middleware/plugins/clients across different applications/frameworks as it's not tied directly to an asgi implementation", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 463544206, "label": "Populate \"endpoint\" key in ASGI scope"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/healthkit-to-sqlite/issues/4#issuecomment-513440090", "issue_url": "https://api.github.com/repos/dogsheep/healthkit-to-sqlite/issues/4", "id": 513440090, "node_id": "MDEyOklzc3VlQ29tbWVudDUxMzQ0MDA5MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-07-20T06:11:50Z", "updated_at": "2019-07-20T06:11:50Z", "author_association": "MEMBER", "body": "Some examples:\r\n\r\nhttps://github.com/dogsheep/healthkit-to-sqlite/blob/d016e70c31cf84ba0f5ec3102546db54a51aaffb/tests/export.xml#L4-L13", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 470640505, "label": "Import Records"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/537#issuecomment-513442743", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/537", "id": 513442743, "node_id": "MDEyOklzc3VlQ29tbWVudDUxMzQ0Mjc0Mw==", "user": {"value": 647359, "label": "tomchristie"}, "created_at": "2019-07-20T06:50:47Z", "updated_at": "2019-07-20T06:50:47Z", "author_association": "NONE", "body": "Right now the spec does say \u201ccopy the scope, rather than mutate it\u201d https://asgi.readthedocs.io/en/latest/specs/main.html#middleware \r\n\r\nI wouldn\u2019t be surprised if that there\u2019s room for discussion on evolving the exact language there.\r\n\r\nThere\u2019s obvs a nice element to the strictness there, tho practically I\u2019m not sure it\u2019s something that implementations will follow, and its not something that Starlette chooses to abide by.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 463544206, "label": "Populate \"endpoint\" key in ASGI scope"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/537#issuecomment-513446227", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/537", "id": 513446227, "node_id": "MDEyOklzc3VlQ29tbWVudDUxMzQ0NjIyNw==", "user": {"value": 14834132, "label": "SteadBytes"}, "created_at": "2019-07-20T07:50:44Z", "updated_at": "2019-07-20T07:50:44Z", "author_association": "NONE", "body": "Oh yes well spotted thank you \ud83d\ude01 \r\n\r\nI agree that the strictness would be nice as it could help to avoid different middleware altering the scope in incompatible ways. However I do also agree that it's likely for not all implementations to follow \ud83e\udd14", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 463544206, "label": "Populate \"endpoint\" key in ASGI scope"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/43#issuecomment-513481493", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/43", "id": 513481493, "node_id": "MDEyOklzc3VlQ29tbWVudDUxMzQ4MTQ5Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-07-20T16:34:54Z", "updated_at": "2019-07-20T16:34:54Z", "author_association": "OWNER", "body": "Here's the implementation in `create_table()`:\r\n\r\nhttps://github.com/simonw/sqlite-utils/blob/c88f0a4d4617ff832aa728aac1da3500548c3137/sqlite_utils/db.py#L235-L249\r\n\r\nAnd here's where `add_column()` does its thing:\r\n\r\nhttps://github.com/simonw/sqlite-utils/blob/c88f0a4d4617ff832aa728aac1da3500548c3137/sqlite_utils/db.py#L547-L552", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 470691999, "label": ".add_column() doesn't match indentation of initial creation"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/43#issuecomment-513481607", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/43", "id": 513481607, "node_id": "MDEyOklzc3VlQ29tbWVudDUxMzQ4MTYwNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-07-20T16:36:34Z", "updated_at": "2019-07-20T16:36:34Z", "author_association": "OWNER", "body": "Hmm... is it even possible to fix this within sqlite-utils? Maybe this is a SQLite implementation detail.\r\n\r\nIt's possible to update the schema itself - that's how we add missing foreign key constraints - but it seems a little bit of overkill to use the writable schema when adding a new column JUST to get prettier indentation:\r\n\r\nhttps://github.com/simonw/sqlite-utils/blob/c88f0a4d4617ff832aa728aac1da3500548c3137/sqlite_utils/db.py#L316-L326", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 470691999, "label": ".add_column() doesn't match indentation of initial creation"}, "performed_via_github_app": null}