mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-24 09:54:31 +02:00
str, int, bytes aliases for column types, closes #606
This commit is contained in:
parent
9286c1ba43
commit
88bd372205
5 changed files with 32 additions and 3 deletions
|
|
@ -60,6 +60,14 @@ It's often worth trying: --encoding=latin-1
|
|||
maximize_csv_field_size_limit()
|
||||
|
||||
|
||||
class CaseInsensitiveChoice(click.Choice):
|
||||
def __init__(self, choices):
|
||||
super().__init__([choice.lower() for choice in choices])
|
||||
|
||||
def convert(self, value, param, ctx):
|
||||
return super().convert(value.lower(), param, ctx)
|
||||
|
||||
|
||||
def output_options(fn):
|
||||
for decorator in reversed(
|
||||
(
|
||||
|
|
@ -412,7 +420,8 @@ def dump(path, load_extension):
|
|||
@click.argument(
|
||||
"col_type",
|
||||
type=click.Choice(
|
||||
["integer", "float", "blob", "text", "INTEGER", "FLOAT", "BLOB", "TEXT"]
|
||||
["integer", "int", "float", "text", "str", "blob", "bytes"],
|
||||
case_sensitive=False,
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue