-
-
Notifications
You must be signed in to change notification settings - Fork 115
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 convert" command to replace the separate "sqlite-transform" tool #251
Comments
Here's the full current implementation of that tool: https://github.com/simonw/sqlite-transform/blob/0.5/sqlite_transform/cli.py My current plan is to make this functionality available as the following:
|
Idea: enhance
The Maybe Would this overlap with #239 at all? |
This is a bit verbose - and having added New idea: ditch the sub-sub-commands and move the
or:
or |
Note that there's already a concept of db["example"].insert({
"name": "The Bigfoot Discovery Museum"
}, conversions={"name": "upper(?)"}) I think that's OK though - that's a Python library feature, |
Problem with the For @click.option(
"--dayfirst",
is_flag=True,
help="Assume day comes first in ambiguous dates, e.g. 03/04/05",
)
@click.option(
"--yearfirst",
is_flag=True,
help="Assume year comes first in ambiguous dates, e.g. 03/04/05",
) For @click.option("--delimiter", default=",", help="Delimiter to split on")
@click.option(
"--type",
type=click.Choice(("int", "float")),
help="Type to use for values - int or float (defaults to string)",
) |
Back to the design board then. One way to handle this would be the long-form:
I like the idea that An ugly solution would be to make all four of those options available on |
Or.... how about making the Then you could do something like this:
|
That's a pretty neat fix, though it's a bit more challenging on the documentation front - maybe the help text for |
I could stick them in a
|
In which case I think
One problem with this: we already accept one or more columns. I think that's OK though since the code is now a required argument, so it means we have to treat everything between the table and the final code argument as a column. |
Would make sense to accept code from standard input too:
|
I've started an implementation in the |
I'll finish the work on this in a PR. |
I'm going with |
See simonw/sqlite-transform#11 - I built a separate
sqlite-transform
tool a while ago that uses the word "transform" to means something entirely different fromsqlite-utils transform
- I'd like to resolve this by merging the two tools.The text was updated successfully, but these errors were encountered: