{"id": 521287994, "node_id": "MDExOlB1bGxSZXF1ZXN0NTIxMjg3OTk0", "number": 203, "state": "open", "locked": 0, "title": "changes to allow for compound foreign keys", "user": {"value": 1049910, "label": "drkane"}, "body": "Add support for compound foreign keys, as per issue #117 \r\n\r\nNot sure if this is the right approach. In particular I'm unsure about:\r\n\r\n - the new `ForeignKey` class, which replaces the namedtuple in order to ensure that `column` and `other_column` are forced into tuples. The class does the job, but doesn't feel very elegant.\r\n - I haven't rewritten `guess_foreign_table` to take account of multiple columns, so it just checks for the first column in the foreign key definition. This isn't ideal.\r\n - I haven't added any ability to the CLI to add compound foreign keys, it's only in the python API at the moment.\r\n\r\nThe PR also contains a minor related change that columns and tables are always quoted in foreign key definitions.", "created_at": "2020-11-16T00:30:10Z", "updated_at": "2023-01-25T18:47:18Z", "closed_at": null, "merged_at": null, "merge_commit_sha": "0507a9464314f84e9e58b1931c583df51d757d7c", "assignee": null, "milestone": null, "draft": 0, "head": "5e43e31c2b9bcf6b5d1460b0f848fed019ed42a6", "base": "f1277f638f3a54a821db6e03cb980adad2f2fa35", "author_association": "FIRST_TIME_CONTRIBUTOR", "repo": {"value": 140912432, "label": "sqlite-utils"}, "url": "https://github.com/simonw/sqlite-utils/pull/203", "merged_by": null, "auto_merge": null} {"id": 580235427, "node_id": "MDExOlB1bGxSZXF1ZXN0NTgwMjM1NDI3", "number": 241, "state": "open", "locked": 0, "title": "Extract expand - work in progress", "user": {"value": 9599, "label": "simonw"}, "body": "Refs #239. Still needs documentation and CLI implementation.", "created_at": "2021-02-25T16:36:38Z", "updated_at": "2021-02-25T16:36:38Z", "closed_at": null, "merged_at": null, "merge_commit_sha": "0bb6c7a38994627a64e7b3375931528e96b8c222", "assignee": null, "milestone": null, "draft": 1, "head": "8d641ab08ac449081e96f3e25bd6c0226870948a", "base": "38e688fb8bcb58ae888b676fe3f7dd0529b4eecc", "author_association": "OWNER", "repo": {"value": 140912432, "label": "sqlite-utils"}, "url": "https://github.com/simonw/sqlite-utils/pull/241", "merged_by": null, "auto_merge": null} {"id": 791153878, "node_id": "PR_kwDOCGYnMM4vKAzW", "number": 347, "state": "open", "locked": 0, "title": "Test against pysqlite3 running SQLite 3.37", "user": {"value": 9599, "label": "simonw"}, "body": "Refs #346 and #344.", "created_at": "2021-11-29T23:17:57Z", "updated_at": "2021-12-11T01:02:19Z", "closed_at": null, "merged_at": null, "merge_commit_sha": "f70a61e58ae62e53af74ab48d742bdc335131fbd", "assignee": null, "milestone": null, "draft": 0, "head": "1a7ef2fe2064ace01d5535fb771f941296fb642a", "base": "213a0ff177f23a35f3b235386366ff132eb879f1", "author_association": "OWNER", "repo": {"value": 140912432, "label": "sqlite-utils"}, "url": "https://github.com/simonw/sqlite-utils/pull/347", "merged_by": null, "auto_merge": null} {"id": 1083804914, "node_id": "PR_kwDOCGYnMM5AmYzy", "number": 499, "state": "open", "locked": 0, "title": "feat: recreate fts triggers after table transform", "user": {"value": 7908073, "label": "chapmanjacobd"}, "body": "https://github.com/simonw/sqlite-utils/pull/498\r\n\r\n\r\n----\r\n:books: Documentation preview :books:: https://sqlite-utils--499.org.readthedocs.build/en/499/\r\n\r\n\r\n\r\nalternatively, `self.disable_fts()`", "created_at": "2022-10-11T20:35:39Z", "updated_at": "2022-10-26T17:54:51Z", "closed_at": null, "merged_at": null, "merge_commit_sha": "6c71562a7a21ab93541a14453961ce3d6abca3cc", "assignee": null, "milestone": null, "draft": 0, "head": "a25e83841f2703afb08aff4589cb559ae9060776", "base": "d792dad1cf5f16525da81b1e162fb71d469995f3", "author_association": "CONTRIBUTOR", "repo": {"value": 140912432, "label": "sqlite-utils"}, "url": "https://github.com/simonw/sqlite-utils/pull/499", "merged_by": null, "auto_merge": null} {"id": 205770996, "node_id": "MDExOlB1bGxSZXF1ZXN0MjA1NzcwOTk2", "number": 1, "state": "closed", "locked": 0, "title": "Make .indexes compatible with older SQLite versions", "user": {"value": 9599, "label": "simonw"}, "body": "Older SQLite versions return a different set of columns from the PRAGMA we are using.", "created_at": "2018-08-02T15:17:05Z", "updated_at": "2018-08-02T15:17:30Z", "closed_at": "2018-08-02T15:17:30Z", "merged_at": "2018-08-02T15:17:30Z", "merge_commit_sha": "741e8f7fe563e18fe9a12ac1ce38157e8c903505", "assignee": null, "milestone": null, "draft": 0, "head": "9e674311065b8372f0a93becc8e7357ceffd353b", "base": "0aa28293adedc488eb9107dc52b5e9a124887fbd", "author_association": "OWNER", "repo": {"value": 140912432, "label": "sqlite-utils"}, "url": "https://github.com/simonw/sqlite-utils/pull/1", "merged_by": null, "auto_merge": null} {"id": 247576942, "node_id": "MDExOlB1bGxSZXF1ZXN0MjQ3NTc2OTQy", "number": 4, "state": "closed", "locked": 0, "title": "Fts5", "user": {"value": 9599, "label": "simonw"}, "body": "", "created_at": "2019-01-25T06:54:05Z", "updated_at": "2019-01-25T06:54:33Z", "closed_at": "2019-01-25T06:54:33Z", "merged_at": "2019-01-25T06:54:33Z", "merge_commit_sha": "42b2b4b785e3163371e92a9cc085bc47e7c83107", "assignee": null, "milestone": null, "draft": 0, "head": "7f205d2308443557bcaec497b3d0badc0dc26f06", "base": "ccb2a1e729780689188005a52c362b7e963f71e8", "author_association": "OWNER", "repo": {"value": 140912432, "label": "sqlite-utils"}, "url": "https://github.com/simonw/sqlite-utils/pull/4", "merged_by": null, "auto_merge": null} {"id": 247861419, "node_id": "MDExOlB1bGxSZXF1ZXN0MjQ3ODYxNDE5", "number": 5, "state": "closed", "locked": 0, "title": "Run Travis tests against Python 3.8-dev", "user": {"value": 9599, "label": "simonw"}, "body": "", "created_at": "2019-01-26T02:30:55Z", "updated_at": "2019-01-26T02:37:54Z", "closed_at": "2019-01-26T02:37:54Z", "merged_at": "2019-01-26T02:37:54Z", "merge_commit_sha": "3a944d0c077c203277f13dd69387eb84b5c88d3e", "assignee": null, "milestone": null, "draft": 0, "head": "b2f81e86074526d6e4dc9e39e791deff195669de", "base": "9a4d1ff0a268c7df7839389acd92d48752d24b95", "author_association": "OWNER", "repo": {"value": 140912432, "label": "sqlite-utils"}, "url": "https://github.com/simonw/sqlite-utils/pull/5", "merged_by": null, "auto_merge": null} {"id": 249680944, "node_id": "MDExOlB1bGxSZXF1ZXN0MjQ5NjgwOTQ0", "number": 9, "state": "closed", "locked": 0, "title": ":pencil: Updates my_database.py to my_database.db", "user": {"value": 50527, "label": "jefftriplett"}, "body": "I noticed that both `.py` and `.db` were used in the docs and assumed you'd prefer `.db`. ", "created_at": "2019-02-01T17:35:43Z", "updated_at": "2019-02-24T03:55:04Z", "closed_at": "2019-02-24T03:55:04Z", "merged_at": "2019-02-24T03:55:04Z", "merge_commit_sha": "c5068a0972651b3e359ebc2d6c1486b8b7d2c242", "assignee": null, "milestone": null, "draft": 0, "head": "1ad604fbbd3311f041357190796a3613c0c729d1", "base": "441c131db5cc68e197db19f0623ff8a96c90c3ff", "author_association": "CONTRIBUTOR", "repo": {"value": 140912432, "label": "sqlite-utils"}, "url": "https://github.com/simonw/sqlite-utils/pull/9", "merged_by": null, "auto_merge": null} {"id": 255658112, "node_id": "MDExOlB1bGxSZXF1ZXN0MjU1NjU4MTEy", "number": 12, "state": "closed", "locked": 0, "title": "Support for numpy types, closes #11", "user": {"value": 9599, "label": "simonw"}, "body": "", "created_at": "2019-02-24T03:57:32Z", "updated_at": "2019-02-24T04:02:20Z", "closed_at": "2019-02-24T04:02:20Z", "merged_at": "2019-02-24T04:02:20Z", "merge_commit_sha": "e615d22c5564ea1f32abb086088b2700110be10a", "assignee": null, "milestone": null, "draft": 0, "head": "7c20e60685088d6da0739749305215790ca8375a", "base": "c5068a0972651b3e359ebc2d6c1486b8b7d2c242", "author_association": "OWNER", "repo": {"value": 140912432, "label": "sqlite-utils"}, "url": "https://github.com/simonw/sqlite-utils/pull/12", "merged_by": null, "auto_merge": null} {"id": 292879204, "node_id": "MDExOlB1bGxSZXF1ZXN0MjkyODc5MjA0", "number": 32, "state": "closed", "locked": 0, "title": "db.add_foreign_keys() method", "user": {"value": 9599, "label": "simonw"}, "body": "Refs #31. Still TODO:\r\n\r\n- [x] Unit tests\r\n- [x] Documentation", "created_at": "2019-06-28T15:40:33Z", "updated_at": "2019-06-29T06:27:39Z", "closed_at": "2019-06-29T06:27:39Z", "merged_at": "2019-06-29T06:27:39Z", "merge_commit_sha": "997d8758fc8992be93d5984556e5b9e3bad4205f", "assignee": null, "milestone": null, "draft": 0, "head": "fc81588cc31df58374c996884c67cedd98a06f4a", "base": "86bd2bba689e25f09551d611ccfbee1e069e5b66", "author_association": "OWNER", "repo": {"value": 140912432, "label": "sqlite-utils"}, "url": "https://github.com/simonw/sqlite-utils/pull/32", "merged_by": null, "auto_merge": null} {"id": 293117183, "node_id": "MDExOlB1bGxSZXF1ZXN0MjkzMTE3MTgz", "number": 34, "state": "closed", "locked": 0, "title": "sqlite-utils index-foreign-keys / db.index_foreign_keys()", "user": {"value": 9599, "label": "simonw"}, "body": "Refs #33\r\n\r\n- [x] `sqlite-utils index-foreign-keys` command\r\n- [x] `db.index_foreign_keys()` method\r\n- [x] unit tests\r\n- [x] documentation", "created_at": "2019-06-30T16:43:40Z", "updated_at": "2019-06-30T23:50:55Z", "closed_at": "2019-06-30T23:50:55Z", "merged_at": "2019-06-30T23:50:54Z", "merge_commit_sha": "e8f887ef4a0977243811b90bc2ce9aed9d2c206a", "assignee": null, "milestone": null, "draft": 0, "head": "d82b000e3d55067516e2ce42f131cf4695e80dca", "base": "0fe3b38290e1bb2d92746d90318d8662b57218bd", "author_association": "OWNER", "repo": {"value": 140912432, "label": "sqlite-utils"}, "url": "https://github.com/simonw/sqlite-utils/pull/34", "merged_by": null, "auto_merge": null} {"id": 297459797, "node_id": "MDExOlB1bGxSZXF1ZXN0Mjk3NDU5Nzk3", "number": 40, "state": "closed", "locked": 0, "title": ".get() method plus support for compound primary keys", "user": {"value": 9599, "label": "simonw"}, "body": "- [x] Tests for the `NotFoundError` exception\r\n- [x] Documentation for `.get()` method\r\n- [x] Support `--pk` multiple times to define CLI compound primary keys\r\n- [x] Documentation for compound primary keys", "created_at": "2019-07-15T03:43:13Z", "updated_at": "2019-07-15T04:28:57Z", "closed_at": "2019-07-15T04:28:52Z", "merged_at": "2019-07-15T04:28:52Z", "merge_commit_sha": "c65b67ca46f70e2da46a5b945f4ed358173262e9", "assignee": null, "milestone": null, "draft": 0, "head": "b5a5df6d0ed47f33f6e1b4873948ead9a7c71060", "base": "65b2156d9cc0aa6b5c3dc7a6bd600d98b281a13b", "author_association": "OWNER", "repo": {"value": 140912432, "label": "sqlite-utils"}, "url": "https://github.com/simonw/sqlite-utils/pull/40", "merged_by": null, "auto_merge": null} {"id": 300286535, "node_id": "MDExOlB1bGxSZXF1ZXN0MzAwMjg2NTM1", "number": 45, "state": "closed", "locked": 0, "title": "Implemented table.lookup(...), closes #44", "user": {"value": 9599, "label": "simonw"}, "body": "", "created_at": "2019-07-23T13:03:30Z", "updated_at": "2019-07-23T13:07:00Z", "closed_at": "2019-07-23T13:07:00Z", "merged_at": "2019-07-23T13:07:00Z", "merge_commit_sha": "580502431614d3653c93249988290265f3163d4b", "assignee": null, "milestone": null, "draft": 0, "head": "c0852ce018425450d6c040040f32729d41ff635c", "base": "f3a4c3d3ee6475a6caf3c9606656dbaf1df020b7", "author_association": "OWNER", "repo": {"value": 140912432, "label": "sqlite-utils"}, "url": "https://github.com/simonw/sqlite-utils/pull/45", "merged_by": null, "auto_merge": null} {"id": 300377599, "node_id": "MDExOlB1bGxSZXF1ZXN0MzAwMzc3NTk5", "number": 47, "state": "closed", "locked": 0, "title": "extracts= table parameter", "user": {"value": 9599, "label": "simonw"}, "body": "Still needs docs. Refs #46", "created_at": "2019-07-23T16:30:29Z", "updated_at": "2019-07-23T17:00:43Z", "closed_at": "2019-07-23T17:00:43Z", "merged_at": "2019-07-23T17:00:43Z", "merge_commit_sha": "941d281aee6eac20ad64b505511da7e47f697700", "assignee": null, "milestone": null, "draft": 0, "head": "1c9d08f75a48b2a3770f2a880462dc8b195289b7", "base": "e22cfcd953f967f6e9551b3a048d7c40726f349b", "author_association": "OWNER", "repo": {"value": 140912432, "label": "sqlite-utils"}, "url": "https://github.com/simonw/sqlite-utils/pull/47", "merged_by": null, "auto_merge": null} {"id": 301824097, "node_id": "MDExOlB1bGxSZXF1ZXN0MzAxODI0MDk3", "number": 51, "state": "closed", "locked": 0, "title": "Fix for too many SQL variables, closes #50", "user": {"value": 9599, "label": "simonw"}, "body": "", "created_at": "2019-07-28T11:30:30Z", "updated_at": "2019-07-28T11:59:32Z", "closed_at": "2019-07-28T11:59:32Z", "merged_at": "2019-07-28T11:59:32Z", "merge_commit_sha": "9cb045284ede8009c12abdb1755b5b20f6ccff5f", "assignee": null, "milestone": null, "draft": 0, "head": "0c1b8b7f96be874bb63801f69323960f277aa49a", "base": "9b7be79c86b4283f24a64f62257c918f12542997", "author_association": "OWNER", "repo": {"value": 140912432, "label": "sqlite-utils"}, "url": "https://github.com/simonw/sqlite-utils/pull/51", "merged_by": null, "auto_merge": null} {"id": 297412464, "node_id": "MDExOlB1bGxSZXF1ZXN0Mjk3NDEyNDY0", "number": 38, "state": "closed", "locked": 0, "title": "table.update() method", "user": {"value": 9599, "label": "simonw"}, "body": "Refs #35\r\n\r\nStill to do:\r\n\r\n- [x] Unit tests\r\n- [x] Switch to using `.get()`\r\n- [x] Better exceptions, plus unit tests for what happens if pk does not exist\r\n- [x] Documentation\r\n- [x] Ensure compound primary keys work properly\r\n- [x] `alter=True` support", "created_at": "2019-07-14T17:03:49Z", "updated_at": "2019-07-28T15:43:51Z", "closed_at": "2019-07-28T15:43:51Z", "merged_at": "2019-07-28T15:43:51Z", "merge_commit_sha": "0747dabb24b608e8524de4858ce50c60ba7e471b", "assignee": null, "milestone": null, "draft": 0, "head": "16d7008002b43cf47a973791da93e5cdd5913fc3", "base": "a6749cdf43229c4f7864c946496e9ac0141627d9", "author_association": "OWNER", "repo": {"value": 140912432, "label": "sqlite-utils"}, "url": "https://github.com/simonw/sqlite-utils/pull/38", "merged_by": null, "auto_merge": null} {"id": 303990683, "node_id": "MDExOlB1bGxSZXF1ZXN0MzAzOTkwNjgz", "number": 53, "state": "closed", "locked": 0, "title": "Work in progress: m2m() method for creating many-to-many records", "user": {"value": 9599, "label": "simonw"}, "body": "- [x] `table.insert({\"name\": \"Barry\"}).m2m(\"tags\", lookup={\"tag\": \"Coworker\"})`\r\n- [x] Explicit table name `.m2m(\"humans\", ..., m2m_table=\"relationships\")`\r\n- [x] Automatically use an existing m2m table if a single obvious candidate exists (a table with two foreign keys in the correct directions)\r\n- [x] Require the explicit `m2m_table=` argument if multiple candidates for the m2m table exist\r\n- [x] Documentation\r\n\r\nRefs #23", "created_at": "2019-08-03T10:03:56Z", "updated_at": "2019-08-04T03:38:10Z", "closed_at": "2019-08-04T03:37:33Z", "merged_at": "2019-08-04T03:37:33Z", "merge_commit_sha": "4c0912dbf27b12071aca9569bcf7233e60f91c7c", "assignee": null, "milestone": null, "draft": 0, "head": "243bcaa1acd32a173c07b24dca553991493005a0", "base": "e1021030dd2d8d4705ad0e7bae389eeaea7fa17b", "author_association": "OWNER", "repo": {"value": 140912432, "label": "sqlite-utils"}, "url": "https://github.com/simonw/sqlite-utils/pull/53", "merged_by": null, "auto_merge": null} {"id": 308292447, "node_id": "MDExOlB1bGxSZXF1ZXN0MzA4MjkyNDQ3", "number": 55, "state": "closed", "locked": 0, "title": "Ability to introspect and run queries against views", "user": {"value": 9599, "label": "simonw"}, "body": "See #54 ", "created_at": "2019-08-17T13:40:56Z", "updated_at": "2019-08-23T12:19:42Z", "closed_at": "2019-08-23T12:19:42Z", "merged_at": "2019-08-23T12:19:42Z", "merge_commit_sha": "9faa98222669723d31e918bb16a42c13c363817f", "assignee": null, "milestone": null, "draft": 0, "head": "4441d6d838fd7518ce715184361f549a04ec8b70", "base": "0e7b461eb3e925aef713206c15794ceae9259c57", "author_association": "OWNER", "repo": {"value": 140912432, "label": "sqlite-utils"}, "url": "https://github.com/simonw/sqlite-utils/pull/55", "merged_by": null, "auto_merge": null} {"id": 313007483, "node_id": "MDExOlB1bGxSZXF1ZXN0MzEzMDA3NDgz", "number": 56, "state": "closed", "locked": 0, "title": "Escape the table name in populate_fts and search.", "user": {"value": 49260, "label": "amjith"}, "body": "The table names weren't escaped using double quotes in the populate_fts method. \r\n\r\nReproducible case: \r\n```\r\n>>> import sqlite_utils\r\n>>> db = sqlite_utils.Database(\"abc.db\")\r\n>>> db[\"http://example.com\"].insert_all([\r\n... {\"id\": 1, \"age\": 4, \"name\": \"Cleo\"},\r\n... {\"id\": 2, \"age\": 2, \"name\": \"Pancakes\"}\r\n... ], pk=\"id\")\r\n