home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 1246978641

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions issue performed_via_github_app
https://github.com/simonw/sqlite-utils/issues/297#issuecomment-1246978641 https://api.github.com/repos/simonw/sqlite-utils/issues/297 1246978641 IC_kwDOCGYnMM5KU2JR 9599 2022-09-14T15:57:41Z 2022-09-14T15:57:41Z OWNER

One solution suggested on Discord: `` wget https://static.openfoodfacts.org/data/en.openfoodfacts.org.products.csv CREATE=curl -s -L https://gist.githubusercontent.com/CharlesNepote/80fb813a416ad445fdd6e4738b4c8156/raw/032af70de631ff1c4dd09d55360f242949dcc24f/create.sqlINDEX=curl -s -L https://gist.githubusercontent.com/CharlesNepote/80fb813a416ad445fdd6e4738b4c8156/raw/032af70de631ff1c4dd09d55360f242949dcc24f/index.sql` time sqlite3 products_new.db <<EOS / Optimisations. See: https://avi.im/blag/2021/fast-sqlite-inserts/ /; PRAGMA page_size = 32768; $CREATE .mode ascii .separator "\t" "\n" .import --skip 1 en.openfoodfacts.org.products.csv all $INDEX EOS

Converting empty to NULL for columns which are either FLOAT or INTEGER

time sqlite3 products.db ".schema all" | sed -nr 's/.[(.)] (INTEGER|FLOAT).*/\1/gp' | xargs -I % sqlite3 products.db -cmd "PRAGMA journal_mode=OFF;" "UPDATE [all] SET [%] = NULL WHERE [%] = '';" ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
944846776  
Powered by Datasette · Queries took 0.724ms · About: github-to-sqlite