Commit graph

261 commits

Author SHA1 Message Date
Simon Willison
58b577279f table.create(..., replace=True / ignore = True) closes #568 2023-07-22 12:15:40 -07:00
Simon Willison
f5c63088e1
Use sqlean if available in environment (#560)
Closes #559
Closes #235

Refs https://github.com/simonw/llm/issues/60

- Uses `sqlean` in place of `sqlite3` if `sqlean.py` is installed
- Uses `sqlite-dump` if available and `conn.iterdump()` does not exist
- New `with db.ensure_autocommit_off()` method for ensuring autocommit is off, used by `enable_wal()` and `disable_wal()`.
2023-06-25 16:25:51 -07:00
Simon Willison
6027f3ea69 No need to show common values if everything is null
Closes #547
2023-05-21 10:19:16 -07:00
Simon Willison
d2a7b15b2b
Analyze tables options: --common-limit, --no-most, --no-least
Closes #544
2023-05-21 09:19:30 -07:00
Simon Willison
c764a9ee8f Avoid negative hashes in lambda names, refs #543 2023-05-08 15:12:39 -07:00
Simon Willison
eebd1a26ae Removed FunctionAlreadyRegistered error, refs #526, #525 2023-05-08 14:58:28 -07:00
Simon Willison
fca3ef8cf2 Applied Black, refs #526, #525 2023-05-08 14:54:24 -07:00
Martin Carpenter
02f5c4d69d
Support repeated calls to Table.convert()
* Test repeated calls to Table.convert()
* Register Table.convert() functions under their own `lambda_hash` name
* Raise exception on registering identical function names

Refs #525
2023-05-08 14:53:58 -07:00
rhoboro
6500fed8b2
Transform no longer breaks non-string default values
Closes #509
2023-05-08 14:13:36 -07:00
Scott Perry
39ef137e67
Support self-referencing FKs in create (#537) 2023-05-08 14:10:00 -07:00
Simon Willison
455c35b512 .convert(skip_false) option, refs #527 2023-05-08 13:52:21 -07:00
Simon Willison
2376c452a5 upsert_all() now works with not_null - refs #538 2023-05-08 12:24:19 -07:00
Simon Willison
92f77c3262 Ran against updated Black 2023-03-12 14:28:43 -07:00
Simon Willison
965ca0d5f5 Apply no_implicit_optional codemod, closes #512 2022-11-15 22:25:44 -08:00
Simon Willison
defa2974c6 jsonify_if_needed output of convert() functions, closes #495 2022-10-25 14:23:24 -07:00
Simon Willison
05e2bb85fc db.close() method, closes #504 2022-10-25 13:57:43 -07:00
Simon Willison
c5d7ec1dd7 Fix for mypy issue, refs #503 2022-10-25 13:21:37 -07:00
Simon Willison
7ca497a8f5 repr improvements, refs #503 2022-10-25 13:14:41 -07:00
Jacob Chapman
ecf1d40112
table.search_sql(include_rank=True) option (#480)
* search_sql add include_rank option
* add test
* add FTS4 test
* Apply Black

Thanks, @chapmanjacobd
2022-08-30 20:40:35 -07:00
Simon Willison
104f37fa4d
db[table].create(..., transform=True) and create-table --transform
Closes #467
2022-08-27 16:17:55 -07:00
Simon Willison
36ffcafb1a table.default_values property, closes #475
Refs #468
2022-08-27 15:42:58 -07:00
Forest Gregg
c5f8a2eb1a
in extract code, check equality witH IS instead of = for nulls (#455)
sqlite "IS" is equivalent to SQL "IS NOT DISTINCT FROM"

close #423
2022-08-27 07:45:03 -07:00
Simon Willison
b5e902fcb0 Applied Black 2022-07-28 08:13:47 -07:00
Simon Willison
573de14ab6 Improved docstring comments for Table class and db.table() 2022-07-27 17:28:46 -07:00
Simon Willison
1491b66dd7 register_function(name=...) argument, closes #458 2022-07-27 17:13:49 -07:00
Simon Willison
bfbe69646e Fixed incorrect register_function code example 2022-07-27 17:08:50 -07:00
Simon Willison
015c663464 Fixed lint errors, refs #454 2022-07-15 14:59:06 -07:00
Simon Willison
c710ade644 sqlite-utils duplicate command, closes #454, refs #449
Also made it so .duplicate() raises new NoTable exception rather than raising
an AssertionError if the source table does not exist.
2022-07-15 14:45:47 -07:00
Simon Willison
da030d49fd Documentation for .duplicate(), refs #449 2022-07-15 14:29:52 -07:00
David
b366e68deb
table.duplicate(new_table_name) feature, closes #449
Thanks, @davidleejy
2022-07-15 14:21:36 -07:00
Simon Willison
b8af3b96f5 Fix bug with detect_fts() and similar table names, closes #434 2022-06-14 16:24:06 -07:00
Simon Willison
1b09538bc6 where= and where_args= parameters to search() and search_sql()
Closes #441
2022-06-14 14:54:35 -07:00
Simon Willison
cbaad1f153 Removed unused sys import, refs #425 2022-04-13 15:40:57 -07:00
Simon Willison
0e60f3c80c Better error message if table has no columns, closes #424 2022-04-13 15:39:48 -07:00
Simon Willison
4433eafff7 Fix for register() on Python 3.7, refs #425 2022-04-13 15:35:57 -07:00
Simon Willison
6f3ae864f1 Better support check for deterministic=True, closes #425
Bug first discovered in #421
2022-04-13 15:31:37 -07:00
Simon Willison
433813612f Move sqls=[] closer to where it is populated 2022-03-11 13:44:07 -08:00
Simon Willison
6fd7c138e2 Fixed .transform() method which I broke in #413 2022-03-11 09:54:17 -08:00
Simon Willison
26e6d2622c Use :param x: for docstring comments, refs #413 2022-03-11 09:39:17 -08:00
Simon Willison
d25cdd37a3 db.sqlite_version property and fix for deterministic=True on SQLite 3.8.3
Closes #408
2022-03-01 16:37:53 -08:00
Simon Willison
521921b849 Fixed mypy error, refs #343 2022-03-01 16:05:11 -08:00
Simon Willison
931b1e1513 .insert(hash_id_columns=) parameter, closes #343 2022-03-01 16:00:51 -08:00
Simon Willison
4bc06a2437 memory_name= feature, closes #405 2022-02-15 17:23:11 -08:00
Simon Willison
aa24903113 Create table if_not_exists=True argument, closes #397 2022-02-05 17:28:53 -08:00
Chris Amico
ee11274fcb
New spatialite helper methods, closes #79
- db.init_spatialite()
- table.add_geometry_column()
- table.create_spatial_index()

Co-authored-by: Simon Willison <swillison@gmail.com>
2022-02-03 21:55:09 -08:00
Simon Willison
82ea42ffee Added missing docstring for db.supports_strict 2022-01-24 20:12:32 -08:00
Simon Willison
389cbd5792 delete_where(analyze=True), closes #378 2022-01-10 17:08:05 -08:00
Simon Willison
ab392157f7 analyze=True for insert_all/upsert_all, refs #378 2022-01-10 17:00:34 -08:00
Simon Willison
0d10402f7b table.create_index(..., analyze=True), refs #378 2022-01-10 12:00:24 -08:00
Simon Willison
541f64ddb0 db.analyze() and table.analyze() methods, refs #366 2022-01-10 11:48:38 -08:00