Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sqlite-utils transform sub-command #164

Closed
simonw opened this issue Sep 22, 2020 · 4 comments
Closed

sqlite-utils transform sub-command #164

simonw opened this issue Sep 22, 2020 · 4 comments
Labels
cli-tool enhancement New feature or request
Milestone

Comments

@simonw
Copy link
Owner

simonw commented Sep 22, 2020

The .transform() method in #114 warrants an equivalent CLI tool.

@simonw simonw added the enhancement New feature or request label Sep 22, 2020
@simonw
Copy link
Owner Author

simonw commented Sep 22, 2020

Maybe something like this:

sqlite-utils transform mydb.db mytable -c age integer --rename age dog_age

@simonw
Copy link
Owner Author

simonw commented Sep 22, 2020

Documentation for the .transform() method #114 (now landed) is here: https://sqlite-utils.readthedocs.io/en/latest/python-api.html#transforming-a-table

@simonw simonw added this to the 2.20 milestone Sep 22, 2020
@simonw
Copy link
Owner Author

simonw commented Sep 22, 2020

Idea for CLI options:

--type age integer
--drop colname
--rename oldname newname
--not-null col
--not-null-false col
--pk new_id
--pk-none
--default col value
--default-none column
--drop-foreign-key col other_table other_column

@simonw
Copy link
Owner Author

simonw commented Sep 22, 2020

simonw added a commit that referenced this issue Sep 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli-tool enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant