You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Spun off from #24 - it would be useful if CLI users could create new tables (with explicit column types, not null rules and defaults) without having to insert an example record.
Be nice if you could do --fk colname and have it guess the rest, but I'm not sure how to do that with a CLI option - they need a fixed number of arguments so that they don't consume the next batch of options.
Activity
simonw commentedon Aug 31, 2019
Potential syntax:
simonw commentedon May 3, 2020
Copy the design for
--not-nulland--defaultfrom theinsertcommand:simonw commentedon May 3, 2020
Could take
--ignoreto ignore if table already exists, and--replaceto drop and replace it if it exists.Initial implementation of create-table command, refs #27
sqlite-utils create-table docs, plus doc unit test
simonw commentedon May 3, 2020
I need tests for what happens if table already exists, or if the user provides invalid column types.
simonw commentedon May 3, 2020
Supporting
--fk colname othertable othercolwould be neat too.simonw commentedon May 3, 2020
Be nice if you could do
--fk colnameand have it guess the rest, but I'm not sure how to do that with a CLI option - they need a fixed number of arguments so that they don't consume the next batch of options.simonw commentedon May 3, 2020
I'll stick with requiring all three fk arguments.
create-table --not-null, --default, --fk, refs #27
create-table --ignore and --replace, refs #27
Removed docs for feature I decided not to implement, refs #27
simonw commentedon May 3, 2020
Documentation: https://github.com/simonw/sqlite-utils/blob/78264b738cd72ffad6e5c32ede3f074f8aad0ca4/docs/cli.rst#creating-tables
Release 2.8, refs #27 and #107