Commit graph

206 commits

Author SHA1 Message Date
Simon Willison
9f47e8b9a4 Documentation for new upsert v.s insert-replace
Refs #66
2019-12-30 05:29:23 +00:00
Simon Willison
9262c3e7c0
Corrected Database(memory=True) documentation 2019-12-18 09:00:36 +00:00
Simon Willison
a0a65f9a64 Release 1.12 2019-11-04 08:28:52 -08:00
Simon Willison
169ea455fc Added table.delete_where(), closes #62 2019-11-04 08:18:06 -08:00
Simon Willison
19073d6d97 Added table.delete(pk) method, refs #62 2019-11-04 08:08:01 -08:00
Simon Willison
d5e1f8ac77 Release 1.11 2019-09-02 17:58:41 -07:00
Simon Willison
3a4dddaca2 Documentation for create-triggers, refs #57 2019-09-02 17:10:26 -07:00
Simon Willison
2ca63e3b2d
db.triggers and table.triggers introspection (#60)
Closes #59
2019-09-02 17:09:41 -07:00
Simon Willison
68a5cb1b8e
Corrected .table_views() -> .view_names() 2019-08-26 07:03:22 +02:00
Simon Willison
9faa982226
Ability to introspect and run queries against views (#55)
* db.views_names() method and and db.views property
* Separate View and Table classes, both subclassing new Queryable class
* view.drop() method
* Updated documentation
2019-08-23 15:19:41 +03:00
Simon Willison
0e7b461eb3
Fixed typo 2019-08-04 07:13:31 +03:00
Simon Willison
243bcaa1ac Documentation for .m2m() table method 2019-08-04 05:29:19 +03:00
Simon Willison
5986083746 Documentation for table.update() method 2019-07-28 18:03:44 +03:00
Simon Willison
535a5ea476 Documentation and tests for table.drop() method 2019-07-28 14:57:02 +03:00
Simon Willison
941d281aee
extracts= table parameter, closes #46 2019-07-23 10:00:42 -07:00
Simon Willison
5805024316
Implemented table.lookup(...), closes #44
* Add pk column if missing from insert
* Implemented table.lookup(...)
2019-07-23 06:06:59 -07:00
Simon Willison
034d498b31 Support Database(memory=True) for in-memory databases 2019-07-22 17:12:54 -07:00
Simon Willison
58db40d67c Better __repr__ for tables 2019-07-22 17:05:51 -07:00
Simon Willison
127a836054 Documented new table configuration options via .table() 2019-07-22 16:59:17 -07:00
Simon Willison
c65b67ca46
.get() method plus support for compound primary keys (#40)
* create_table now handles compound primary keys
* CLI now accepts multiple --pk for compound primary keys
* Docs for compound primary keys with CLI and Python library
* New .get() method plus documentation

Closes #36, closes #39
2019-07-14 21:28:51 -07:00
Simon Willison
f70e35c9bb Added table.rows_where(where, args) method 2019-07-14 11:58:40 -07:00
Simon Willison
ba6bd47f15 Typo fix 2019-07-14 09:25:57 -07:00
Simon Willison
fef96163d9
Minor markup cleanup 2019-07-09 04:55:04 -07:00
Simon Willison
5be66529a3
Fixed RST and Typo 2019-07-09 04:49:32 -07:00
Simon Willison
b0a2f897f4
Typo fix 2019-07-09 04:42:40 -07:00
Simon Willison
e8f887ef4a
sqlite-utils index-foreign-keys / db.index_foreign_keys()
Closes #33
2019-06-30 16:50:54 -07:00
Simon Willison
997d8758fc
db.add_foreign_keys() method
Closes #31
2019-06-28 23:27:38 -07:00
Simon Willison
362359da7e not_null= and defaults= arguments to various Python methods, refs #24 2019-06-12 23:10:07 -07:00
Simon Willison
07a10bdb2c foreign_keys=[...] can now detect tables and keys - closes #25 2019-06-12 22:32:26 -07:00
Simon Willison
d645032cfa add_foreign_key can now detect table and pk, refs #25 2019-06-12 21:51:09 -07:00
Simon Willison
2fed87da6e --not-null-default and not_null_default=, refs #24 2019-06-12 18:35:02 -07:00
Simon Willison
26b2cf3418 Changelog for 1.1 + docs for --ignore/ignore=True 2019-05-28 22:06:22 -07:00
Simon Willison
50e2f94b58 Ability to add a column that is a foreign key reference
Python API:

    db["dogs"].add_column("species_id", fk="species")
    # or
    db["dogs"].add_column("species_id", fk="species", fk_col="ref")

CLI:

    $ sqlite-utils add-column mydb.db dogs species_id --fk species
    # or
    $ sqlite-utils add-column mydb.db dogs species_id --fk species --fk-col ref

Closes #16
2019-05-28 21:54:43 -07:00
Simon Willison
1e28eeee8c
Fixed RST syntax bug 2019-05-27 22:25:03 -07:00
Simon Willison
eff52023c6 alter=True/--alter option to automatically add missing columns
Closes #18
2019-05-24 17:41:04 -07:00
Simon Willison
05317f5341 Release 0.14 2019-02-24 15:11:51 -08:00
Simon Willison
3cab079d3e add-column col_type now optional, defaults to str 2019-02-24 14:24:00 -08:00
Simon Willison
557dc3f9a7 Improved foreign_keys= argument, closes #17 2019-02-24 14:12:45 -08:00
Simon Willison
e1ca938aa1 table.add_foreign_key(column, other_table, other_column)
New mechanism for adding foreign key constraints to an existing SQLite
table.

SQLite ALTER TABLE does not support this out-of-the-box, so I instead
had to write some careful code that uses PRAGMA writable_schema = 1 to
directly modify the sqlite_master table.

Refs #2
2019-02-24 13:10:51 -08:00
Simon Willison
6d25f648ed add_column now accepts explicit SQLite types, refs #15 2019-02-24 11:49:31 -08:00
Simon Willison
dc2560879e table.add_column(name, type) method, refs #15 2019-02-24 11:40:26 -08:00
Simon Willison
7784b924a1 Added create_index(..., if_not_exists=True), refs #14 2019-02-24 10:46:44 -08:00
Simon Willison
0c6745b70f Whitespace fix 2019-02-24 10:42:27 -08:00
Simon Willison
e7ffbcdb36 Ability to create unique indexes, refs #14 2019-02-24 10:41:51 -08:00
Simon Willison
1b6025e8ab Release 0.13 2019-02-23 22:54:43 -08:00
Simon Willison
dbf239e3fc hash_id= mechanism for setting ID using content hash, closes #13 2019-02-23 20:36:40 -08:00
Jeff Triplett
c5068a0972 📝 Updates my_database.py to my_database.db (#9) 2019-02-23 19:55:04 -08:00
Simon Willison
1ffa40301d Releasing 0.12 2019-02-22 18:22:28 -08:00
Simon Willison
3095f2e671 Added db[table].rows iterator 2019-02-21 21:29:50 -08:00
Simon Willison
f0afa5646b insert_all() now accepts generator, closes #7 2019-01-27 22:12:18 -08:00