Commit graph

281 commits

Author SHA1 Message Date
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
Simon Willison
fa35cd9afb Loosen requirement versions 2019-01-24 19:06:30 -08:00
Simon Willison
d18687a30a No need to skip black under Python 3.7 any more 2019-01-24 19:02:30 -08:00
Simon Willison
228d595f7d Allow column names to be reserved words 2019-01-24 19:01:10 -08:00
Simon Willison
6ad9037c96 Added support for bytes and datetime.datetime 2019-01-24 18:59:21 -08:00
Simon Willison
8e2a313c1e Fixed failing FTS5 test, release as 0.6.1 0.6.1 2018-08-12 17:48:43 -07:00
Simon Willison
594b25ef9f Started a changelog, releasing 0.6 0.6 2018-08-12 17:46:22 -07:00
Simon Willison
d1209a2c45 Use FTS4 when running the tests
Because the version of sqlite3 running in Travis CI does not have FTS5
2018-08-12 17:33:13 -07:00
Simon Willison
9fdf2c169c Documented Database(filepath) and in-memory database creation 2018-08-12 17:31:02 -07:00
Simon Willison
fcc38b9ff2 Moved fixtures into conftest.py 2018-08-12 17:25:39 -07:00