issue_comments
15 rows where issue = 1572766460 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: reactions, created_at (date), updated_at (date)
issue 1
- Transformation type `--type DATETIME` · 15 ✖
id | html_url | issue_url | node_id | user | created_at | updated_at ▲ | author_association | body | reactions | issue | performed_via_github_app |
---|---|---|---|---|---|---|---|---|---|---|---|
1422681850 | https://github.com/simonw/sqlite-utils/issues/524#issuecomment-1422681850 | https://api.github.com/repos/simonw/sqlite-utils/issues/524 | IC_kwDOCGYnMM5UzGb6 | 4l1fe 21095447 | 2023-02-08T14:25:50Z | 2023-02-08T14:29:09Z | NONE | I live the patch here for others: original code
!/usr/bin/python3-- coding: utf-8 --import re import sys from sqlite_utils.cli import cli if name == 'main': sys.argv[0] = re.sub(r'(-script.pyw|.exe)?$', '', sys.argv[0]) sys.exit(cli()) ``` patched/sqlite-utils.py ```python !/usr/bin/python3-- coding: utf-8 --import re import sys from sqlite_utils.cli import cli New importsfrom unittest.mock import patch from sqlite_utils.cli import VALID_COLUMN_TYPES if name == 'main':
# Choices of the option
``` And now it's working ```bash $ sqlite-utils schema events.sqlite cards.chunk.get CREATE TABLE "cards.chunk.get" ( [id] INTEGER PRIMARY KEY NOT NULL, [timestamp] TEXT, ) $ python patched/sqlite-utils.py transform events.sqlite cards.chunk.get --type timestamp DATETIME $ sqlite-utils schema events.sqlite cards.chunk.get CREATE TABLE "cards.chunk.get" ( [id] INTEGER PRIMARY KEY NOT NULL, [timestamp] DATETIME, ) ``` |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Transformation type `--type DATETIME` 1572766460 | |
1421177666 | https://github.com/simonw/sqlite-utils/issues/524#issuecomment-1421177666 | https://api.github.com/repos/simonw/sqlite-utils/issues/524 | IC_kwDOCGYnMM5UtXNC | 4l1fe 21095447 | 2023-02-07T17:39:00Z | 2023-02-07T17:39:00Z | NONE |
I've got your concern. Let's see if we will be replied on it and i'll close the issue some later. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Transformation type `--type DATETIME` 1572766460 | |
1421081939 | https://github.com/simonw/sqlite-utils/issues/524#issuecomment-1421081939 | https://api.github.com/repos/simonw/sqlite-utils/issues/524 | IC_kwDOCGYnMM5Us_1T | cldellow 193185 | 2023-02-07T16:42:25Z | 2023-02-07T16:43:42Z | NONE | Ha, yes, I might end up making something very niche. That's OK. I'm building a UI for Datasette that lets users make schema changes, so it's important to me that the tool work in a non-surprising way -- if you ask for a column of type X, you should get type X. If the column or table previously had CHECK constraints, they shouldn't be silently removed. And so on. I had hoped that I could just lean on sqlite-utils, but I think it's a little too surprising. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Transformation type `--type DATETIME` 1572766460 | |
1421055590 | https://github.com/simonw/sqlite-utils/issues/524#issuecomment-1421055590 | https://api.github.com/repos/simonw/sqlite-utils/issues/524 | IC_kwDOCGYnMM5Us5Zm | 4l1fe 21095447 | 2023-02-07T16:25:31Z | 2023-02-07T16:25:31Z | NONE |
And thank you for pointing me to it. At least, i can make a monkey patch for my need... |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Transformation type `--type DATETIME` 1572766460 | |
1421052195 | https://github.com/simonw/sqlite-utils/issues/524#issuecomment-1421052195 | https://api.github.com/repos/simonw/sqlite-utils/issues/524 | IC_kwDOCGYnMM5Us4kj | 4l1fe 21095447 | 2023-02-07T16:23:17Z | 2023-02-07T16:23:57Z | NONE | Isn't your suggestion too fundamental for the utility? The bigger flexibility, the bigger complexity. Your idea make sense defenitely, but how often do you make schema changes? And how many people could benefit from it, what do you think? |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Transformation type `--type DATETIME` 1572766460 | |
1421033725 | https://github.com/simonw/sqlite-utils/issues/524#issuecomment-1421033725 | https://api.github.com/repos/simonw/sqlite-utils/issues/524 | IC_kwDOCGYnMM5Us0D9 | cldellow 193185 | 2023-02-07T16:12:13Z | 2023-02-07T16:12:13Z | NONE | I think the bigger issue is that That might be a design choice to make it accessible to users by providing a reasonable set of defaults, but it doesn't quite fit my use case. It might make sense to extract a separate library that provides just the mechanisms, and then That would be a very big change, though. I might take a stab at extracting the library, but just for the table schema migration piece, not all the other features that Part of my motivation is that I want to provide some other abilities, too, like support for CHECK constraints. I see that the issue in this repo (https://github.com/simonw/sqlite-utils/issues/358) proposes a bunch of short-hand constraints, which I wouldn't want to accidentally expose to people -- I want a layer that is a 1:1 mapping to SQLite. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Transformation type `--type DATETIME` 1572766460 | |
1421022917 | https://github.com/simonw/sqlite-utils/issues/524#issuecomment-1421022917 | https://api.github.com/repos/simonw/sqlite-utils/issues/524 | IC_kwDOCGYnMM5UsxbF | 4l1fe 21095447 | 2023-02-07T16:06:03Z | 2023-02-07T16:08:58Z | NONE |
I don't see a clean solution, only extending code with a side variable that tells us we want to apply advanced types instead of basic. it could be a similiar command like But this way looks a bad design, too messy. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Transformation type `--type DATETIME` 1572766460 | |
1420992261 | https://github.com/simonw/sqlite-utils/issues/524#issuecomment-1420992261 | https://api.github.com/repos/simonw/sqlite-utils/issues/524 | IC_kwDOCGYnMM5Usp8F | cldellow 193185 | 2023-02-07T15:45:58Z | 2023-02-07T15:45:58Z | NONE | I'd support that, but I'm not the author of this library. One challenge is that would be a breaking change. Do you see a way to enable it without affecting existing users or bumping the major version number? |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Transformation type `--type DATETIME` 1572766460 | |
1420966995 | https://github.com/simonw/sqlite-utils/issues/524#issuecomment-1420966995 | https://api.github.com/repos/simonw/sqlite-utils/issues/524 | IC_kwDOCGYnMM5UsjxT | 4l1fe 21095447 | 2023-02-07T15:29:28Z | 2023-02-07T15:29:28Z | NONE | I could, of course. Doest it worth bringing such the improvement to the library? |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Transformation type `--type DATETIME` 1572766460 | |
1420809773 | https://github.com/simonw/sqlite-utils/issues/524#issuecomment-1420809773 | https://api.github.com/repos/simonw/sqlite-utils/issues/524 | IC_kwDOCGYnMM5Ur9Yt | cldellow 193185 | 2023-02-07T13:53:01Z | 2023-02-07T13:53:01Z | NONE | Ah, it looks like that is controlled by this dict: https://github.com/simonw/sqlite-utils/blob/main/sqlite_utils/db.py#L178 I suspect you could overwrite the datetime entry to achieve what you want |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Transformation type `--type DATETIME` 1572766460 | |
1420496447 | https://github.com/simonw/sqlite-utils/issues/524#issuecomment-1420496447 | https://api.github.com/repos/simonw/sqlite-utils/issues/524 | IC_kwDOCGYnMM5Uqw4_ | 4l1fe 21095447 | 2023-02-07T09:57:38Z | 2023-02-07T09:57:38Z | NONE |
It works, but a column becomes ```python In [1]: import sqlite_utils In [2]: db = sqlite_utils.Database('events.sqlite') In [3]: table = db['cards.chunk.get'] In [4]: table.columns_dict Out[4]: {'id': int, 'timestamp': float, 'data_chunk_number': int, 'user_id': str, 'meta_duplication_source_id': int, 'context_sort_attribute': str, 'context_sort_order': str} In [5]: from datetime import datetime In [7]: table.transform(types={'timestamp': datetime}) In [8]: table.columns_dict Out[8]: {'id': int, 'timestamp': str, 'data_chunk_number': int, 'user_id': str, 'meta_duplication_source_id': int, 'context_sort_attribute': str, 'context_sort_order': str} ```
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Transformation type `--type DATETIME` 1572766460 | |
1419734229 | https://github.com/simonw/sqlite-utils/issues/524#issuecomment-1419734229 | https://api.github.com/repos/simonw/sqlite-utils/issues/524 | IC_kwDOCGYnMM5Un2zV | cldellow 193185 | 2023-02-06T20:53:28Z | 2023-02-06T21:16:29Z | NONE | I think it's not currently possible: sqlite-utils requires that it be one of IMO, this is a bit of friction and it would be nice if it was more permissive. SQLite permits developers to use any data type when creating a table. For example, this is a perfectly cromulent sqlite session that creates a table with columns of type ``` sqlite> create table foo(column1 baz, column2 bar); sqlite> .schema foo CREATE TABLE foo(column1 baz, column2 bar); sqlite> select * from pragma_table_info('foo'); cid name type notnull dflt_value pk 0 column1 baz 0 0 The idea is that the application developer will know what meaning to ascribe to those types. For example, I'm working on a plugin to Datasette. Dates are tricky to handle. If you have some existing rows, you can look at the values in them to know how a user is serializing the dates -- as an ISO 8601 string? An RFC 3339 string? With millisecond precision? With timezone offset? But if you don't yet have any rows, you have to guess. If the column is of type Perhaps there is an argument that sqlite-utils is trying to conform to SQLite's strict mode, and that is why it limits the choices. In strict mode, SQLite requires that the data type be one of |
{ "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Transformation type `--type DATETIME` 1572766460 | |
1419740776 | https://github.com/simonw/sqlite-utils/issues/524#issuecomment-1419740776 | https://api.github.com/repos/simonw/sqlite-utils/issues/524 | IC_kwDOCGYnMM5Un4Zo | cldellow 193185 | 2023-02-06T20:59:01Z | 2023-02-06T20:59:01Z | NONE | That said, it looks like the check is only enforced at the CLI level. If you use the API directly, I think it'll work. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Transformation type `--type DATETIME` 1572766460 | |
1419390560 | https://github.com/simonw/sqlite-utils/issues/524#issuecomment-1419390560 | https://api.github.com/repos/simonw/sqlite-utils/issues/524 | IC_kwDOCGYnMM5Umi5g | 4l1fe 21095447 | 2023-02-06T16:43:47Z | 2023-02-06T16:43:47Z | NONE |
That's correct. But my issue is about the application level libraries that, i suppose, have better data understanding if see a specific type such as I'm writing data with dataset i've mentioned. The lib changes its behavior depending on a type. I saw different behavior with types To be honest, i didn't dive into the details of why the behavior changes, but when i altered manually by other util a type of column to On the matter, can i achieve it with Sqlite Utils at the moment? |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Transformation type `--type DATETIME` 1572766460 | |
1419357290 | https://github.com/simonw/sqlite-utils/issues/524#issuecomment-1419357290 | https://api.github.com/repos/simonw/sqlite-utils/issues/524 | IC_kwDOCGYnMM5Umaxq | eyeseast 25778 | 2023-02-06T16:21:44Z | 2023-02-06T16:21:44Z | CONTRIBUTOR | SQLite doesn't have a native |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Transformation type `--type DATETIME` 1572766460 |
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 3