[
    {
        "role": "user",
        "content": "mysql%20client%20has%20%5Cx%20command%20so%20that%20rows%20print%20vertically.%20is%20there%20a%20similar%20.format%20command%20for%20sqlite3%3F"
    },
    {
        "role": "assistant",
        "content": "Yes \u2014 SQLite\u2019s CLI has a `.mode line` option that gives a similar vertical / per-column view to MySQL\u2019s `\\x` or `\\G`. ([database.guide](https://database.guide/display-sqlite-query-results-using-vertical-output/?utm_source=openai))\n\nHere\u2019s how to use it:\n\n---\n\n## \ud83d\udd0d How to print rows vertically in sqlite3\n\n1. Start the sqlite3 shell:\n\n   ```\n   sqlite3 mydatabase.db\n   ```\n\n2. Use the following commands:\n\n   ```\n   .mode line\n   SELECT * FROM my_table LIMIT 1;\n   ```\n\n   Output will look like:\n\n   ```\n     column1 = value1\n     column2 = value2\n     column3 = value3\n   ```\n\n   Each column/value pair is on its own line, broken down per row. ([database.guide](https://database.guide/display-sqlite-query-results-using-vertical-output/?utm_source=openai))\n\n---\n\n## \ud83d\udccb More on `.mode` options\n\n- `.mode list` \u2014 default; rows laid out horizontally with a separator (often `|`) ([database.guide](https://database.guide/display-sqlite-query-results-using-vertical-output/?utm_source=openai))  \n- `.mode column` \u2014 tabular format with aligned columns and headers ([sites.google.com](https://sites.google.com/site/mylearningsmyway/database/sqlite?utm_source=openai))  \n- `.mode table` \u2014 a prettier ASCII-art style table (if supported) ([reddit.com](https://www.reddit.com/r/cs50/comments/w697c4?utm_source=openai))  \n- `.mode html`, `.mode csv`, `.mode insert`, etc. for other formats. ([docs.h4rithd.com](https://docs.h4rithd.com/database/sqlite?utm_source=openai))  \n\n---\n\n## \u2705 Tips\n\n- To see column headers above the data, use `.headers on`. ([gist.github.com](https://gist.github.com/tasdikrahman/9e55add04e04272c24d0?utm_source=openai))  \n- You can make `.mode line` (or any mode) the default by putting it in a `~/.sqliterc` file. For example:\n\n  ```\n  .mode line\n  .headers on\n  ```\n\n  And then launch sqlite3 as usual; the settings will apply automatically. ([database.guide](https://database.guide/display-sqlite-query-results-using-vertical-output/?utm_source=openai))\n\n---\n\nIf you want, I can demo with a sample table or help you set up aliases/configs to switch between modes more easily."
    }
]