From 668e8c9fd1b0eab4000902e4226aeaae3860e802 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Fri, 28 May 2021 22:00:11 -0700 Subject: [PATCH] Better help for sqlite-utils create-table --- docs/dogs.db | 0 sqlite_utils/cli.py | 12 +++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) delete mode 100644 docs/dogs.db diff --git a/docs/dogs.db b/docs/dogs.db deleted file mode 100644 index e69de29..0000000 diff --git a/sqlite_utils/cli.py b/sqlite_utils/cli.py index 52de64a..68bd986 100644 --- a/sqlite_utils/cli.py +++ b/sqlite_utils/cli.py @@ -922,7 +922,17 @@ def upsert( def create_table( path, table, columns, pk, not_null, default, fk, ignore, replace, load_extension ): - "Add a table with the specified columns" + """ + Add a table with the specified columns. Columns should be specified using + name, type pairs, for example: + + \b + sqlite-utils create-table my.db people \\ + id integer \\ + name text \\ + height float \\ + photo blob --pk id + """ db = sqlite_utils.Database(path) _load_extensions(db, load_extension) if len(columns) % 2 == 1: