{"html_url": "https://github.com/simonw/datasette/issues/2069#issuecomment-1537277919", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2069", "id": 1537277919, "node_id": "IC_kwDOBm6k_c5boP_f", "user": {"value": 31861128, "label": "yqlbu"}, "created_at": "2023-05-07T03:17:35Z", "updated_at": "2023-05-07T03:17:35Z", "author_association": "NONE", "body": "Some updates:\r\n\r\nI notice that there is an option in the CLI where we can explicitly set `immutable` mode when spinning up the server\r\n\r\n```console\r\nOptions:\r\n -i, --immutable PATH Database files to open in immutable mode\r\n```\r\n\r\nThen, the question is - how can I disable immutable mode in the deployed instance on Vercel?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1698865182, "label": "[BUG] Cannot insert new data to deployed instance"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/539#issuecomment-1537507394", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/539", "id": 1537507394, "node_id": "IC_kwDOCGYnMM5bpIBC", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-07T18:08:44Z", "updated_at": "2023-05-07T18:08:44Z", "author_association": "OWNER", "body": "Prototype:\r\n```diff\r\ndiff --git a/docs/cli-reference.rst b/docs/cli-reference.rst\r\nindex 153e5f9..c830518 100644\r\n--- a/docs/cli-reference.rst\r\n+++ b/docs/cli-reference.rst\r\n@@ -124,6 +124,7 @@ See :ref:`cli_query`.\r\n --json-cols Detect JSON cols and output them as JSON, not\r\n escaped strings\r\n -r, --raw Raw output, first column of first row\r\n+ --raw-lines Raw output, first column of each row\r\n -p, --param ... Named :parameters for SQL query\r\n --functions TEXT Python code defining one or more custom SQL\r\n functions\r\n@@ -192,6 +193,7 @@ See :ref:`cli_memory`.\r\n --json-cols Detect JSON cols and output them as JSON, not\r\n escaped strings\r\n -r, --raw Raw output, first column of first row\r\n+ --raw-lines Raw output, first column of each row\r\n -p, --param ... Named :parameters for SQL query\r\n --encoding TEXT Character encoding for CSV input, defaults to\r\n utf-8\r\ndiff --git a/sqlite_utils/cli.py b/sqlite_utils/cli.py\r\nindex d25b1df..da0e4b6 100644\r\n--- a/sqlite_utils/cli.py\r\n+++ b/sqlite_utils/cli.py\r\n@@ -1653,6 +1653,7 @@ def drop_view(path, view, ignore, load_extension):\r\n )\r\n @output_options\r\n @click.option(\"-r\", \"--raw\", is_flag=True, help=\"Raw output, first column of first row\")\r\n+@click.option(\"--raw-lines\", is_flag=True, help=\"Raw output, first column of each row\")\r\n @click.option(\r\n \"-p\",\r\n \"--param\",\r\n@@ -1677,6 +1678,7 @@ def query(\r\n fmt,\r\n json_cols,\r\n raw,\r\n+ raw_lines,\r\n param,\r\n load_extension,\r\n functions,\r\n@@ -1700,7 +1702,19 @@ def query(\r\n _register_functions(db, functions)\r\n \r\n _execute_query(\r\n- db, sql, param, raw, table, csv, tsv, no_headers, fmt, nl, arrays, json_cols\r\n+ db,\r\n+ sql,\r\n+ param,\r\n+ raw,\r\n+ raw_lines,\r\n+ table,\r\n+ csv,\r\n+ tsv,\r\n+ no_headers,\r\n+ fmt,\r\n+ nl,\r\n+ arrays,\r\n+ json_cols,\r\n )\r\n \r\n \r\n@@ -1728,6 +1742,7 @@ def query(\r\n )\r\n @output_options\r\n @click.option(\"-r\", \"--raw\", is_flag=True, help=\"Raw output, first column of first row\")\r\n+@click.option(\"--raw-lines\", is_flag=True, help=\"Raw output, first column of each row\")\r\n @click.option(\r\n \"-p\",\r\n \"--param\",\r\n@@ -1773,6 +1788,7 @@ def memory(\r\n fmt,\r\n json_cols,\r\n raw,\r\n+ raw_lines,\r\n param,\r\n encoding,\r\n no_detect_types,\r\n@@ -1879,12 +1895,36 @@ def memory(\r\n _register_functions(db, functions)\r\n \r\n _execute_query(\r\n- db, sql, param, raw, table, csv, tsv, no_headers, fmt, nl, arrays, json_cols\r\n+ db,\r\n+ sql,\r\n+ param,\r\n+ raw,\r\n+ raw_lines,\r\n+ table,\r\n+ csv,\r\n+ tsv,\r\n+ no_headers,\r\n+ fmt,\r\n+ nl,\r\n+ arrays,\r\n+ json_cols,\r\n )\r\n \r\n \r\n def _execute_query(\r\n- db, sql, param, raw, table, csv, tsv, no_headers, fmt, nl, arrays, json_cols\r\n+ db,\r\n+ sql,\r\n+ param,\r\n+ raw,\r\n+ raw_lines,\r\n+ table,\r\n+ csv,\r\n+ tsv,\r\n+ no_headers,\r\n+ fmt,\r\n+ nl,\r\n+ arrays,\r\n+ json_cols,\r\n ):\r\n with db.conn:\r\n try:\r\n@@ -1903,6 +1943,13 @@ def _execute_query(\r\n sys.stdout.buffer.write(data)\r\n else:\r\n sys.stdout.write(str(data))\r\n+ elif raw_lines:\r\n+ for row in cursor:\r\n+ data = row[0]\r\n+ if isinstance(data, bytes):\r\n+ sys.stdout.buffer.write(data + b\"\\n\")\r\n+ else:\r\n+ sys.stdout.write(str(data) + \"\\n\")\r\n elif fmt or table:\r\n print(\r\n tabulate.tabulate(\r\n```\r\nNeeds tests and more documentation.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1699174055, "label": "`--raw-lines` option, like `--raw` for multiple lines"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/539#issuecomment-1537507525", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/539", "id": 1537507525, "node_id": "IC_kwDOCGYnMM5bpIDF", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-07T18:09:09Z", "updated_at": "2023-05-07T18:09:09Z", "author_association": "OWNER", "body": "I'm tempted to upgrade `--raw` to do this instead, but that would be a breaking change.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1699174055, "label": "`--raw-lines` option, like `--raw` for multiple lines"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/539#issuecomment-1537507676", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/539", "id": 1537507676, "node_id": "IC_kwDOCGYnMM5bpIFc", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-07T18:09:43Z", "updated_at": "2023-05-07T18:09:54Z", "author_association": "OWNER", "body": "This worked:\r\n\r\n```bash\r\nsqlite-utils memory /tmp/books3.json:nl \\\r\n 'select name from books3' --raw-lines > titles.txt\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1699174055, "label": "`--raw-lines` option, like `--raw` for multiple lines"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/540#issuecomment-1537513653", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/540", "id": 1537513653, "node_id": "IC_kwDOCGYnMM5bpJi1", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-07T18:37:59Z", "updated_at": "2023-05-07T18:38:19Z", "author_association": "OWNER", "body": "Useful comment here:\r\n\r\n- https://github.com/urllib3/urllib3/issues/2168#issuecomment-1537360928\r\n\r\n> I faced the same issue. I switched to a different Python kernel (3.11.2) and it worked.", "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/540#issuecomment-1537513912", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/540", "id": 1537513912, "node_id": "IC_kwDOCGYnMM5bpJm4", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-07T18:39:29Z", "updated_at": "2023-05-07T18:39:29Z", "author_association": "OWNER", "body": "https://readthedocs.org/projects/sqlite-utils/builds/20513034/ said:\r\n\r\n> Problem in your project's configuration. Invalid \"python.version\": expected one of (2, 2.7, 3, 3.5, 3.6, 3.7, 3.8, pypy3.5), got 3.11", "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/540#issuecomment-1537514069", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/540", "id": 1537514069, "node_id": "IC_kwDOCGYnMM5bpJpV", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-07T18:40:18Z", "updated_at": "2023-05-07T18:40:18Z", "author_association": "OWNER", "body": "https://docs.readthedocs.io/en/stable/config-file/v2.html suggests:\r\n\r\n```yaml\r\nbuild:\r\n os: ubuntu-22.04\r\n tools:\r\n python: \"3.11\"\r\n```", "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/539#issuecomment-1537514610", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/539", "id": 1537514610, "node_id": "IC_kwDOCGYnMM5bpJxy", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-07T18:43:24Z", "updated_at": "2023-05-07T18:43:24Z", "author_association": "OWNER", "body": "Documentation:\r\n- https://sqlite-utils.datasette.io/en/latest/cli.html#returning-raw-data-such-as-binary-content\r\n- https://sqlite-utils.datasette.io/en/latest/cli-reference.html#query\r\n- https://sqlite-utils.datasette.io/en/latest/cli-reference.html#memory", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1699174055, "label": "`--raw-lines` option, like `--raw` for multiple lines"}, "performed_via_github_app": null}