{"html_url": "https://github.com/simonw/sqlite-utils/issues/76#issuecomment-614354219", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/76", "id": 614354219, "node_id": "MDEyOklzc3VlQ29tbWVudDYxNDM1NDIxOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-16T01:01:34Z", "updated_at": "2020-04-16T01:01:34Z", "author_association": "OWNER", "body": "I think a neat way to do this would be with an optional argument for `.rows_where()`:\r\n\r\n```python\r\nrows = db[\"table\"].rows_where(\"age > 10\", order_by=\"age desc\")\r\n```\r\n\r\nIf you want everything you can use this:\r\n\r\n```python\r\nrows = db[\"table\"].rows_where(order_by=\"age desc\")\r\n```\r\n\r\nIt's a tiny bit weird calling `.rows_where()` without a where clause, but I think it makes sense here - especially since `.rows` is a property that can't take any arguments - though under the hood it actually does this:\r\n\r\nhttps://github.com/simonw/sqlite-utils/blob/ad6ac19470a67867b96cb4c086450b8e4e46bf02/sqlite_utils/db.py#L436-L443", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 549287310, "label": "order_by mechanism"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/76#issuecomment-614400454", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/76", "id": 614400454, "node_id": "MDEyOklzc3VlQ29tbWVudDYxNDQwMDQ1NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-16T03:51:01Z", "updated_at": "2020-04-16T03:51:01Z", "author_association": "OWNER", "body": "Released in 2.6", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 549287310, "label": "order_by mechanism"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/76#issuecomment-614400533", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/76", "id": 614400533, "node_id": "MDEyOklzc3VlQ29tbWVudDYxNDQwMDUzMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-16T03:51:26Z", "updated_at": "2020-04-16T03:51:26Z", "author_association": "OWNER", "body": "Documentation here: https://sqlite-utils.readthedocs.io/en/stable/python-api.html#listing-rows", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 549287310, "label": "order_by mechanism"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/76#issuecomment-614440032", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/76", "id": 614440032, "node_id": "MDEyOklzc3VlQ29tbWVudDYxNDQ0MDAzMg==", "user": {"value": 10501166, "label": "metab0t"}, "created_at": "2020-04-16T06:23:29Z", "updated_at": "2020-04-16T06:23:29Z", "author_association": "NONE", "body": "Thanks for your hard work!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 549287310, "label": "order_by mechanism"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/github-to-sqlite/issues/25#issuecomment-614810417", "issue_url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/25", "id": 614810417, "node_id": "MDEyOklzc3VlQ29tbWVudDYxNDgxMDQxNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-16T18:07:11Z", "updated_at": "2020-04-16T18:07:11Z", "author_association": "MEMBER", "body": "Turns out the main problem was #26 - now fixed.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 601265023, "label": "Improvements to demo instance"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/github-to-sqlite/issues/26#issuecomment-614794739", "issue_url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/26", "id": 614794739, "node_id": "MDEyOklzc3VlQ29tbWVudDYxNDc5NDczOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-16T17:38:28Z", "updated_at": "2020-04-16T17:38:28Z", "author_association": "MEMBER", "body": "I'm already doing this here: https://github.com/dogsheep/github-to-sqlite/blob/c4aaa50e167cfa9021c7c94260bc3e89e10947bf/github_to_sqlite/utils.py#L246-L250", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 601271612, "label": "Topics are missing from repositories"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/github-to-sqlite/issues/26#issuecomment-614795712", "issue_url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/26", "id": 614795712, "node_id": "MDEyOklzc3VlQ29tbWVudDYxNDc5NTcxMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-16T17:40:27Z", "updated_at": "2020-04-16T17:40:27Z", "author_association": "MEMBER", "body": "Aha! it was missing from the `fetch_repo()` function.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 601271612, "label": "Topics are missing from repositories"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/github-to-sqlite/issues/27#issuecomment-614831451", "issue_url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/27", "id": 614831451, "node_id": "MDEyOklzc3VlQ29tbWVudDYxNDgzMTQ1MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-16T18:47:25Z", "updated_at": "2020-04-16T18:47:25Z", "author_association": "MEMBER", "body": "Is it possible for a repo to have an `owner` that differs from its `organization`?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 601330277, "label": "Repos have a big blob of JSON in the organization column"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/github-to-sqlite/issues/27#issuecomment-614831842", "issue_url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/27", "id": 614831842, "node_id": "MDEyOklzc3VlQ29tbWVudDYxNDgzMTg0Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-16T18:48:18Z", "updated_at": "2020-04-16T18:48:18Z", "author_association": "MEMBER", "body": "I'm going to make `organization` another foreign key to the `users` table just in case it IS possible (maybe with GitHub Enterprise or similar?)", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 601330277, "label": "Repos have a big blob of JSON in the organization column"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/github-to-sqlite/issues/27#issuecomment-614843406", "issue_url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/27", "id": 614843406, "node_id": "MDEyOklzc3VlQ29tbWVudDYxNDg0MzQwNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-16T19:11:53Z", "updated_at": "2020-04-16T19:20:23Z", "author_association": "MEMBER", "body": "This didn't quite work: the column type is incorrect, so the foreign key relationship isn't sticking:\r\n\r\nhttps://github-to-sqlite.dogsheep.net/github/repos?organization=53015001\r\n\r\n`[organization] TEXT REFERENCES [users]([id])` - should be `INTEGER`.\r\n\r\nThe problem is that if the first repo inserted has no organization it's set to `null`, which `sqlite-utils` derives as a `TEXT` column.\r\n\r\nOne solution would be to create the column explicitly with a type, but this could get messy.\r\n\r\nI think I want a new sqlite-utils feature for this instead.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 601330277, "label": "Repos have a big blob of JSON in the organization column"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/100#issuecomment-614845657", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/100", "id": 614845657, "node_id": "MDEyOklzc3VlQ29tbWVudDYxNDg0NTY1Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-16T19:17:05Z", "updated_at": "2020-04-16T19:17:05Z", "author_association": "OWNER", "body": "The syntax for explicitly creating a table looks like this:\r\n```python\r\ndb[\"cats\"].create({\r\n \"id\": int,\r\n \"name\": str,\r\n \"weight\": float,\r\n}, pk=\"id\")\r\n```\r\nSo using a dictionary of column name -> Python type here would be good.\r\n\r\nI think it becomes a new optional argument to `.insert_all()` and `.insert()` and `.upsert_all()` and `.upsert()`. Question is, what should that argument be called?\r\n\r\nOptions:\r\n\r\n- `columns`\r\n- `types`\r\n- `type_overrides`\r\n- `extra_columns`\r\n\r\nI like the first two best. I'm leaning towards `columns` - it would serve two purposes: you can use it to ensure extra columns are created, and you can use it to specify the type on extra OR deteced columns.\r\n\r\nMaybe something like this:\r\n\r\n```python\r\ndb[\"authors\"].insert_all(\r\n [{\"id\": 1, \"name\": \"Sally\", \"score\": \"2\"}],\r\n pk=\"id\",\r\n not_null={\"name\", \"score\"},\r\n defaults={\"score\": 1},\r\n columns={\"score\": int, \"weight\": float}\r\n)\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 601358649, "label": "Mechanism for forcing column-type, over-riding auto-detection"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/100#issuecomment-614846059", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/100", "id": 614846059, "node_id": "MDEyOklzc3VlQ29tbWVudDYxNDg0NjA1OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-16T19:17:56Z", "updated_at": "2020-04-16T19:17:56Z", "author_association": "OWNER", "body": "Reminder: the current list of arguments for those methods is:\r\nhttps://github.com/simonw/sqlite-utils/blob/13528faa817d79bc3900d3af7473300686b145d7/sqlite_utils/db.py#L951-L967", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 601358649, "label": "Mechanism for forcing column-type, over-riding auto-detection"}, "performed_via_github_app": null}