Simon Willison
d645032cfa
add_foreign_key can now detect table and pk, refs #25
2019-06-12 21:51:09 -07:00
Simon Willison
c2622ceabd
cd docs && make livehtml
...
Enabled make rule for sphinx-autobuild
2019-06-12 21:50:18 -07:00
Simon Willison
2fed87da6e
--not-null-default and not_null_default=, refs #24
2019-06-12 18:35:02 -07:00
Simon Willison
7a3041b1ad
Releasing 1.1
1.1
2019-05-28 22:12:03 -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
00c5a49a87
Option to ignore inserts if primary key exists already
...
Support for SQLite's INSERT OR IGNORE
In the API layer it looks like this:
fresh_db["test"].insert({"id": 1, "bar": 3}, ignore=True)
For the CLI layer it looks like this:
$ sqlite-utils insert data.db dogs dogs.json --ignore
Closes #21
2019-05-28 21:15:57 -07:00
Simon Willison
1e28eeee8c
Fixed RST syntax bug
2019-05-27 22:25:03 -07:00
Simon Willison
63953f56e7
Release 1.0.1
1.0.1
2019-05-27 17:50:28 -07:00
Simon Willison
cec8c3c482
sqlite-utils rows now obeys --json-cols
2019-05-27 17:47:59 -07:00
Simon Willison
092e1368ed
Fixed typo
2019-05-25 07:24:17 -07:00
Simon Willison
ee017cdbdd
Release notes for 1.0, closes #22
1.0
2019-05-24 18:06:38 -07:00
Simon Willison
251e473041
--json-cols option for outputting nested JSON, closes #20
2019-05-24 17:56:44 -07:00
Simon Willison
747ea5d6bc
Fixed help text for sqlite-utils enable-fts
...
Closes #19
2019-05-24 17:43:46 -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
8ab7dcb4f9
Update description, don't package tests/
2019-05-24 17:37:29 -07:00
Simon Willison
0b1af42ead
Link to my blog entry
2019-02-24 19:45:38 -08:00
Simon Willison
05317f5341
Release 0.14
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
f8d3b7cfe5
sqlite-utils add-foreign-key books.db books author_id authors id
...
Command for adding foreign keys to existing tables. Closes #2
2019-02-24 13:33: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
9756310408
Black
2019-02-24 12:59:46 -08:00
Simon Willison
33df260b38
Fix for CLI test
2019-02-24 12:12:59 -08:00
Simon Willison
0bc49e938e
'sqlite-utils add-column name type' command, closes #15
2019-02-24 12:04:33 -08:00
Simon Willison
05a85b358f
Don't assume -1 for error code
2019-02-24 11:50:56 -08:00
Simon Willison
6d25f648ed
add_column now accepts explicit SQLite types, refs #15
2019-02-24 11:49:31 -08:00
Simon Willison
c5286d2c66
Black formatting
2019-02-24 11:40:58 -08:00
Simon Willison
dc2560879e
table.add_column(name, type) method, refs #15
2019-02-24 11:40:26 -08:00
Simon Willison
8a5d0d80c3
sqlite-utils create-index command, closes #14
2019-02-24 11:11:21 -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
0.13
2019-02-23 22:54:43 -08:00
Simon Willison
10e3aab4c6
Fixed typo with last_pk
2019-02-23 22:49:54 -08:00
Simon Willison
6c3f5e6479
Added --table and --fmt options for table output using tabulate
2019-02-23 22:45:17 -08:00
Simon Willison
dbf239e3fc
hash_id= mechanism for setting ID using content hash, closes #13
2019-02-23 20:36:40 -08:00
Simon Willison
e615d22c55
Support for numpy types, closes #11 ( #12 )
2019-02-23 20:02:19 -08:00
Jeff Triplett
c5068a0972
📝 Updates my_database.py to my_database.db ( #9 )
2019-02-23 19:55:04 -08:00
Simon Willison
ca225b02c0
Prettier indentation for CREATE TABLE
2019-02-23 12:52:04 -08:00
Simon Willison
919415e4e9
Added LICENSE file
2019-02-23 09:16:57 -08:00
Simon Willison
463fd3c3f6
Bump copyright year
2019-02-22 22:08:14 -08:00
Simon Willison
1ffa40301d
Releasing 0.12
0.12
2019-02-22 18:22:28 -08:00
Simon Willison
e3c0ed1b1a
sqlite-utils tables now takes --counts, --columns, --csv, --nl
2019-02-22 18:12:53 -08:00
Simon Willison
11a9511d23
Updated README to reflect new query default subcommand
2019-02-22 17:53:48 -08:00
Simon Willison
c7dbb03a10
Added 'sqlite-utils rows db.db tablename' command
2019-02-22 17:52:17 -08:00
Simon Willison
f2ca48c0da
Default command now executes queries, --csv or --json
...
I replaced the following commands:
sqlite-utils json db.db "select * from table"
sqlite-utils csv db.db "select * from table"
With a unified 'query' command, which is now set as the default:
sqlite-utils db.db "select * from table"
sqlite-utils db.db "select * from table" --csv
2019-02-22 17:40:21 -08:00
Simon Willison
3095f2e671
Added db[table].rows iterator
2019-02-21 21:29:50 -08:00
Simon Willison
62e1edeaf6
[] escaping for FTS columns
2019-02-21 20:17:58 -08:00
Simon Willison
fd1b6eb82d
Help text for enable-fts and populate-fts
2019-02-07 21:25:26 -08:00