{"html_url": "https://github.com/simonw/sqlite-utils/issues/540#issuecomment-1537744000", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/540", "id": 1537744000, "node_id": "IC_kwDOCGYnMM5bqByA", "user": {"value": 42327, "label": "pquentin"}, "created_at": "2023-05-08T04:56:12Z", "updated_at": "2023-05-08T04:56:12Z", "author_association": "NONE", "body": "Hey @simonw, urllib3 maintainer here :wave:\r\n\r\nSorry for breaking your CI. I understand you may prefer to pin the Python version, but note that specifying just `python: \"3\"` will get you the latest. We use that in urllib3: https://github.com/urllib3/urllib3/blob/main/.readthedocs.yml\r\n\r\nI can open PRs to sqlite-utils / datasette if you're interested", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1699184583, "label": "sphinx.builders.linkcheck build error"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/538#issuecomment-1538793817", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/538", "id": 1538793817, "node_id": "IC_kwDOCGYnMM5buCFZ", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T17:55:10Z", "updated_at": "2023-05-08T17:55:10Z", "author_association": "OWNER", "body": "Confirmed - I added this test and it fails:\r\n```python\r\ndef test_upsert_all_not_null(fresh_db):\r\n # https://github.com/simonw/sqlite-utils/issues/538\r\n fresh_db[\"comments\"].upsert_all(\r\n [{\"id\": 1, \"name\": \"Cleo\"}],\r\n pk=\"id\",\r\n not_null=[\"name\"],\r\n )\r\n assert list(fresh_db[\"comments\"].rows) == [{\"id\": 1, \"name\": \"Cleo\"}]\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1695428235, "label": "`table.upsert_all` fails to write rows when `not_null` is present"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/538#issuecomment-1538801855", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/538", "id": 1538801855, "node_id": "IC_kwDOCGYnMM5buEC_", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T18:00:17Z", "updated_at": "2023-05-08T18:00:17Z", "author_association": "OWNER", "body": "From time in the debugger, after creating the table it ends up doing this:\r\n```\r\n(Pdb) queries_and_params\r\n[\r\n ('INSERT OR IGNORE INTO [comments]([id]) VALUES(?);', [1]),\r\n ('UPDATE [comments] SET [name] = ? WHERE [id] = ?', ['Cleo', 1])\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": 1695428235, "label": "`table.upsert_all` fails to write rows when `not_null` is present"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/538#issuecomment-1538887361", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/538", "id": 1538887361, "node_id": "IC_kwDOCGYnMM5buY7B", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T19:01:20Z", "updated_at": "2023-05-08T19:01:20Z", "author_association": "OWNER", "body": "Here's the problem:\r\n```python\r\nimport sqlite3\r\ndb = sqlite3.connect(\":memory:\")\r\ndb.execute('create table foo (id integer primary key, name not null)')\r\ndb.execute('insert into foo (id) values (1)')\r\n```\r\nProduces:\r\n```\r\nIntegrityError: NOT NULL constraint failed: foo.name\r\n```\r\nBut this:\r\n```python\r\ndb.execute('insert or ignore into foo (id) values (1)')\r\n```\r\nCompletes without an exception.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1695428235, "label": "`table.upsert_all` fails to write rows when `not_null` is present"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/538#issuecomment-1538889482", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/538", "id": 1538889482, "node_id": "IC_kwDOCGYnMM5buZcK", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T19:02:38Z", "updated_at": "2023-05-08T19:02:38Z", "author_association": "OWNER", "body": "Here's the code at fault:\r\nhttps://github.com/simonw/sqlite-utils/blob/80763edaa2bdaf1113717378b8d62075c4dcbcfb/sqlite_utils/db.py#L2774-L2788", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1695428235, "label": "`table.upsert_all` fails to write rows when `not_null` is present"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/538#issuecomment-1538893329", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/538", "id": 1538893329, "node_id": "IC_kwDOCGYnMM5buaYR", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T19:04:47Z", "updated_at": "2023-05-08T19:04:47Z", "author_association": "OWNER", "body": "This feels like a fundamental flaw in the way upserts are implemented by `sqlite-utils`.\r\n\r\nOne fix would be to switch to using the `UPSERT` feature in SQLite: https://www.sqlite.org/lang_UPSERT.html\r\n\r\nBut...\r\n\r\n> UPSERT syntax was added to SQLite with version 3.24.0 (2018-06-04).\r\n\r\nI still want to support SQLite versions earlier than that.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1695428235, "label": "`table.upsert_all` fails to write rows when `not_null` is present"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/538#issuecomment-1538903556", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/538", "id": 1538903556, "node_id": "IC_kwDOCGYnMM5buc4E", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T19:11:24Z", "updated_at": "2023-05-08T19:13:23Z", "author_association": "OWNER", "body": "I could detect if this happens using `cursor.rowcount` - not sure how I would recover from it though.\r\n\r\nThis would also require some major re-engineering, since currently it all works by generating a list of SQL queries in advance and applying them inside a loop in `.insert_chunk()`:\r\n\r\nhttps://github.com/simonw/sqlite-utils/blob/80763edaa2bdaf1113717378b8d62075c4dcbcfb/sqlite_utils/db.py#L2839-L2878\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1695428235, "label": "`table.upsert_all` fails to write rows when `not_null` is present"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/538#issuecomment-1538910894", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/538", "id": 1538910894, "node_id": "IC_kwDOCGYnMM5buequ", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T19:16:52Z", "updated_at": "2023-05-08T19:17:00Z", "author_association": "OWNER", "body": "How about if I had logic which checked that all not-null columns were provided in the call to `upsert_all()` - and if they were, modified the `INSERT OR IGNORE INTO` to include a placeholder value for those columns that would then be fixed by the later `UPDATE`?\r\n\r\nSomething like this:\r\n\r\n```python\r\n[\r\n ('INSERT OR IGNORE INTO [comments]([id], name) VALUES(?, ?);', [1, '']),\r\n ('UPDATE [comments] SET [name] = ? WHERE [id] = ?', ['Cleo', 1])\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": 1695428235, "label": "`table.upsert_all` fails to write rows when `not_null` is present"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/538#issuecomment-1538921774", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/538", "id": 1538921774, "node_id": "IC_kwDOCGYnMM5buhUu", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T19:24:41Z", "updated_at": "2023-05-08T19:24:41Z", "author_association": "OWNER", "body": "That fix seems to work!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1695428235, "label": "`table.upsert_all` fails to write rows when `not_null` is present"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/534#issuecomment-1538933540", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/534", "id": 1538933540, "node_id": "IC_kwDOCGYnMM5bukMk", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T19:34:37Z", "updated_at": "2023-05-08T19:34:37Z", "author_association": "OWNER", "body": "On macOS this shows the same warning:\r\n```\r\n% python -Wdefault $(which sqlite-utils) insert dogs.db dogs dogs.csv --csv\r\n [############------------------------] 35%\r\n [####################################] 100%/Users/simon/Dropbox/Development/sqlite-utils/sqlite_utils/cli.py:1187: ResourceWarning: unclosed file <_io.TextIOWrapper name='dogs.csv' encoding='utf-8-sig'>\r\n insert_upsert_implementation(\r\nResourceWarning: Enable tracemalloc to get the object allocation traceback\r\n```\r\nThe file itself is a `click.File` which is automatically closed - https://click.palletsprojects.com/en/8.1.x/api/#click.File - but it looks like it's the `_io.TextIOWrapper` which is not being closed:\r\n\r\nhttps://github.com/simonw/sqlite-utils/blob/2376c452a56b0c3e75e7ca698273434e32945304/sqlite_utils/cli.py#L949-L956", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1622640374, "label": " ResourceWarning: unclosed file"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/541#issuecomment-1538963959", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/541", "id": 1538963959, "node_id": "IC_kwDOCGYnMM5burn3", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T19:59:34Z", "updated_at": "2023-05-08T19:59:34Z", "author_association": "OWNER", "body": "There are 8 failing tests left:\r\n\r\n```\r\n==== short test summary info ====\r\nFAILED tests/test_cli_memory.py::test_memory_csv[False-test] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]>\r\nFAILED tests/test_cli_memory.py::test_memory_csv[False-t] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]>\r\nFAILED tests/test_cli_memory.py::test_memory_csv[False-t1] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]>\r\nFAILED tests/test_cli_memory.py::test_memory_tsv[False] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]>\r\nFAILED tests/test_cli_memory.py::test_memory_dump[extra_args0] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]>\r\nFAILED tests/test_cli_memory.py::test_memory_two_files_with_same_stem - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]>\r\nFAILED tests/test_recipes.py::test_dateparse_errors[None-parsedate] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: .convert_value at 0x106bcaca0>\r\nFAILED tests/test_recipes.py::test_dateparse_errors[None-parsedatetime] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: .convert_value at 0x106bc9620>\r\nERROR tests/test_cli.py::test_upsert_analyze - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]>\r\n==== 8 failed, 894 passed, 4 skipped, 1 error in 6.27s ====\r\n```\r\nFull traceback here: https://gist.github.com/simonw/b40b3e814729d6c02a0302a84ce54d9e", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1700840265, "label": "Get tests to pass with `pytest -Werror`"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/538#issuecomment-1538975545", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/538", "id": 1538975545, "node_id": "IC_kwDOCGYnMM5buuc5", "user": {"value": 1231935, "label": "xavdid"}, "created_at": "2023-05-08T20:06:35Z", "updated_at": "2023-05-08T20:06:35Z", "author_association": "NONE", "body": "perfect, thank you!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1695428235, "label": "`table.upsert_all` fails to write rows when `not_null` is present"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/532#issuecomment-1539006509", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/532", "id": 1539006509, "node_id": "IC_kwDOCGYnMM5bu2At", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T20:28:56Z", "updated_at": "2023-05-08T20:28:56Z", "author_association": "OWNER", "body": "Was this a newline-delimited JSON file perhaps?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1620254998, "label": "Show more information when JSON can't be imported with sqlite-utils insert"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/532#issuecomment-1539009453", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/532", "id": 1539009453, "node_id": "IC_kwDOCGYnMM5bu2ut", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T20:30:29Z", "updated_at": "2023-05-08T20:30:42Z", "author_association": "OWNER", "body": "Here's an improvement:\r\n```\r\n% sqlite-utils insert /tmp/b.db blah /tmp/blah.txt\r\n [####################################] 100%\r\nError: Invalid JSON - use --csv for CSV or --tsv for TSV files\r\n\r\nJSON error: Expecting value: line 1 column 1 (char 0)\r\n```", "reactions": "{\"total_count\": 1, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 1, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1620254998, "label": "Show more information when JSON can't be imported with sqlite-utils insert"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/530#issuecomment-1539015064", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/530", "id": 1539015064, "node_id": "IC_kwDOCGYnMM5bu4GY", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T20:35:07Z", "updated_at": "2023-05-08T20:35:07Z", "author_association": "OWNER", "body": "Wow, this is a neat feature I didn't know about. Looks like there are a bunch of options:\r\n\r\n- NO ACTION (default)\r\n- RESTRICT: application is prohibited from deleting a parent key when there exists one or more child keys mapped to it\r\n- SET NULL: when a parent key is deleted the child key columns of all rows in the child table that mapped to the parent key are set to contain SQL NULL values\r\n- SET DEFAULT: set a specific default\r\n- CASCADE: propagates the delete or update operation on the parent key to each dependent child key", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1595340692, "label": "add ability to configure \"on delete\" and \"on update\" attributes of foreign keys:"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/530#issuecomment-1539018912", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/530", "id": 1539018912, "node_id": "IC_kwDOCGYnMM5bu5Cg", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T20:39:00Z", "updated_at": "2023-05-08T20:39:00Z", "author_association": "OWNER", "body": "I think the natural place to add these in the Python library API would be https://sqlite-utils.datasette.io/en/stable/python-api.html#adding-foreign-key-constraints - maybe something like this:\r\n\r\n```python\r\ndb[\"books\"].add_foreign_key(\"author_id\", \"authors\", \"id\", on_delete=RESTRICT)\r\n```\r\n\r\nThen for the CLI tool could be added to https://sqlite-utils.datasette.io/en/stable/cli-reference.html#add-foreign-key\r\n\r\n```\r\nsqlite-utils add-foreign-key my.db books author_id authors id --on-update SET_NULL\r\n```\r\nI wouldn't support these for the other methods of adding foreign keys - `foreign_keys(...)` for the various `.insert()` etc methods and the `add_foreign_keys(...)` bulk menthod.", "reactions": "{\"total_count\": 1, \"+1\": 0, \"-1\": 0, \"laugh\": 1, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1595340692, "label": "add ability to configure \"on delete\" and \"on update\" attributes of foreign keys:"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/527#issuecomment-1539033736", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/527", "id": 1539033736, "node_id": "IC_kwDOCGYnMM5bu8qI", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T20:52:51Z", "updated_at": "2023-05-08T20:52:51Z", "author_association": "OWNER", "body": "OK, I implemented that at the Python API level. I need to decide how it should work for the `sqlite-utils convert` command too: https://sqlite-utils.datasette.io/en/stable/cli-reference.html#convert", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1578790070, "label": "`Table.convert()` skips falsey values"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/527#issuecomment-1539035838", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/527", "id": 1539035838, "node_id": "IC_kwDOCGYnMM5bu9K-", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T20:55:00Z", "updated_at": "2023-05-08T20:55:00Z", "author_association": "OWNER", "body": "I'm going to go with `--no-skip-false` as the CLI option. It's ugly, but this whole thing is ugly. I'm going to make a note to remove this misfeature in `sqlite-utils` 4.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1578790070, "label": "`Table.convert()` skips falsey values"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/527#issuecomment-1539051724", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/527", "id": 1539051724, "node_id": "IC_kwDOCGYnMM5bvBDM", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T21:07:04Z", "updated_at": "2023-05-08T21:07:04Z", "author_association": "OWNER", "body": "Updated documentation:\r\n- https://sqlite-utils.datasette.io/en/latest/python-api.html#converting-data-in-columns\r\n- https://sqlite-utils.datasette.io/en/latest/cli.html#converting-data-in-columns\r\n- https://sqlite-utils.datasette.io/en/latest/cli-reference.html#convert", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1578790070, "label": "`Table.convert()` skips falsey values"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/542#issuecomment-1539052467", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/542", "id": 1539052467, "node_id": "IC_kwDOCGYnMM5bvBOz", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T21:07:41Z", "updated_at": "2023-05-08T21:07:41Z", "author_association": "OWNER", "body": "Relevant commits (will mostly revert these):\r\n- https://github.com/simonw/sqlite-utils/commit/455c35b512895c19bf922c2b804d750d27cb8dbd\r\n- https://github.com/simonw/sqlite-utils/commit/e0ec4c345129996011951e400388fd74865f65a2", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1700936245, "label": "Remove `skip_false=True` and `--no-skip-false` in `sqlite-utils` 4.0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/pull/528#issuecomment-1539053230", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/528", "id": 1539053230, "node_id": "IC_kwDOCGYnMM5bvBau", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T21:08:23Z", "updated_at": "2023-05-08T21:08:23Z", "author_association": "OWNER", "body": "I fixed this in:\r\n- #527\r\n\r\nWill fully remove this misfeature in:\r\n- #542", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1578793661, "label": "Enable `Table.convert()` on falsey values"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/pull/537#issuecomment-1539055393", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/537", "id": 1539055393, "node_id": "IC_kwDOCGYnMM5bvB8h", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T21:10:06Z", "updated_at": "2023-05-08T21:10:06Z", "author_association": "OWNER", "body": "Thanks!", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1665200812, "label": "Support self-referencing FKs in `Table.create`"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/pull/519#issuecomment-1539058795", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/519", "id": 1539058795, "node_id": "IC_kwDOCGYnMM5bvCxr", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T21:12:52Z", "updated_at": "2023-05-08T21:12:52Z", "author_association": "OWNER", "body": "This is a really neat fix, thank you.", "reactions": "{\"total_count\": 1, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 1, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1505568103, "label": "Fixes breaking DEFAULT values"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/pull/515#issuecomment-1539077777", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/515", "id": 1539077777, "node_id": "IC_kwDOCGYnMM5bvHaR", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T21:27:10Z", "updated_at": "2023-05-08T21:27:10Z", "author_association": "OWNER", "body": "I should have spotted this PR before I shipped my own fix! https://github.com/simonw/sqlite-utils/commit/2376c452a56b0c3e75e7ca698273434e32945304", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1465194930, "label": "upsert new rows with constraints, fixes #514"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/514#issuecomment-1539078429", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/514", "id": 1539078429, "node_id": "IC_kwDOCGYnMM5bvHkd", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T21:27:40Z", "updated_at": "2023-05-08T21:27:40Z", "author_association": "OWNER", "body": "Dupe of:\r\n- #538", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1465194249, "label": "upsert of new row with check constraints fails"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/514#issuecomment-1539079507", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/514", "id": 1539079507, "node_id": "IC_kwDOCGYnMM5bvH1T", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T21:28:37Z", "updated_at": "2023-05-08T21:28:37Z", "author_association": "OWNER", "body": "> This means that a table with NON NULL (or other constraint) columns that aren't part of the pkey can't have new rows upserted.\r\n\r\nHuh... on that basis, it's possible my fix in https://github.com/simonw/sqlite-utils/commit/2376c452a56b0c3e75e7ca698273434e32945304 is incomplete. I only covered the 'not null' case.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1465194249, "label": "upsert of new row with check constraints fails"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/514#issuecomment-1539094287", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/514", "id": 1539094287, "node_id": "IC_kwDOCGYnMM5bvLcP", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T21:44:11Z", "updated_at": "2023-05-08T21:44:11Z", "author_association": "OWNER", "body": "OK, this fails silently:\r\n```python\r\nimport sqlite_utils\r\ndb = sqlite_utils.Database(memory=True)\r\ndb.execute('''CREATE TABLE employees (\r\n id INTEGER PRIMARY KEY,\r\n name TEXT,\r\n age INTEGER,\r\n salary REAL,\r\n CHECK (salary is not null and salary > 0)\r\n);''')\r\ndb[\"employees\"].upsert({\"id\": 1, \"name\": \"Bob\"}, pk=\"id\")\r\nlist(db[\"employees\"].rows)\r\n````\r\nIt outputs:\r\n```python\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": 1465194249, "label": "upsert of new row with check constraints fails"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/514#issuecomment-1539099703", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/514", "id": 1539099703, "node_id": "IC_kwDOCGYnMM5bvMw3", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T21:50:06Z", "updated_at": "2023-05-08T21:50:06Z", "author_association": "OWNER", "body": "Applying the fix from the PR here doesn't fix the above problem either:\r\n- https://github.com/simonw/sqlite-utils/pull/515\r\n\r\nSo it looks like these kinds of `check` constraints currently aren't compatible with how `upsert()` works.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1465194249, "label": "upsert of new row with check constraints fails"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/514#issuecomment-1539100300", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/514", "id": 1539100300, "node_id": "IC_kwDOCGYnMM5bvM6M", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T21:50:51Z", "updated_at": "2023-05-08T21:50:51Z", "author_association": "OWNER", "body": "Seeing as `sqlite-utils` doesn't currently provide mechanisms for adding `check` constraints like this I'm going to leave this - I'm happy with the fix I put in for the `not null` constraints.", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1465194249, "label": "upsert of new row with check constraints fails"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/525#issuecomment-1539101853", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/525", "id": 1539101853, "node_id": "IC_kwDOCGYnMM5bvNSd", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T21:52:44Z", "updated_at": "2023-05-08T21:52:44Z", "author_association": "OWNER", "body": "I like the `lambda-{uuid}` idea.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1575131737, "label": "Repeated calls to `Table.convert()` fail"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/525#issuecomment-1539108140", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/525", "id": 1539108140, "node_id": "IC_kwDOCGYnMM5bvO0s", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T21:59:41Z", "updated_at": "2023-05-08T21:59:41Z", "author_association": "OWNER", "body": "That original example passes against `main` now.", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1575131737, "label": "Repeated calls to `Table.convert()` fail"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/520#issuecomment-1539109587", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/520", "id": 1539109587, "node_id": "IC_kwDOCGYnMM5bvPLT", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T22:00:46Z", "updated_at": "2023-05-08T22:00:46Z", "author_association": "OWNER", "body": "> Hey, isn't this essentially the same issue as #448 ?\r\n\r\nYes it is, good catch!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1516644980, "label": "rows_from_file() raises confusing error if file-like object is not in binary mode"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/448#issuecomment-1539109816", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/448", "id": 1539109816, "node_id": "IC_kwDOCGYnMM5bvPO4", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T22:01:00Z", "updated_at": "2023-05-08T22:01:00Z", "author_association": "OWNER", "body": "This is being handled in:\r\n- #520", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1279144769, "label": "Reading rows from a file => AttributeError: '_io.StringIO' object has no attribute 'readinto'"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/pull/537#issuecomment-1539157643", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/537", "id": 1539157643, "node_id": "IC_kwDOCGYnMM5bva6L", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-08T22:45:09Z", "updated_at": "2023-05-08T22:45:21Z", "author_association": "OWNER", "body": "Here's an example from the new tests:\r\n\r\nhttps://github.com/simonw/sqlite-utils/blob/a75abeb61b91a28650d3b9933e7ec80ad0d92529/tests/test_create.py#L291-L307", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1665200812, "label": "Support self-referencing FKs in `Table.create`"}, "performed_via_github_app": null}