issue_comments
24 rows where author_association = "OWNER", "created_at" is on date 2021-06-16 and "updated_at" is on date 2021-06-16 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: issue_url, reactions, created_at (date), updated_at (date)
user 1
- simonw 24
id | html_url | issue_url | node_id | user | created_at | updated_at ▲ | author_association | body | reactions | issue | performed_via_github_app |
---|---|---|---|---|---|---|---|---|---|---|---|
862617165 | https://github.com/simonw/sqlite-utils/issues/275#issuecomment-862617165 | https://api.github.com/repos/simonw/sqlite-utils/issues/275 | MDEyOklzc3VlQ29tbWVudDg2MjYxNzE2NQ== | simonw 9599 | 2021-06-16T18:34:51Z | 2021-06-16T18:34:51Z | OWNER | Also use this: https://github.com/simonw/datasette/blob/83e9c8bc7585dcc62f200e37c2daefcd669ee05e/codecov.yml And add a badge, as seen on https://github.com/simonw/asgi-csrf |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Enable code coverage 922955697 | |
862605436 | https://github.com/simonw/sqlite-utils/pull/273#issuecomment-862605436 | https://api.github.com/repos/simonw/sqlite-utils/issues/273 | MDEyOklzc3VlQ29tbWVudDg2MjYwNTQzNg== | simonw 9599 | 2021-06-16T18:19:05Z | 2021-06-16T18:19:05Z | OWNER | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
sqlite-utils memory command for directly querying CSV/JSON data 922099793 | ||
862494864 | https://github.com/simonw/sqlite-utils/issues/267#issuecomment-862494864 | https://api.github.com/repos/simonw/sqlite-utils/issues/267 | MDEyOklzc3VlQ29tbWVudDg2MjQ5NDg2NA== | simonw 9599 | 2021-06-16T15:51:28Z | 2021-06-16T16:26:15Z | OWNER | I did add a slightly clumsy mechanism recently to help a bit here though: the More details in the issue for that feature: #240 The idea here is that if you want to call update you need the primary key for the row - so you can do this:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
row.update() or row.pk 915421499 | |
862495803 | https://github.com/simonw/sqlite-utils/issues/131#issuecomment-862495803 | https://api.github.com/repos/simonw/sqlite-utils/issues/131 | MDEyOklzc3VlQ29tbWVudDg2MjQ5NTgwMw== | simonw 9599 | 2021-06-16T15:52:33Z | 2021-06-16T15:52:33Z | OWNER | I like |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
sqlite-utils insert: options for column types 675753042 | |
862493179 | https://github.com/simonw/sqlite-utils/issues/267#issuecomment-862493179 | https://api.github.com/repos/simonw/sqlite-utils/issues/267 | MDEyOklzc3VlQ29tbWVudDg2MjQ5MzE3OQ== | simonw 9599 | 2021-06-16T15:49:13Z | 2021-06-16T15:49:13Z | OWNER | The big challenge here is that the rows returned by this library aren't objects, they are Python dictionaries - so adding methods to them isn't possible without changing the type that is returned by these methods. Part of the philosophy of the library is that it should make it as easy as possible to round-trip between Python dictionaries and SQLite table data, so I don't think adding methods like this is going to fit. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
row.update() or row.pk 915421499 | |
862491721 | https://github.com/simonw/sqlite-utils/issues/270#issuecomment-862491721 | https://api.github.com/repos/simonw/sqlite-utils/issues/270 | MDEyOklzc3VlQ29tbWVudDg2MjQ5MTcyMQ== | simonw 9599 | 2021-06-16T15:47:06Z | 2021-06-16T15:47:06Z | OWNER | SQLite doesn't have a JSON column type - it has JSON processing functions, but they operate against TEXT columns - so there's nothing I can do here unfortunately. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Cannot set type JSON 919314806 | |
862491016 | https://github.com/simonw/sqlite-utils/issues/272#issuecomment-862491016 | https://api.github.com/repos/simonw/sqlite-utils/issues/272 | MDEyOklzc3VlQ29tbWVudDg2MjQ5MTAxNg== | simonw 9599 | 2021-06-16T15:46:13Z | 2021-06-16T15:46:13Z | OWNER | Columns from data imported from CSV in this way is currently treated as |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Idea: import CSV to memory, run SQL, export in a single command 921878733 | |
862485408 | https://github.com/simonw/sqlite-utils/issues/272#issuecomment-862485408 | https://api.github.com/repos/simonw/sqlite-utils/issues/272 | MDEyOklzc3VlQ29tbWVudDg2MjQ4NTQwOA== | simonw 9599 | 2021-06-16T15:38:58Z | 2021-06-16T15:39:28Z | OWNER | Also And it helps emphasize that the file you are querying will be loaded into memory, so probably don't try this against a 1GB CSV file. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Idea: import CSV to memory, run SQL, export in a single command 921878733 | |
862484557 | https://github.com/simonw/sqlite-utils/issues/272#issuecomment-862484557 | https://api.github.com/repos/simonw/sqlite-utils/issues/272 | MDEyOklzc3VlQ29tbWVudDg2MjQ4NDU1Nw== | simonw 9599 | 2021-06-16T15:37:51Z | 2021-06-16T15:38:34Z | OWNER | I wonder if there's a better name for this than
I think |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Idea: import CSV to memory, run SQL, export in a single command 921878733 | |
862479704 | https://github.com/simonw/sqlite-utils/issues/272#issuecomment-862479704 | https://api.github.com/repos/simonw/sqlite-utils/issues/272 | MDEyOklzc3VlQ29tbWVudDg2MjQ3OTcwNA== | simonw 9599 | 2021-06-16T15:31:31Z | 2021-06-16T15:31:31Z | OWNER | Plus, could I make this change to |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Idea: import CSV to memory, run SQL, export in a single command 921878733 | |
862478881 | https://github.com/simonw/sqlite-utils/issues/272#issuecomment-862478881 | https://api.github.com/repos/simonw/sqlite-utils/issues/272 | MDEyOklzc3VlQ29tbWVudDg2MjQ3ODg4MQ== | simonw 9599 | 2021-06-16T15:30:24Z | 2021-06-16T15:30:24Z | OWNER | But... |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Idea: import CSV to memory, run SQL, export in a single command 921878733 | |
862475685 | https://github.com/simonw/sqlite-utils/issues/272#issuecomment-862475685 | https://api.github.com/repos/simonw/sqlite-utils/issues/272 | MDEyOklzc3VlQ29tbWVudDg2MjQ3NTY4NQ== | simonw 9599 | 2021-06-16T15:26:19Z | 2021-06-16T15:29:38Z | OWNER | Here's a radical idea: what if I combined The trick here would be to detect if the arguments passed on the command-line refer to SQLite databases or if they refer to CSV/JSON data that should be imported into temporary tables. Detecting a SQLite database file is actually really easy - they all start with the same binary string: ```pycon
So then what would the semantics of
The complexity here is definitely in the handling of a combination of SQLite database files and CSV filenames. Also, I'm not 100% sold on this as being better than having a separate |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Idea: import CSV to memory, run SQL, export in a single command 921878733 | |
862046009 | https://github.com/simonw/sqlite-utils/pull/273#issuecomment-862046009 | https://api.github.com/repos/simonw/sqlite-utils/issues/273 | MDEyOklzc3VlQ29tbWVudDg2MjA0NjAwOQ== | simonw 9599 | 2021-06-16T05:15:38Z | 2021-06-16T05:15:38Z | OWNER | I'm going to add a |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
sqlite-utils memory command for directly querying CSV/JSON data 922099793 | |
862045639 | https://github.com/simonw/sqlite-utils/pull/273#issuecomment-862045639 | https://api.github.com/repos/simonw/sqlite-utils/issues/273 | MDEyOklzc3VlQ29tbWVudDg2MjA0NTYzOQ== | simonw 9599 | 2021-06-16T05:14:38Z | 2021-06-16T05:14:38Z | OWNER | Can't share much code though since a bunch of that |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
sqlite-utils memory command for directly querying CSV/JSON data 922099793 | |
862045438 | https://github.com/simonw/sqlite-utils/pull/273#issuecomment-862045438 | https://api.github.com/repos/simonw/sqlite-utils/issues/273 | MDEyOklzc3VlQ29tbWVudDg2MjA0NTQzOA== | simonw 9599 | 2021-06-16T05:14:00Z | 2021-06-16T05:14:00Z | OWNER | I should probably refactor the CSV/JSON/loading stuff into a function in |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
sqlite-utils memory command for directly querying CSV/JSON data 922099793 | |
862043974 | https://github.com/simonw/sqlite-utils/pull/273#issuecomment-862043974 | https://api.github.com/repos/simonw/sqlite-utils/issues/273 | MDEyOklzc3VlQ29tbWVudDg2MjA0Mzk3NA== | simonw 9599 | 2021-06-16T05:10:12Z | 2021-06-16T05:10:12Z | OWNER | I can stop promoting |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
sqlite-utils memory command for directly querying CSV/JSON data 922099793 | |
862042110 | https://github.com/simonw/sqlite-utils/pull/273#issuecomment-862042110 | https://api.github.com/repos/simonw/sqlite-utils/issues/273 | MDEyOklzc3VlQ29tbWVudDg2MjA0MjExMA== | simonw 9599 | 2021-06-16T05:05:51Z | 2021-06-16T05:06:11Z | OWNER | Initial documentation is here: https://github.com/simonw/sqlite-utils/blob/c7234cae8336b8525034e8f917d82dd0699abd42/docs/cli.rst#running-queries-directly-against-csv-data It only talks about CSV at the moment - needs to be updated to mention JSON too once that is implemented. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
sqlite-utils memory command for directly querying CSV/JSON data 922099793 | |
862040971 | https://github.com/simonw/sqlite-utils/issues/272#issuecomment-862040971 | https://api.github.com/repos/simonw/sqlite-utils/issues/272 | MDEyOklzc3VlQ29tbWVudDg2MjA0MDk3MQ== | simonw 9599 | 2021-06-16T05:02:56Z | 2021-06-16T05:02:56Z | OWNER | Moving this to a PR. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Idea: import CSV to memory, run SQL, export in a single command 921878733 | |
862040906 | https://github.com/simonw/sqlite-utils/issues/272#issuecomment-862040906 | https://api.github.com/repos/simonw/sqlite-utils/issues/272 | MDEyOklzc3VlQ29tbWVudDg2MjA0MDkwNg== | simonw 9599 | 2021-06-16T05:02:47Z | 2021-06-16T05:02:47Z | OWNER | Got a prototype working!
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Idea: import CSV to memory, run SQL, export in a single command 921878733 | |
862018937 | https://github.com/simonw/sqlite-utils/issues/272#issuecomment-862018937 | https://api.github.com/repos/simonw/sqlite-utils/issues/272 | MDEyOklzc3VlQ29tbWVudDg2MjAxODkzNw== | simonw 9599 | 2021-06-16T03:59:28Z | 2021-06-16T04:00:05Z | OWNER | Mainly for debugging purposes it would be useful to be able to save the created in-memory database back to a file again later. This could be done with:
Can use Maybe instead (or as-well-as) offer |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Idea: import CSV to memory, run SQL, export in a single command 921878733 | |
861989987 | https://github.com/simonw/sqlite-utils/issues/272#issuecomment-861989987 | https://api.github.com/repos/simonw/sqlite-utils/issues/272 | MDEyOklzc3VlQ29tbWVudDg2MTk4OTk4Nw== | simonw 9599 | 2021-06-16T02:34:21Z | 2021-06-16T02:34:21Z | OWNER | The documentation already covers this
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Idea: import CSV to memory, run SQL, export in a single command 921878733 | |
861987651 | https://github.com/simonw/sqlite-utils/issues/272#issuecomment-861987651 | https://api.github.com/repos/simonw/sqlite-utils/issues/272 | MDEyOklzc3VlQ29tbWVudDg2MTk4NzY1MQ== | simonw 9599 | 2021-06-16T02:27:20Z | 2021-06-16T02:27:20Z | OWNER | Solution: |
{ "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Idea: import CSV to memory, run SQL, export in a single command 921878733 | |
861985944 | https://github.com/simonw/sqlite-utils/issues/272#issuecomment-861985944 | https://api.github.com/repos/simonw/sqlite-utils/issues/272 | MDEyOklzc3VlQ29tbWVudDg2MTk4NTk0NA== | simonw 9599 | 2021-06-16T02:22:52Z | 2021-06-16T02:22:52Z | OWNER | Another option: allow an optional
One catch: how to treat
That's fine for CSV, but what about TSV or JSON or nl-JSON? Maybe this:
Bit weird though. The alternative would be to support this:
But that's verbose compared to the version without the long |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Idea: import CSV to memory, run SQL, export in a single command 921878733 | |
861984707 | https://github.com/simonw/sqlite-utils/issues/272#issuecomment-861984707 | https://api.github.com/repos/simonw/sqlite-utils/issues/272 | MDEyOklzc3VlQ29tbWVudDg2MTk4NDcwNw== | simonw 9599 | 2021-06-16T02:19:48Z | 2021-06-16T02:19:48Z | OWNER | This is going to need to be a separate command, for relatively non-obvious reasons.
Is equivalent to this, because
But... this means that making the filename optional doesn't actually work - because then this is ambiguous:
So instead, I'm going to add a new sub-command. I'm currently thinking
I still think I need to use Another option: allow multiple arguments which are filenames, and use the extension (or sniff the content) to decide what to do with them:
This would require the last positional argument to always be a SQL query, and would treat all other positional arguments as files that should be imported into memory. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Idea: import CSV to memory, run SQL, export in a single command 921878733 |
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]);
issue 6