Skip to content

Commit

Permalink
Better help for sqlite-utils create-table
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed May 29, 2021
1 parent 9a8c6fa commit b3d11f5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Empty file removed docs/dogs.db
Empty file.
12 changes: 11 additions & 1 deletion sqlite_utils/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b3d11f5

Please sign in to comment.