Commit graph

382 commits

Author SHA1 Message Date
Simon Willison
dc3eb9c313 Correct handling of pragma foreign_keys for .transform() 2020-09-21 21:18:24 -07:00
Simon Willison
2628e4d676 Documentation for table.transform(), refs #114 2020-09-21 20:47:30 -07:00
Simon Willison
95bfe1c77c .transform(pk=None) to create rowid table 2020-09-21 20:39:05 -07:00
Simon Willison
1e05fb157d .transform(drop_foreign_keys=...), refs #114 2020-09-21 20:20:48 -07:00
Simon Willison
785c4a80a2 .transform(defaults=...) 2020-09-21 19:57:44 -07:00
Simon Willison
90258748b4 Fixed error when .transform(not_null=None) 2020-09-21 19:47:00 -07:00
Simon Willison
a29ba8cf34 .transform() can now alter NOT NULL 2020-09-21 19:40:38 -07:00
Simon Willison
99d931ed4a Applied Black 2020-09-21 19:24:51 -07:00
Simon Willison
fe7cb7e8aa Test for .transform() rowid table to id table 2020-09-21 19:22:23 -07:00
Simon Willison
7b8e7c4207 Also check that .transform() runs without exceptions 2020-09-21 19:18:15 -07:00
Simon Willison
9a6e7dab4d .transform() can now change the primary key 2020-09-21 19:15:43 -07:00
Simon Willison
2b5956690d @db.register_function decorator, closes #162 2020-09-21 17:32:42 -07:00
Simon Willison
59692895fd More .transform() tests 2020-09-21 16:58:02 -07:00
Simon Willison
b34c9b40c2 New, improved implementation of transform(), refs #114 2020-09-21 16:54:37 -07:00
Simon Willison
7b2d74b4f6 Tests are how I want this to work (currently fail) 2020-09-21 16:19:03 -07:00
Simon Willison
e3f3bea60a Rename transform_table to just transform, refs #114 2020-09-21 16:14:05 -07:00
Simon Willison
774e82d562 tests 2020-09-21 16:04:03 -07:00
Simon Willison
594504817c More work on transform 2020-09-21 16:02:47 -07:00
Simon Willison
ef882986d0 Release 2.19 2.19
Refs #112, #157, #160
2020-09-20 15:22:56 -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
ecb50c8f76 .enable_fts(..., replace=True) argument, closes #160 2020-09-20 15:05:46 -07:00
Simon Willison
3cc1944e53 sqlite-utils add-foreign-keys command, closes #157 2020-09-20 13:14:25 -07:00
Tom V
7805d53bcf
Fix accidental mega long line in docs (#158)
Thanks @tomviner
2020-09-15 23:21:42 -07:00
Simon Wiles
367082e787
Typos in tests (#156)
Thanks @simonwiles
2020-09-09 11:21:22 -07:00
Simon Willison
6be6126364 Release 2.18 2.18
Refs #145. #155
2020-09-08 16:37:28 -07:00
Simon Willison
32f1badfec Tracer example using print, refs #150 2020-09-08 16:27:55 -07:00
Simon Wiles
e6d202b742
Handle case where subsequent records (after first batch) include extra columns
Refs #145.

* Extract build_insert_queries_and_params
* Extract insert_chunk so it can be called recursively

Thanks, @simonwiles
2020-09-08 16:20:36 -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
9680a0291c 'Soundness check' is better 2020-09-08 15:24:39 -07:00
Simon Willison
64799df78b .optimize() no longer cleans up _docsize
This isn't necessary any more since the new .rebuild_fts()
method can achieve the same thing.

Refs #155, #153
2020-09-08 15:18:12 -07:00
Simon Willison
4c0f79398f table.rebuild_fts() method, refs #155 2020-09-08 15:09:25 -07:00
Simon Willison
deb2eb013f Release notes for 2.17 2.17 2020-09-07 15:08:12 -07:00
Simon Willison
f28cd4de6d
Release 2.17
Refs #144, #148, #149, #150, #151, #152, #153
2020-09-07 14:58:49 -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
3e87500e15 table.optimize() deletes junk docsize rows
Closes #153. Closes #149.
2020-09-07 14:16:13 -07:00
Simon Willison
c449064297 Additional tests for WAL mode
This should have been included in 2d2d724e32

Refs #132
2020-09-07 13:46:12 -07:00
Simon Willison
de10590344 recursive_triggers=on by default, closes #152
Refs #149
2020-09-07 13:45:06 -07:00
Simon Willison
e878f2a8fe Applied latest black 2020-09-07 12:45:54 -07:00
Simon Willison
59e3d4d171 Neater indentation for SQL used in schemas, closes #148 2020-09-07 11:12:45 -07:00
Simon Willison
0e62744da9
Correct import path for AlterError exception 2020-09-02 13:29:46 -07:00
Simon Willison
e0cd430e89
Docs for sqlite_utils.AlterError in add_foreign_keys() 2020-09-02 13:17:01 -07:00
Simon Willison
cbc22ef20c
Add numpy to the matrix, refs #144 2020-08-28 15:56:06 -07:00
Simon Willison
1a9dab86fe Release 2.16.1 2.16.1
Refs #139, #142, #143
2020-08-28 15:45:11 -07:00
Simon Willison
01c7784be5 CI is now GitHub Actions, closes #143 2020-08-28 15:41:29 -07:00
Simon Willison
d7d3f96286 Black now runs in GitHub actions, refs #143 2020-08-28 15:37:45 -07:00
Simon Willison
8c405965e9 GitHub Actions workflows, refs #143 2020-08-28 15:36:55 -07:00
Simon Willison
10c6fbc368 Applied Black 20.8b1, refs #142 2020-08-28 15:30:57 -07:00
Simon Wiles
947bb7626f
insert_all(..., alter=True) works for columns introduced after first 100 records
* Insert all columns for every chunk
* Update unit test to reflect new behaviour
* Test that exception is raised
* Update documentation

Closes #139. Thanks, Simon Wiles!
2020-08-28 15:30:13 -07:00
Simon Willison
ea87c2b943 Release 2.16 2.16
Refs #134, #135
2020-08-21 14:02:29 -07:00