Simon Willison
7d04565010
Remove rogue import, refs #226
2021-02-05 18:09:48 -08:00
Simon Willison
1b666f9315
--delimiter and --quotechar, closes #223
2021-02-05 17:34:47 -08:00
Simon Willison
b4f09146d3
table.has_counts_triggers property, refs #219
2021-01-03 12:41:24 -08:00
Simon Willison
c265541384
Shorter help summary for rebuild_fts
2021-01-03 12:22:07 -08:00
Simon Willison
1e38a16ea8
Nicer error message for invalid JSON insert, closes #206
2021-01-03 10:42:17 -08:00
Simon Willison
ce042ff1f0
'sqlite-utils enable-counts' command, closes #214
2021-01-02 20:26:39 -08:00
Simon Willison
3d041d34d5
Renamed db.escape() to db.quote() and documented it
...
Closes #217
2021-01-02 20:15:04 -08:00
Simon Willison
5b246d17a0
'sqlite-utils triggers' command, closes #218
2021-01-02 19:03:15 -08:00
Simon Willison
69a121e088
sqlite-utils analyze-tables command and table.analyze_column() method
...
Closes #207
2020-12-12 23:20:11 -08:00
Simon Willison
79109939c3
search --limit now defaults to everything, refs #192
2020-11-08 09:00:43 -08:00
Simon Willison
bce1872109
order= is now order_by=, refs #197
2020-11-06 16:43:33 -08:00
Simon Willison
6863dc2677
sqlite-utils rows -c, closes #200
2020-11-06 16:28:41 -08:00
Simon Willison
309ae84336
'-f' must now always be specified as '--fmt', refs #194
2020-11-06 16:19:04 -08:00
Simon Willison
afee15f04b
--tsv output option, closes #193
2020-11-06 16:09:42 -08:00
Simon Willison
63e2bdf18d
Added test for sqlite-utils search, refs #192
2020-11-06 15:40:42 -08:00
Simon Willison
de39e8db1e
Refactored to table.search_sql() method, added --limit
2020-11-06 10:30:41 -08:00
Simon Willison
2c00567aac
sqlite-utils search WIP, refs #192
2020-11-06 10:30:41 -08:00
Simon Willison
f99a236529
Progress bar for sqlite-utils insert command, closes #173
2020-10-27 11:16:02 -07:00
Simon Willison
21ff60e3b1
--load-extension= for many more commands, closes #137
...
Also added --load-extension=spatialite shortcut, closes #136
2020-10-16 12:14:22 -07:00
Simon Willison
2c541fac35
--encoding option for non-utf8 CSV/TSV, closes #182
2020-10-16 10:18:46 -07:00
Simon Willison
5a63b9e88c
Simplify drop-foreign-key, and drop_foreign_keys, closes #177
2020-09-24 09:19:07 -07:00
Simon Willison
d13c123100
sqlite-utils transform --column-order option, closes #176
2020-09-24 09:11:53 -07:00
Simon Willison
022cdd97a9
Much, much faster extract() implementation
...
Takes my test down from ten minutes to four seconds!
* Removed unnecessary update() optimization
* Added column_order= to .transform() and .transform_sql()
* Tests for reusing lookup table in extract()
Closes #172
2020-09-24 08:43:55 -07:00
Simon Willison
5c4d58d152
Progress bar for "sqlite-utils extract", closes #169
2020-09-22 17:02:29 -07:00
Simon Willison
55cf928f73
sqlite-utils extract, closes #42
2020-09-22 16:37:39 -07:00
Simon Willison
c755f2852d
Docstring for sqlite-utils transform
2020-09-22 15:50:12 -07:00
Simon Willison
752d261229
Implemented sqlite-utils transform command, closes #164
2020-09-22 00:47:58 -07:00
Simon Willison
e23eedb4ce
ignore=True argument for add_foreign_key, closes #112
...
Also --ignore for add-foreign-key command
Plus table.add_foreign_key(...) now returns self, allowing more chaining
2020-09-20 15:17:25 -07:00
Simon Willison
3cc1944e53
sqlite-utils add-foreign-keys command, closes #157
2020-09-20 13:14:25 -07:00
Simon Willison
176f4e0ef4
sqlite-utils rebuild-fts command, closes #155
2020-09-08 16:16:03 -07:00
Simon Willison
76548596a6
optimize command now accepts optional tables, refs #155
2020-09-08 15:34:55 -07:00
Simon Willison
cf2cb244fa
Tracer mechanism for showing underlying SQL queries
...
* Pass a tracer= function to Database constructor
* New db.tracer() contextmanager
* Neater SQL indentation, because tracer means it could be visible now
* New db.execute() and db.executescript() methods
Closes #150
2020-09-07 14:56:59 -07:00
Simon Willison
10c6fbc368
Applied Black 20.8b1, refs #142
2020-08-28 15:30:57 -07:00
Simon Willison
7e9aad7e1c
--load-extension option for sqlite-utils query, closes #134
2020-08-21 13:54:11 -07:00
Simon Willison
2d2d724e32
Tools for enabling and disabling WAL, closes #132
2020-08-10 11:59:21 -07:00
Simon Willison
57e4eb8e55
sqlite-utils populate-fts --tokenize= option, closes #130
2020-08-01 13:51:05 -07:00
Simon Willison
8fe1e6d1be
insert-files can now read from stdin, closes #127
2020-07-29 20:08:12 -07:00
Simon Willison
ebc802f7ff
sqlite-utils insert-files command, closes #122
2020-07-27 00:08:57 -07:00
Simon Willison
1a61a6d3d6
Ability to insert base64 binary data as JSON, closes #126
2020-07-26 20:59:34 -07:00
Simon Willison
814d4a7f90
-p for passing named params to query, closes #124
2020-07-26 20:53:51 -07:00
Simon Willison
20e543e9a4
Output binary columns as base64 in JSON, closes #125
2020-07-26 17:48:36 -07:00
Simon Willison
bc8409941f
--raw option, refs #123
2020-07-26 09:43:45 -07:00
Thomas Sibley
ae4593316c
Add insert --truncate option
...
Deletes all rows in the table (if it exists) before inserting new rows.
SQLite doesn't implement a TRUNCATE TABLE statement but does optimize an
unqualified DELETE FROM.
This can be handy if you want to refresh the entire contents of a table
but a) don't have a PK (so can't use --replace), b) don't want the table
to disappear (even briefly) for other connections, and c) have to handle
records that used to exist being deleted.
Ideally the replacement of rows would appear instantaneous to other
connections by putting the DELETE + INSERT in a transaction, but this is
very difficult without breaking other code as the current transaction
handling is inconsistent and non-systematic. There exists the
possibility for the DELETE to succeed but the INSERT to fail, leaving an
empty table. This is not much worse, however, than the current
possibility of one chunked INSERT succeeding and being committed while
the next chunked INSERT fails, leaving a partially complete operation.
2020-07-08 10:26:20 -07:00
Thomas Sibley
f8277d0fb9
sqlite-utils query can now run DML ( #120 )
...
* Failing test showing that DML in `sqlite-utils query` doesn't work
* Run `sqlite-utils query` in a transaction so that DML is committed
Thanks, @tsibley!
2020-07-07 22:14:04 -07:00
Simon Willison
03ee97d225
CLI now supports upsert/insert - closes #115
2020-06-12 10:40:53 -07:00
Simon Willison
98019e92d0
Ran black, refs #111
2020-05-10 18:26:16 -07:00
Simon Willison
4e9cb739c7
drop-table and drop-view commands, closes #111
2020-05-10 17:44:21 -07:00
Simon Willison
d16097231c
Added sqlite-utils create-view command, closes #107
2020-05-03 08:36:29 -07:00
Simon Willison
9f6085b4e4
create-table --ignore and --replace, refs #27
2020-05-03 08:24:39 -07:00
Simon Willison
4d5916075d
create-table --not-null, --default, --fk, refs #27
2020-05-03 08:09:00 -07:00