Commit graph

147 commits

Author SHA1 Message Date
Simon Willison
6c3f5e6479 Added --table and --fmt options for table output using tabulate 2019-02-23 22:45:17 -08:00
Simon Willison
dbf239e3fc hash_id= mechanism for setting ID using content hash, closes #13 2019-02-23 20:36:40 -08:00
Simon Willison
e615d22c55
Support for numpy types, closes #11 (#12) 2019-02-23 20:02:19 -08:00
Jeff Triplett
c5068a0972 📝 Updates my_database.py to my_database.db (#9) 2019-02-23 19:55:04 -08:00
Simon Willison
ca225b02c0 Prettier indentation for CREATE TABLE 2019-02-23 12:52:04 -08:00
Simon Willison
919415e4e9
Added LICENSE file 2019-02-23 09:16:57 -08:00
Simon Willison
463fd3c3f6
Bump copyright year 2019-02-22 22:08:14 -08:00
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