home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

6 rows where issue = 1786258502 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 6

issue 1

  • Table renaming: db.rename_table() and sqlite-utils rename-table · 6 ✖

author_association 1

  • OWNER 6
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
1646659809 https://github.com/simonw/sqlite-utils/issues/565#issuecomment-1646659809 https://api.github.com/repos/simonw/sqlite-utils/issues/565 IC_kwDOCGYnMM5iJgjh simonw 9599 2023-07-22T19:53:56Z 2023-07-22T19:53:56Z OWNER

CLI documentation:

  • https://sqlite-utils.datasette.io/en/latest/cli.html#renaming-a-table
  • https://sqlite-utils.datasette.io/en/latest/cli-reference.html#rename-table
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Table renaming: db.rename_table() and sqlite-utils rename-table 1786258502  
1646658978 https://github.com/simonw/sqlite-utils/issues/565#issuecomment-1646658978 https://api.github.com/repos/simonw/sqlite-utils/issues/565 IC_kwDOCGYnMM5iJgWi simonw 9599 2023-07-22T19:48:54Z 2023-07-22T19:48:54Z OWNER

Python method documentation: - https://sqlite-utils.datasette.io/en/latest/reference.html#sqlite_utils.db.Database.rename_table - https://sqlite-utils.datasette.io/en/latest/python-api.html#renaming-a-table

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Table renaming: db.rename_table() and sqlite-utils rename-table 1786258502  
1646657849 https://github.com/simonw/sqlite-utils/issues/565#issuecomment-1646657849 https://api.github.com/repos/simonw/sqlite-utils/issues/565 IC_kwDOCGYnMM5iJgE5 simonw 9599 2023-07-22T19:42:02Z 2023-07-22T19:42:02Z OWNER

Manually testing new rename-table command: $ sqlite-utils schema /tmp/f.db CREATE TABLE [foo] ( [id] INTEGER, [name] TEXT ); $ sqlite-utils rename-table /tmp/f.db bad-table hi Error: Table "bad-table" could not be renamed. no such table: bad-table $ sqlite-utils rename-table /tmp/f.db foo foo Error: Table "foo" could not be renamed. there is already another table or index with this name: foo $ sqlite-utils rename-table /tmp/f.db foo bar $ sqlite-utils schema /tmp/f.db CREATE TABLE "bar" ( [id] INTEGER, [name] TEXT );

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Table renaming: db.rename_table() and sqlite-utils rename-table 1786258502  
1646657324 https://github.com/simonw/sqlite-utils/issues/565#issuecomment-1646657324 https://api.github.com/repos/simonw/sqlite-utils/issues/565 IC_kwDOCGYnMM5iJf8s simonw 9599 2023-07-22T19:39:06Z 2023-07-22T19:39:06Z OWNER

Also need a design for an option for the .transform() method to indicate that the new table should be created with a new name without dropping the old one.

I think keep_table="name_of_table" is good for this.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Table renaming: db.rename_table() and sqlite-utils rename-table 1786258502  
1646656246 https://github.com/simonw/sqlite-utils/issues/565#issuecomment-1646656246 https://api.github.com/repos/simonw/sqlite-utils/issues/565 IC_kwDOCGYnMM5iJfr2 simonw 9599 2023-07-22T19:32:07Z 2023-07-22T19:32:07Z OWNER

Trying out a simple first implementation: ```pycon

from sqlite_utils import Database db = Database(memory=True, tracer=print) PRAGMA recursive_triggers=on; None db["foo"].insert({"id": 1}) select name from sqlite_master where type = 'view' None select name from sqlite_master where type = 'table' None select name from sqlite_master where type = 'view' None select name from sqlite_master where type = 'table' None select name from sqlite_master where type = 'view' None CREATE TABLE [foo] ( [id] INTEGER ); None select name from sqlite_master where type = 'view' None INSERT INTO [foo] ([id]) VALUES (?); [1] select name from sqlite_master where type = 'table' None select name from sqlite_master where type = 'table' None PRAGMA table_info([foo]) None

<Table foo (id)> >>> db.rename_table("foo", "baz") ALTER TABLE [foo] RENAME TO [baz] None >>> print(db.schema) select sql from sqlite_master where sql is not null None CREATE TABLE "baz" ( [id] INTEGER ); ```
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Table renaming: db.rename_table() and sqlite-utils rename-table 1786258502  
1618380888 https://github.com/simonw/sqlite-utils/issues/565#issuecomment-1618380888 https://api.github.com/repos/simonw/sqlite-utils/issues/565 IC_kwDOCGYnMM5gdohY simonw 9599 2023-07-03T14:09:11Z 2023-07-03T14:09:31Z OWNER

For the CLI:

bash sqlite-utils rename-table data.db old_table_name new_table_name

For the Python code, should it go on Table or on Database? ```python db["foo"].rename_table("bar")

db.rename_table("foo", "bar") ``` I think I like the second better, it's slightly more clear.

Also need a design for an option for the .transform() method to indicate that the new table should be created with a new name without dropping the old one.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Table renaming: db.rename_table() and sqlite-utils rename-table 1786258502  

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 49.788ms · About: github-to-sqlite
  • Sort ascending
  • Sort descending
  • Facet by this
  • Hide this column
  • Show all columns
  • Show not-blank rows