Commit graph

90 commits

Author SHA1 Message Date
Simon Willison
1ffa40301d Releasing 0.12 0.12 2019-02-22 18:22:28 -08:00
Simon Willison
e3c0ed1b1a sqlite-utils tables now takes --counts, --columns, --csv, --nl 2019-02-22 18:12:53 -08:00
Simon Willison
11a9511d23 Updated README to reflect new query default subcommand 2019-02-22 17:53:48 -08:00
Simon Willison
c7dbb03a10 Added 'sqlite-utils rows db.db tablename' command 2019-02-22 17:52:17 -08:00
Simon Willison
f2ca48c0da Default command now executes queries, --csv or --json
I replaced the following commands:

    sqlite-utils json db.db "select * from table"
    sqlite-utils csv db.db "select * from table"

With a unified 'query' command, which is now set as the default:

    sqlite-utils db.db "select * from table"
    sqlite-utils db.db "select * from table" --csv
2019-02-22 17:40:21 -08:00
Simon Willison
3095f2e671 Added db[table].rows iterator 2019-02-21 21:29:50 -08:00
Simon Willison
62e1edeaf6 [] escaping for FTS columns 2019-02-21 20:17:58 -08:00
Simon Willison
fd1b6eb82d Help text for enable-fts and populate-fts 2019-02-07 21:25:26 -08:00
Simon Willison
c89b2df918 Fixed documentation typo 0.11 2019-02-07 21:23:50 -08:00
Simon Willison
6acfd456b0 Releasing 0.11 2019-02-07 21:22:13 -08:00
Simon Willison
3f8ef35b2a enable-fts and populate-fts CLI commands 2019-02-07 21:18:24 -08:00
Simon Willison
ac9311aaf5 Refactored insert and upsert to share the same options 2019-02-06 21:50:25 -08:00
Simon Willison
7c09a2e994 Release 0.10 0.10 2019-02-06 21:17:52 -08:00
Simon Willison
7aab60d876 Handle datetime.date and datetime.time 2019-02-06 21:15:08 -08:00
Simon Willison
441c131db5 Better --help text for insert command 2019-01-29 07:40:34 -08:00
Simon Willison
1843d55615 @cli.command(name="csv") instead of import csv as csv_std 2019-01-29 07:37:12 -08:00
Simon Willison
82f0f6076a sqlite-utils insert db.db foo - --csv
New option for efficiently inserting rows from a CSV.

Uses a generator so this will happily consume enormous CSV files without
needing to slurp the whole thing into memory first.
2019-01-29 07:28:12 -08:00
Simon Willison
79a0f9cc96 Releasing 0.9 0.9 2019-01-27 22:34:33 -08:00
Simon Willison
50589f8523 CLI insert tool now uses generators, closes #7
Also cleaned up the logic so we commit rows in batches too.
2019-01-27 22:26:45 -08:00
Simon Willison
f0afa5646b insert_all() now accepts generator, closes #7 2019-01-27 22:12:18 -08:00
Simon Willison
225cf7299f Docs example chaining --nl together 2019-01-27 18:28:02 -08:00
Simon Willison
a226076994 Fixed RST bug 2019-01-27 18:18:55 -08:00
Simon Willison
5309c5c775 sqlite-utils insert ... --nl option, closes #6 2019-01-27 18:17:38 -08:00
Simon Willison
57fc8ce55e Database() constructor works with pathlib.Path 2019-01-27 15:53:41 -08:00
Simon Willison
3f2e711a4b Refactored to use itertools
Found an itertools mechanism that works for iterating
through the current and next row in the cursor.
2019-01-26 10:59:01 -08:00
Simon Willison
ea17c63cc5 Tests for json returning single row 2019-01-26 10:59:01 -08:00
Simon Willison
3a944d0c07
Run Travis tests against Python 3.8-dev (#5) 2019-01-25 18:37:54 -08:00
Simon Willison
9a4d1ff0a2 Releasing 0.8.1 (just a better README) 0.8.1 2019-01-25 18:22:18 -08:00
Simon Willison
20a744fb5a More detailed README 2019-01-25 18:21:55 -08:00
Simon Willison
4e9045e5b0 Documentation typo 2019-01-25 18:19:15 -08:00
Simon Willison
3db4f08f19 Release 0.8 0.8 2019-01-25 18:13:29 -08:00
Simon Willison
5466c9745d sqlite-utils json dogs.db "select * from dogs" 2019-01-25 18:06:29 -08:00
Simon Willison
7689ca7229
Fixed RST formatting 2019-01-25 10:16:26 -08:00
Simon Willison
c83dd8a5eb sqlite-utils csv data.db "select ..." command 2019-01-25 07:50:20 -08:00
Simon Willison
6f54342570 Release 0.7 0.7 2019-01-24 23:20:49 -08:00
Simon Willison
9501ba4bf1 sqlite-utils table_names blah.db is now tables blah.db
Travis tests were failing because on OS X the command was this:

   sqlite-utils table_names blah.db

But in Travis CI the command was this:

   sqlite-utils table-names blah.db

Renaming it to tables fixes this inconsistency.
2019-01-24 23:04:52 -08:00
Simon Willison
42b2b4b785
Upgrade sqlite3 in Travis so we can test against FTS5
Using recipe from https://linuxhint.com/install-sqlite-ubuntu-linux-mint/
2019-01-24 22:54:32 -08:00
Simon Willison
ccb2a1e729 Try dist: xenial 2019-01-24 22:44:24 -08:00
Simon Willison
ad30ccea59 Try dist:trusty to see if that gives us FTS5 in Travis CI 2019-01-24 22:42:53 -08:00
Simon Willison
e9e1cb00c1 Release notes for 0.7 2019-01-24 22:39:21 -08:00
Simon Willison
ffc9f09a93 Re-arranged documentation index page 2019-01-24 21:23:24 -08:00
Simon Willison
b30f924c49 Implemented 'sqlite-utils upsert my.db tablename --pk=x' 2019-01-24 21:20:10 -08:00
Simon Willison
9e74289397 'sqlite-utils insert tablename file.json' command 2019-01-24 21:06:41 -08:00
Simon Willison
1c683076d3 Sanity check test for optimize --no-vacuum 2019-01-24 20:38:23 -08:00
Simon Willison
0a8194e730 sqlite-utils optimize command, .optimize() and .detect_fts() table methods 2019-01-24 20:35:51 -08:00
Simon Willison
015bd2a840 Test for .table_names(fts5=True) 2019-01-24 20:23:53 -08:00
Simon Willison
66fd63b119 Ability to list just FTS4 or FTS5 table names 2019-01-24 19:57:04 -08:00
Simon Willison
231224ba1a Added vacuum to CLI and Python API 2019-01-24 19:39:04 -08:00
Simon Willison
fd5829b27d First CLI command: sqlite-utils table_names test.db 2019-01-24 19:30:47 -08:00
Simon Willison
8437fe3091 Revert "No need to skip black under Python 3.7 any more"
It turns out the black tests still fail in Travis against that version.

This reverts commit d18687a30a.
2019-01-24 19:08:52 -08:00