{"html_url": "https://github.com/simonw/datasette/pull/1374#issuecomment-859572791", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1374", "id": 859572791, "node_id": "MDEyOklzc3VlQ29tbWVudDg1OTU3Mjc5MQ==", "user": {"value": 22429695, "label": "codecov[bot]"}, "created_at": "2021-06-11T13:12:58Z", "updated_at": "2021-06-11T13:12:58Z", "author_association": "NONE", "body": "# [Codecov](https://codecov.io/gh/simonw/datasette/pull/1374?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) Report\n> Merging [#1374](https://codecov.io/gh/simonw/datasette/pull/1374?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) (0ef0dd5) into [main](https://codecov.io/gh/simonw/datasette/commit/cd7678fde65319d7b6955ce9f4678ba4b9e64b66?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) (cd7678f) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[![Impacted file tree graph](https://codecov.io/gh/simonw/datasette/pull/1374/graphs/tree.svg?width=650&height=150&src=pr&token=eSahVY7kw1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison)](https://codecov.io/gh/simonw/datasette/pull/1374?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison)\n\n```diff\n@@ Coverage Diff @@\n## main #1374 +/- ##\n=======================================\n Coverage 91.68% 91.68% \n=======================================\n Files 34 34 \n Lines 4340 4340 \n=======================================\n Hits 3979 3979 \n Misses 361 361 \n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/simonw/datasette/pull/1374?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison)\n> `\u0394 = absolute (impact)`, `\u00f8 = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/simonw/datasette/pull/1374?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison). Last update [cd7678f...0ef0dd5](https://codecov.io/gh/simonw/datasette/pull/1374?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison).\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 918730335, "label": "Bump black from 21.5b2 to 21.6b0"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/268#issuecomment-859888469", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/268", "id": 859888469, "node_id": "MDEyOklzc3VlQ29tbWVudDg1OTg4ODQ2OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-06-11T20:26:20Z", "updated_at": "2021-06-11T20:26:20Z", "author_association": "OWNER", "body": "`sqlite-utils schema data.db` could output the same thing to the console.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 919181559, "label": "db.schema property and sqlite-utils schema command"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/268#issuecomment-859894105", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/268", "id": 859894105, "node_id": "MDEyOklzc3VlQ29tbWVudDg1OTg5NDEwNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-06-11T20:28:52Z", "updated_at": "2021-06-11T20:28:52Z", "author_association": "OWNER", "body": "Out of interest, here are the rows from that table where `sql` is `null`: https://latest.datasette.io/fixtures?sql=select%0D%0A++*%0D%0Afrom%0D%0A++sqlite_master%0D%0Awhere%0D%0A++sql+is+null\r\n\r\n```csv\r\ntype,name,tbl_name,rootpage,sql\r\nindex,sqlite_autoindex_simple_primary_key_1,simple_primary_key,3,\r\nindex,sqlite_autoindex_primary_key_multiple_columns_1,primary_key_multiple_columns,5,\r\nindex,sqlite_autoindex_primary_key_multiple_columns_explicit_label_1,primary_key_multiple_columns_explicit_label,7,\r\nindex,sqlite_autoindex_compound_primary_key_1,compound_primary_key,9,\r\nindex,sqlite_autoindex_compound_three_primary_keys_1,compound_three_primary_keys,11,\r\nindex,sqlite_autoindex_foreign_key_references_1,foreign_key_references,14,\r\nindex,sqlite_autoindex_sortable_1,sortable,16,\r\nindex,sqlite_autoindex_Table With Space In Name_1,Table With Space In Name,20,\r\nindex,sqlite_autoindex_table/with/slashes.csv_1,table/with/slashes.csv,22,\r\nindex,sqlite_autoindex_complex_foreign_keys_1,complex_foreign_keys,24,\r\nindex,sqlite_autoindex_custom_foreign_key_label_1,custom_foreign_key_label,26,\r\nindex,sqlite_autoindex_tags_1,tags,31,\r\nindex,sqlite_autoindex_searchable_tags_1,searchable_tags,34,\r\nindex,sqlite_autoindex_searchable_fts_segdir_1,searchable_fts_segdir,37,\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 919181559, "label": "db.schema property and sqlite-utils schema command"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/268#issuecomment-859895540", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/268", "id": 859895540, "node_id": "MDEyOklzc3VlQ29tbWVudDg1OTg5NTU0MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-06-11T20:30:34Z", "updated_at": "2021-06-11T20:30:34Z", "author_association": "OWNER", "body": "You can currently see the `sql` on the CLI using:\r\n\r\n % sqlite-utils rows fixtures.db sqlite_master -c name -c sql\r\n name sql\r\n -------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------\r\n simple_primary_key CREATE TABLE simple_primary_key (\r\n id varchar(30) primary key,\r\n content text\r\n )\r\n sqlite_autoindex_simple_primary_key_1\r\n primary_key_multiple_columns CREATE TABLE primary_key_multiple_columns (\r\n id varchar(30) primary key,\r\n content text,\r\n content2 text\r\n )\r\n sqlite_autoindex_primary_key_multiple_columns_1\r\n primary_key_multiple_columns_explicit_label CREATE TABLE primary_key_multiple_columns_explicit_label (\r\n id varchar(30) primary key,\r\n content text,\r\n content2 text\r\n )\r\n sqlite_autoindex_primary_key_multiple_columns_explicit_label_1\r\n compound_primary_key CREATE TABLE compound_primary_key (\r\n pk1 varchar(30),\r\n pk2 varchar(30),\r\n content text,\r\n PRIMARY KEY (pk1, pk2)\r\n )\r\n sqlite_autoindex_compound_primary_key_1\r\n compound_three_primary_keys CREATE TABLE compound_three_primary_keys (\r\n pk1 varchar(30),\r\n pk2 varchar(30),\r\n pk3 varchar(30),\r\n content text,\r\n PRIMARY KEY (pk1, pk2, pk3)\r\n )\r\n sqlite_autoindex_compound_three_primary_keys_1\r\n foreign_key_references CREATE TABLE foreign_key_references (\r\n pk varchar(30) primary key,\r\n foreign_key_with_label varchar(30),\r\n foreign_key_with_no_label varchar(30),\r\n FOREIGN KEY (foreign_key_with_label) REFERENCES simple_primary_key(id),\r\n FOREIGN KEY (foreign_key_with_no_label) REFERENCES primary_key_multiple_columns(id)\r\n )\r\n sqlite_autoindex_foreign_key_references_1\r\n sortable CREATE TABLE sortable (\r\n pk1 varchar(30),\r\n pk2 varchar(30),\r\n content text,\r\n sortable integer,\r\n sortable_with_nulls real,\r\n sortable_with_nulls_2 real,\r\n text text,\r\n PRIMARY KEY (pk1, pk2)\r\n )\r\n sqlite_autoindex_sortable_1\r\n no_primary_key CREATE TABLE no_primary_key (\r\n content text,\r\n a text,\r\n b text,\r\n c text\r\n )\r\n 123_starts_with_digits CREATE TABLE [123_starts_with_digits] (\r\n content text\r\n )\r\n paginated_view CREATE VIEW paginated_view AS\r\n SELECT\r\n content,\r\n '- ' || content || ' -' AS content_extra\r\n FROM no_primary_key\r\n Table With Space In Name CREATE TABLE \"Table With Space In Name\" (\r\n pk varchar(30) primary key,\r\n content text\r\n )\r\n sqlite_autoindex_Table With Space In Name_1\r\n table/with/slashes.csv CREATE TABLE \"table/with/slashes.csv\" (\r\n pk varchar(30) primary key,\r\n content text\r\n )\r\n sqlite_autoindex_table/with/slashes.csv_1\r\n complex_foreign_keys CREATE TABLE \"complex_foreign_keys\" (\r\n pk varchar(30) primary key,\r\n f1 text,\r\n f2 text,\r\n f3 text,\r\n FOREIGN KEY (\"f1\") REFERENCES [simple_primary_key](id),\r\n FOREIGN KEY (\"f2\") REFERENCES [simple_primary_key](id),\r\n FOREIGN KEY (\"f3\") REFERENCES [simple_primary_key](id)\r\n )\r\n sqlite_autoindex_complex_foreign_keys_1\r\n custom_foreign_key_label CREATE TABLE \"custom_foreign_key_label\" (\r\n pk varchar(30) primary key,\r\n foreign_key_with_custom_label text,\r\n FOREIGN KEY (\"foreign_key_with_custom_label\") REFERENCES [primary_key_multiple_columns_explicit_label](id)\r\n )\r\n sqlite_autoindex_custom_foreign_key_label_1\r\n units CREATE TABLE units (\r\n pk integer primary key,\r\n distance int,\r\n frequency int\r\n )\r\n searchable CREATE TABLE searchable (\r\n pk integer primary key,\r\n text1 text,\r\n text2 text,\r\n [name with . and spaces] text\r\n )\r\n searchable_fts CREATE VIRTUAL TABLE \"searchable_fts\"\r\n USING FTS3 (text1, text2, [name with . and spaces], content=\"searchable\")\r\n searchable_fts_content CREATE TABLE 'searchable_fts_content'(docid INTEGER PRIMARY KEY, 'c0text1', 'c1text2', 'c2name with . and spaces', 'c3content')\r\n searchable_fts_segments CREATE TABLE 'searchable_fts_segments'(blockid INTEGER PRIMARY KEY, block BLOB)\r\n searchable_fts_segdir CREATE TABLE 'searchable_fts_segdir'(level INTEGER,idx INTEGER,start_block INTEGER,leaves_end_block INTEGER,end_block INTEGER,root BLOB,PRIMARY KEY(level, idx))\r\n sqlite_autoindex_searchable_fts_segdir_1\r\n select CREATE TABLE [select] (\r\n [group] text,\r\n [having] text,\r\n [and] text\r\n )\r\n facet_cities CREATE TABLE facet_cities (\r\n id integer primary key,\r\n name text\r\n )\r\n simple_view CREATE VIEW simple_view AS\r\n SELECT content, upper(content) AS upper_content FROM simple_primary_key\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 919181559, "label": "db.schema property and sqlite-utils schema command"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/268#issuecomment-859898736", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/268", "id": 859898736, "node_id": "MDEyOklzc3VlQ29tbWVudDg1OTg5ODczNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-06-11T20:37:44Z", "updated_at": "2021-06-11T20:37:44Z", "author_association": "OWNER", "body": "From the prototype:\r\n```\r\n% sqlite-utils schema 24ways.db\r\nCREATE TABLE [articles] (\r\n [title] TEXT ,\r\n [contents] TEXT ,\r\n [year] TEXT ,\r\n [author] TEXT ,\r\n [author_slug] TEXT ,\r\n [published] TEXT ,\r\n [url] TEXT ,\r\n [topic] TEXT \r\n );\r\nCREATE VIRTUAL TABLE \"articles_fts\" USING FTS5 (\r\n title, author, contents,\r\n content=\"articles\"\r\n );\r\nCREATE TABLE 'articles_fts_data'(id INTEGER PRIMARY KEY, block BLOB);\r\nCREATE TABLE 'articles_fts_idx'(segid, term, pgno, PRIMARY KEY(segid, term)) WITHOUT ROWID;\r\nCREATE TABLE 'articles_fts_docsize'(id INTEGER PRIMARY KEY, sz BLOB);\r\nCREATE TABLE 'articles_fts_config'(k PRIMARY KEY, v) WITHOUT ROWID;\r\n% sqlite-utils schema 24ways.db | sqlite3 /tmp/boo.db\r\nError: near line 15: table 'articles_fts_data' already exists\r\nError: near line 16: table 'articles_fts_idx' already exists\r\nError: near line 17: table 'articles_fts_docsize' already exists\r\nError: near line 18: table 'articles_fts_config' already exists\r\n```\r\nThe problem here is that the `CREATE VIRTUAL TABLE \"articles_fts\"...` line causes those next four tables to be created - but that means that piping the output of this command into `sqlite3` in order to re-create those tables throws errors.\r\n\r\nI don't think this matters. I see this tool as more for introspection than for recreating table structures.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 919181559, "label": "db.schema property and sqlite-utils schema command"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/269#issuecomment-859940977", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/269", "id": 859940977, "node_id": "MDEyOklzc3VlQ29tbWVudDg1OTk0MDk3Nw==", "user": {"value": 4068, "label": "frafra"}, "created_at": "2021-06-11T22:33:08Z", "updated_at": "2021-06-11T22:33:08Z", "author_association": "NONE", "body": "`true` and `false` json values are cast to integer, which is not optimal.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 919250621, "label": "bool type not supported"}, "performed_via_github_app": null}