home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

7 rows where issue = 1855894222 sorted by updated_at descending

✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

user 1

  • simonw 7

issue 1

  • CLI equivalents to `transform(add_foreign_keys=)` · 7 ✖

author_association 1

  • OWNER 7
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
1683217284 https://github.com/simonw/sqlite-utils/issues/585#issuecomment-1683217284 https://api.github.com/repos/simonw/sqlite-utils/issues/585 IC_kwDOCGYnMM5kU9uE simonw 9599 2023-08-18T01:50:21Z 2023-08-18T01:50:21Z OWNER

And a test of the --sql option: bash sqlite-utils create-table /tmp/t.db places id integer name text country integer city integer continent integer --pk id sqlite-utils create-table /tmp/t.db country id integer name text sqlite-utils create-table /tmp/t.db city id integer name text sqlite-utils create-table /tmp/t.db continent id integer name text sqlite-utils transform /tmp/t.db places --add-foreign-key country country id --add-foreign-key continent continent id --sql Outputs: sql CREATE TABLE [places_new_6a705d2f5a13] ( [id] INTEGER PRIMARY KEY, [name] TEXT, [country] INTEGER REFERENCES [country]([id]), [city] INTEGER, [continent] INTEGER REFERENCES [continent]([id]) ); INSERT INTO [places_new_6a705d2f5a13] ([id], [name], [country], [city], [continent]) SELECT [id], [name], [country], [city], [continent] FROM [places]; DROP TABLE [places]; ALTER TABLE [places_new_6a705d2f5a13] RENAME TO [places];

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
CLI equivalents to `transform(add_foreign_keys=)` 1855894222  
1683212074 https://github.com/simonw/sqlite-utils/issues/585#issuecomment-1683212074 https://api.github.com/repos/simonw/sqlite-utils/issues/585 IC_kwDOCGYnMM5kU8cq simonw 9599 2023-08-18T01:43:54Z 2023-08-18T01:43:54Z OWNER

Some manual testing: bash sqlite-utils create-table /tmp/t.db places id integer name text country integer city integer continent integer --pk id sqlite-utils schema /tmp/t.db sql CREATE TABLE [places] ( [id] INTEGER PRIMARY KEY, [name] TEXT, [country] INTEGER, [city] INTEGER, [continent] INTEGER ); bash sqlite-utils create-table /tmp/t.db country id integer name text sqlite-utils create-table /tmp/t.db city id integer name text sqlite-utils create-table /tmp/t.db continent id integer name text sqlite-utils schema /tmp/t.db sql CREATE TABLE [places] ( [id] INTEGER PRIMARY KEY, [name] TEXT, [country] INTEGER, [city] INTEGER, [continent] INTEGER ); CREATE TABLE [country] ( [id] INTEGER, [name] TEXT ); CREATE TABLE [city] ( [id] INTEGER, [name] TEXT ); CREATE TABLE [continent] ( [id] INTEGER, [name] TEXT ); bash sqlite-utils transform /tmp/t.db places --add-foreign-key country country id --add-foreign-key continent continent id sqlite-utils schema /tmp/t.db sql CREATE TABLE [country] ( [id] INTEGER, [name] TEXT ); CREATE TABLE [city] ( [id] INTEGER, [name] TEXT ); CREATE TABLE [continent] ( [id] INTEGER, [name] TEXT ); CREATE TABLE "places" ( [id] INTEGER PRIMARY KEY, [name] TEXT, [country] INTEGER REFERENCES [country]([id]), [city] INTEGER, [continent] INTEGER REFERENCES [continent]([id]) ); bash sqlite-utils transform /tmp/t.db places --drop-foreign-key country sqlite-utils schema /tmp/t.db places sql CREATE TABLE "places" ( [id] INTEGER PRIMARY KEY, [name] TEXT, [country] INTEGER, [city] INTEGER, [continent] INTEGER REFERENCES [continent]([id]) )

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
CLI equivalents to `transform(add_foreign_keys=)` 1855894222  
1683201239 https://github.com/simonw/sqlite-utils/issues/585#issuecomment-1683201239 https://api.github.com/repos/simonw/sqlite-utils/issues/585 IC_kwDOCGYnMM5kU5zX simonw 9599 2023-08-18T01:30:46Z 2023-08-18T01:30:46Z OWNER

Help can now look like this: --drop-foreign-key TEXT Drop foreign key constraint for this column --add-foreign-key <TEXT TEXT TEXT>... Add a foreign key constraint from a column to another table with another column

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
CLI equivalents to `transform(add_foreign_keys=)` 1855894222  
1683200128 https://github.com/simonw/sqlite-utils/issues/585#issuecomment-1683200128 https://api.github.com/repos/simonw/sqlite-utils/issues/585 IC_kwDOCGYnMM5kU5iA simonw 9599 2023-08-18T01:29:00Z 2023-08-18T01:29:00Z OWNER

I'm not going to implement the foreign_keys= option that entirely replaces existing foreign keys - I'll just do a --add-foreign-key multi-option.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
CLI equivalents to `transform(add_foreign_keys=)` 1855894222  
1683198740 https://github.com/simonw/sqlite-utils/issues/585#issuecomment-1683198740 https://api.github.com/repos/simonw/sqlite-utils/issues/585 IC_kwDOCGYnMM5kU5MU simonw 9599 2023-08-18T01:26:47Z 2023-08-18T01:26:47Z OWNER

The only CLI feature that supports providing just the column name appears to be this: bash sqlite-utils add-foreign-key --help ``` Usage: sqlite-utils add-foreign-key [OPTIONS] PATH TABLE COLUMN [OTHER_TABLE] [OTHER_COLUMN]

Add a new foreign key constraint to an existing table

Example:

  sqlite-utils add-foreign-key my.db books author_id authors id

WARNING: Could corrupt your database! Back up your database file first. `` I can drop that WARNING now since I'm not writing tosqlite_master` any more.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
CLI equivalents to `transform(add_foreign_keys=)` 1855894222  
1683197882 https://github.com/simonw/sqlite-utils/issues/585#issuecomment-1683197882 https://api.github.com/repos/simonw/sqlite-utils/issues/585 IC_kwDOCGYnMM5kU4-6 simonw 9599 2023-08-18T01:25:53Z 2023-08-18T01:25:53Z OWNER

Probably most relevant here is this snippet from: bash sqlite-utils create-table --help --default <TEXT TEXT>... Default value that should be set for a column --fk <TEXT TEXT TEXT>... Column, other table, other column to set as a foreign key

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
CLI equivalents to `transform(add_foreign_keys=)` 1855894222  
1683195669 https://github.com/simonw/sqlite-utils/issues/585#issuecomment-1683195669 https://api.github.com/repos/simonw/sqlite-utils/issues/585 IC_kwDOCGYnMM5kU4cV simonw 9599 2023-08-18T01:24:57Z 2023-08-18T01:24:57Z OWNER

Currently: bash sqlite-utils transform --help ``` Usage: sqlite-utils transform [OPTIONS] PATH TABLE

Transform a table beyond the capabilities of ALTER TABLE

Example:

  sqlite-utils transform mydb.db mytable \
      --drop column1 \
      --rename column2 column_renamed

Options: --type <TEXT CHOICE>... Change column type to INTEGER, TEXT, FLOAT or BLOB --drop TEXT Drop this column --rename <TEXT TEXT>... Rename this column to X -o, --column-order TEXT Reorder columns --not-null TEXT Set this column to NOT NULL --not-null-false TEXT Remove NOT NULL from this column --pk TEXT Make this column the primary key --pk-none Remove primary key (convert to rowid table) --default <TEXT TEXT>... Set default value for this column --default-none TEXT Remove default from this column --drop-foreign-key TEXT Drop foreign key constraint for this column --sql Output SQL without executing it --load-extension TEXT Path to SQLite extension, with optional :entrypoint -h, --help Show this message and exit. ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
CLI equivalents to `transform(add_foreign_keys=)` 1855894222  

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

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]);
Powered by Datasette · Queries took 19.983ms · About: github-to-sqlite
  • Sort ascending
  • Sort descending
  • Facet by this
  • Hide this column
  • Show all columns
  • Show not-blank rows