issue_comments
4 rows where issue = 1699174055 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: created_at (date), updated_at (date)
issue 1
- `--raw-lines` option, like `--raw` for multiple lines · 4 ✖
id | html_url | issue_url | node_id | user | created_at | updated_at ▲ | author_association | body | reactions | issue | performed_via_github_app |
---|---|---|---|---|---|---|---|---|---|---|---|
1537514610 | https://github.com/simonw/sqlite-utils/issues/539#issuecomment-1537514610 | https://api.github.com/repos/simonw/sqlite-utils/issues/539 | IC_kwDOCGYnMM5bpJxy | simonw 9599 | 2023-05-07T18:43:24Z | 2023-05-07T18:43:24Z | OWNER | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
`--raw-lines` option, like `--raw` for multiple lines 1699174055 | ||
1537507676 | https://github.com/simonw/sqlite-utils/issues/539#issuecomment-1537507676 | https://api.github.com/repos/simonw/sqlite-utils/issues/539 | IC_kwDOCGYnMM5bpIFc | simonw 9599 | 2023-05-07T18:09:43Z | 2023-05-07T18:09:54Z | OWNER | This worked:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
`--raw-lines` option, like `--raw` for multiple lines 1699174055 | |
1537507525 | https://github.com/simonw/sqlite-utils/issues/539#issuecomment-1537507525 | https://api.github.com/repos/simonw/sqlite-utils/issues/539 | IC_kwDOCGYnMM5bpIDF | simonw 9599 | 2023-05-07T18:09:09Z | 2023-05-07T18:09:09Z | OWNER | I'm tempted to upgrade |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
`--raw-lines` option, like `--raw` for multiple lines 1699174055 | |
1537507394 | https://github.com/simonw/sqlite-utils/issues/539#issuecomment-1537507394 | https://api.github.com/repos/simonw/sqlite-utils/issues/539 | IC_kwDOCGYnMM5bpIBC | simonw 9599 | 2023-05-07T18:08:44Z | 2023-05-07T18:08:44Z | OWNER | Prototype:
@@ -1728,6 +1742,7 @@ def query( ) @output_options @click.option("-r", "--raw", is_flag=True, help="Raw output, first column of first row") +@click.option("--raw-lines", is_flag=True, help="Raw output, first column of each row") @click.option( "-p", "--param", @@ -1773,6 +1788,7 @@ def memory( fmt, json_cols, raw, + raw_lines, param, encoding, no_detect_types, @@ -1879,12 +1895,36 @@ def memory( _register_functions(db, functions)
def _execute_query( - db, sql, param, raw, table, csv, tsv, no_headers, fmt, nl, arrays, json_cols + db, + sql, + param, + raw, + raw_lines, + table, + csv, + tsv, + no_headers, + fmt, + nl, + arrays, + json_cols, ): with db.conn: try: @@ -1903,6 +1943,13 @@ def _execute_query( sys.stdout.buffer.write(data) else: sys.stdout.write(str(data)) + elif raw_lines: + for row in cursor: + data = row[0] + if isinstance(data, bytes): + sys.stdout.buffer.write(data + b"\n") + else: + sys.stdout.write(str(data) + "\n") elif fmt or table: print( tabulate.tabulate( ``` Needs tests and more documentation. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
`--raw-lines` option, like `--raw` for multiple lines 1699174055 |
Advanced export
JSON shape: default, array, newline-delimited, object
CREATE TABLE [issue_comments] ( [html_url] TEXT, [issue_url] TEXT, [id] INTEGER PRIMARY KEY, [node_id] TEXT, [user] INTEGER REFERENCES [users]([id]), [created_at] TEXT, [updated_at] TEXT, [author_association] TEXT, [body] TEXT, [reactions] TEXT, [issue] INTEGER REFERENCES [issues]([id]) , [performed_via_github_app] TEXT); CREATE INDEX [idx_issue_comments_issue] ON [issue_comments] ([issue]); CREATE INDEX [idx_issue_comments_user] ON [issue_comments] ([user]);
user 1