{"html_url": "https://github.com/simonw/sqlite-utils/issues/42#issuecomment-513262013", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/42", "id": 513262013, "node_id": "MDEyOklzc3VlQ29tbWVudDUxMzI2MjAxMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-07-19T14:58:23Z", "updated_at": "2020-09-22T18:12:11Z", "author_association": "OWNER", "body": "CLI design idea:\r\n\r\n $ sqlite-utils extract my.db \\\r\n dea_sales company_name\r\n\r\nHere we just specify the original table and column - the new extracted table will automatically be called \"company_name\" and will have \"id\" and \"value\" columns, by default.\r\n\r\nTo set a custom extract table:\r\n\r\n $ sqlite-utils extract my.db \\\r\n dea_sales company_name \\\r\n --table companies\r\n\r\nAnd for extracting multiple columns and renaming them on the created table, maybe something like this:\r\n\r\n $ sqlite-utils extract my.db \\\r\n dea_sales company_name company_address \\\r\n --table companies \\\r\n --column company_name name \\\r\n --column company_address address\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 470345929, "label": "table.extract(...) method and \"sqlite-utils extract\" command"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/943#issuecomment-693009048", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/943", "id": 693009048, "node_id": "MDEyOklzc3VlQ29tbWVudDY5MzAwOTA0OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-09-15T22:17:30Z", "updated_at": "2020-09-22T14:37:00Z", "author_association": "OWNER", "body": "Maybe instead of implementing `datasette.get()` and `datasette.post()` and `datasette.request()` and `datasette.stream()` I could instead have a nested object called `datasette.client` which is a preconfigured `AsyncClient` instance.\r\n\r\n```python\r\nresponse = await datasette.client.get(\"/\")\r\n```\r\nOr perhaps this should be a method in case I ever need to be able to `await` it:\r\n```python\r\nresponse = await (await datasette.client()).get(\"/\")\r\n```\r\nThis is a bit cosmetically ugly though, I'd rather avoid that if possible.\r\n\r\nMaybe I could get this working by returning an object from `.client()` which provides a `await obj.get()` method:\r\n```python\r\nresponse = await datasette.client().get(\"/\")\r\n```\r\nI don't think there's any benefit to that over `await datasette.client.get()` though.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 681375466, "label": "await datasette.client.get(path) mechanism for executing internal requests"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/pull/161#issuecomment-696442621", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/161", "id": 696442621, "node_id": "MDEyOklzc3VlQ29tbWVudDY5NjQ0MjYyMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-09-22T00:00:23Z", "updated_at": "2020-09-22T00:00:23Z", "author_association": "OWNER", "body": "I still need to figure out what to do about these various other table properties: https://github.com/simonw/sqlite-utils/blob/b34c9b40c206d7a9d7ee57a8c1f198ff1f522735/sqlite_utils/db.py#L775-L787", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 705975133, "label": "table.transform() method"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/pull/161#issuecomment-696443042", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/161", "id": 696443042, "node_id": "MDEyOklzc3VlQ29tbWVudDY5NjQ0MzA0Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-09-22T00:01:50Z", "updated_at": "2020-09-22T00:01:50Z", "author_association": "OWNER", "body": "When you transform a table, it should keep its primary key, foreign keys, not_null and defaults. I don't think it needs to care about `hash_id` or `extracts=` since those don't affect the structure of the table as it is being created - well, `hash_id` does but if we are transforming an existing table we will get the `hash_id` column for free.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 705975133, "label": "table.transform() method"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/pull/161#issuecomment-696443190", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/161", "id": 696443190, "node_id": "MDEyOklzc3VlQ29tbWVudDY5NjQ0MzE5MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-09-22T00:02:22Z", "updated_at": "2020-09-22T00:02:22Z", "author_association": "OWNER", "body": "How would I detect which columns are `not_null` and what their defaults are? I don`t think my introspection logic handles that yet.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 705975133, "label": "table.transform() method"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/pull/161#issuecomment-696443845", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/161", "id": 696443845, "node_id": "MDEyOklzc3VlQ29tbWVudDY5NjQ0Mzg0NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-09-22T00:04:31Z", "updated_at": "2020-09-22T00:04:44Z", "author_association": "OWNER", "body": "Good news: the `.columns` introspection does tell me those things:\r\n```\r\n>>> import sqlite_utils\r\n>>> db = sqlite_utils.Database(memory=True)\r\n>>> db.create_table(\"foo\", {\"id\": int, \"name\": str, \"age\": int}, defaults={\"age\": 1}, not_null={\"name\", \"age\"})\r\n