issue_comments: 501515609
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/24#issuecomment-501515609 | https://api.github.com/repos/simonw/sqlite-utils/issues/24 | 501515609 | MDEyOklzc3VlQ29tbWVudDUwMTUxNTYwOQ== | 9599 | 2019-06-13T01:40:12Z | 2019-06-13T01:40:47Z | OWNER | But what to do for creating a table? For the Python function I could do this: ```python db["cats"].create({ "id": int, "name": str, "score": int, "weight": float, }, pk="id", not_null={"weight"}, defaults={"score": 1}) ``` The CLI tool only every creates tables as a side-effect of a `sqlite-utils insert` or `sqlite-utils upsert`. I can have them accept optional arguments, `--not-null colname` and `--default colname value`: ``` echo '{"name": "Cleo", "age": 4, "score": 2}' | \ sqlite-utils insert dogs.db dogs - \ --not-null age \ --not-null name \ --default score 1 ``` | {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | 449818897 |