Download SQLPro for Postgres App 2020.42 for free online at AppPure. Get SQLPro for Postgres for iOS - PostgreSQL database management latest version. SQLPro for Postgres is a advanced but lightweight PostgresSQL database client, allowing quick and simple access to Postgres servers. SQLPro for SQLite 2019-07-08 MacOS. SQLPro for SQLite is an advanced sqlite editor. It has an easy to navigate interface, with the ability to perform the most basic to advanced tasks.
2.22 (2020-10-16)¶
- New
--encoding
option for processing CSV and TSV files that use a non-utf-8 encoding, for both theinsert
andupdate
commands. (#182) - The
--load-extension
option is now available to many more commands. (#137) --load-extension=spatialite
can be used to load SpatiaLite from common installation locations, if it is available. (#136)- Tests now also run against Python 3.9. (#184)
- Passing
pk=['id']
now has the same effect as passingpk='id'
. (#181)
2.21 (2020-09-24)¶
table.extract()
andsqlite-utilsextract
now apply much, much faster - one example operation reduced from twelve minutes to just four seconds! (#172)sqlite-utilsextract
no longer shows a progress bar, because it's fast enough not to need one.- New
column_order=
option fortable.transform()
which can be used to alter the order of columns in a table. (#175) sqlite-utilstransform--column-order=
option (with a-o
shortcut) for changing column order. (#176)- The
table.transform(drop_foreign_keys=)
parameter and thesqlite-utilstransform--drop-foreign-key
option have changed. They now accept just the name of the column rather than requiring all three of the column, other table and other column. This is technically a backwards-incompatible change but I chose not to bump the major version number because the transform feature is so new. (#177) - The table
.disable_fts()
,.rebuild_fts()
,.delete()
,.delete_where()
and.add_missing_columns()
methods all nowreturnself
, which means they can be chained together with other table operations.
2.20 (2020-09-22)¶
Newblue dj suite not installed. This release introduces two key new capabilities: transform (#114) and extract (#42).
Transform¶
Propresenter 6 5 3. SQLite's ALTER TABLE has several documented limitations. The table.transform()
Python method and sqlite-utilstransform
CLI command work around these limitations using a pattern where a new table with the desired structure is created, data is copied over to it and the old table is then dropped and replaced by the new one.
You can use these tools to change column types, rename columns, drop columns, add and remove NOTNULL
and defaults, remove foreign key constraints and more. See the transforming tables (CLI) and transforming tables (Python library) documentation for full details of how to use them.
Extract¶
Sometimes a database table - especially one imported from a CSV file - will contain duplicate data. A Trees
table may include a Species
column with only a few dozen unique values, when the table itself contains thousands of rows.
The table.extract()
method and sqlite-utilsextract
commands can extract a column - or multiple columns - out into a separate lookup table, and set up a foreign key relationship from the original table.
The Python library extract() documentation describes how extraction works in detail, and Extracting columns into a separate table https://wars-torrent-how-do-i-control-alt-delete-on-a-mac.peatix.com. in the CLI documentation includes a detailed example.
Other changes¶
- The
@db.register_function
decorator can be used to quickly register Python functions as custom SQL functions, see Registering custom SQL functions. (#162) - The
table.rows_where()
method now accepts an optionalselect=
argument for specifying which columns should be selected, see Listing rows.
2.19 (2020-09-20)¶
- New
sqlite-utilsadd-foreign-keys
command for Adding multiple foreign keys at once. (#157) - New
table.enable_fts(.,replace=True)
argument for replacing an existing FTS table with a new configuration. (#160) - New
table.add_foreign_key(.,ignore=True)
argument for ignoring a foreign key if it already exists. (#112)
2.18 (2020-09-08)¶
table.rebuild_fts()
method for rebuilding a FTS index, see Rebuilding a full-text search table. (#155)sqlite-utilsrebuild-ftsdata.db
command for rebuilding FTS indexes across all tables, or just specific tables. (#155)table.optimize()
method no longer deletes junk rows from the*_fts_docsize
table. This was added in 2.17 but it turns out runningtable.rebuild_fts()
is a better solution to this problem.- Fixed a bug where rows with additional columns that are inserted after the first batch of records could cause an error due to breaking SQLite's maximum number of parameters. Thanks, Simon Wiles. (#145)
2.17 (2020-09-07)¶
This release handles a bug where replacing rows in FTS tables could result in growing numbers of unneccessary rows in the associated *_fts_docsize
table. (#149)
PRAGMArecursive_triggers=on
by default for all connections. You can turn it off withDatabase(recursive_triggers=False)
. (#152)table.optimize()
method now deletes unnecessary rows from the*_fts_docsize
table. (#153)- New tracer method for tracking underlying SQL queries, see Tracing queries. (#150)
- Neater indentation for schema SQL. (#148)
- Documentation for
sqlite_utils.AlterError
exception thrown by inadd_foreign_keys()
.
2.16.1 (2020-08-28)¶
insert_all(.,alter=True)
now works for columns introduced after the first 100 records. Thanks, Simon Wiles! (#139)- Continuous Integration is now powered by GitHub Actions. (#143)
2.16 (2020-08-21)¶
--load-extension
option forsqlite-utilsquery
for loading SQLite extensions. (#134)- New
sqlite_utils.utils.find_spatialite()
function for finding SpatiaLite in common locations. (#135)
2.15.1 (2020-08-12)¶
- Now available as a
sdist
package on PyPI in addition to a wheel. (#133)
2.15 (2020-08-10)¶
- New
db.enable_wal()
anddb.disable_wal()
methods for enabling and disabling Write-Ahead Logging for a database file - see WAL mode in the Python API documentation. - Also
sqlite-utilsenable-walfile.db
andsqlite-utilsdisable-walfile.db
commands for doing the same thing on the command-line, see WAL mode (CLI). (#132)
2.14 (2020-08-01)¶
- The insert-files command can now read from standard input:
catdog.jpg|sqlite-utilsinsert-filesdogs.dbpics---name=dog.jpg
. (#127) - You can now specify a full-text search tokenizer using the new
tokenize=
parameter to enable_fts(). This means you can enable Porter stemming on a table by runningdb['articles'].enable_fts(['headline','body'],tokenize='porter')
. (#130) - You can also set a custom tokenizer using the sqlite-utils enable-fts CLI command, via the new
--tokenize
option.
2.13 (2020-07-29)¶
memoryview
anduuid.UUID
objects are now supported.memoryview
objects will be stored usingBLOB
anduuid.UUID
objects will be stored usingTEXT
. (#128)
2.12 (2020-07-27)¶
The theme of this release is better tools for working with binary data. The new insert-files
command can be used to insert binary files directly into a database table, and other commands have been improved with better support for BLOB columns.
sqlite-utilsinsert-filesmy.dbgifs*.gif
can now insert the contents of files into a specified table. The columns in the table can be customized to include different pieces of metadata derived from the files. See Inserting binary data from files. (#122)--raw
option tosqlite-utilsquery
- for outputting just a single raw column value - see Returning raw data from a query, such as binary content. (#123)- JSON output now encodes BLOB values as special base64 obects - see Running queries and returning JSON. (#125)
- The same format of JSON base64 objects can now be used to insert binary data - see Inserting JSON data. (#126)
- The
sqlite-utilsquery
command can now accept named parameters, e.g.sqlite-utils:memory:'select:num*:num2'-pnum5-pnum26
- see Running queries and returning JSON. (#124)
2.11 (2020-07-08)¶
- New
--truncate
option tosqlite-utilsinsert
, andtruncate=True
argument to.insert_all()
. Thanks, Thomas Sibley. (#118) - The
sqlite-utilsquery
command now runs updates in a transaction. Thanks, Thomas Sibley. (#120)
2.10.1 (2020-06-23)¶
- Added documentation for the
table.pks
introspection property. (#116)
2.10 (2020-06-12)¶
- The
sqlite-utils
command now supports UPDATE/INSERT/DELETE in addition to SELECT. (#115)
2.9.1 (2020-05-11)¶
- Added custom project links to the PyPI listing.
2.9 (2020-05-10)¶
- New
sqlite-utilsdrop-table
command, see Dropping tables. (#111) - New
sqlite-utilsdrop-view
command, see Dropping views. - Python
decimal.Decimal
objects are now stored asFLOAT
. (#110)
2.8 (2020-05-03)¶
- New
sqlite-utilscreate-table
command, see Creating tables. (#27) - New
sqlite-utilscreate-view
command, see Creating views. (#107)
2.7.2 (2020-05-02)¶
db.create_view(.)
now has additional parametersignore=True
orreplace=True
, see Creating views. (#106)
2.7.1 (2020-05-01)¶
- New
sqlite-utilsviewsmy.db
command for listing views in a database, see Listing views. (#105) sqlite-utilstables
(andviews
) has a new--schema
option which outputs the table/view schema, see Listing tables. (#104)- Nested structures containing invalid JSON values (e.g. Python bytestrings) are now serialized using
repr()
instead of throwing an error. (#102)
2.7 (2020-04-17)¶
- New
columns=
argument for the.insert()
,.insert_all()
,.upsert()
and.upsert_all()
methods, for over-riding the auto-detected types for columns and specifying additional columns that should be added when the table is created. See Custom column order and column types. (#100)
2.6 (2020-04-15)¶
- New
table.rows_where(.,order_by='agedesc')
argument, see Listing rows. (#76)
2.5 (2020-04-12)¶
- Panda's Timestamp is now stored as a SQLite TEXT column. Thanks, b0b5h4rp13! (#96)
table.last_pk
is now only available for inserts or upserts of a single record. (#98)- New
Database(filepath,recreate=True)
parameter for deleting and recreating the database. (#97)
Sqlpro Windows 10
2.4.4 (2020-03-23)¶
- Fixed bug where columns with only null values were not correctly created. (#95)
2.4.3 (2020-03-23)¶
- Column type suggestion code is no longer confused by null values. (#94)
2.4.2 (2020-03-14)¶
table.column_dicts
now works with all column types - previously it would throw errors on types other thanTEXT
,BLOB
,INTEGER
orFLOAT
. (#92)- Documentation for
NotFoundError
thrown bytable.get(pk)
- see Retrieving a specific record.
2.4.1 (2020-03-01)¶
table.enable_fts()
now works with columns that contain spaces. (#90)
2.4 (2020-02-26)¶
table.disable_fts()
can now be used to remove FTS tables and triggers that were created usingtable.enable_fts(.)
. (#88)- The
sqlite-utilsdisable-fts
command can be used to remove FTS tables and triggers from the command-line. (#88) - Trying to create table columns with square braces ([ or ]) in the name now raises an error. (#86)
- Subclasses of
dict
,list
andtuple
are now detected as needing a JSON column. (#87)
2.3.1 (2020-02-10)¶
table.create_index()
now works for columns that contain spaces. (#85)
2.3 (2020-02-08)¶
table.exists()
is now a method, not a property. This was not a documented part of the API before so I'm considering this a non-breaking change. (#83)
2.2.1 (2020-02-06)¶
Fixed a bug where .upsert(.,hash_id='pk')
threw an error (#84).
2.2 (2020-02-01)¶
New feature: sqlite_utils.suggest_column_types([records])
returns the suggested column types for a list of records. See Suggesting column types. (#81).
This replaces the undocumented table.detect_column_types()
method.
2.1 (2020-01-30)¶
New feature: conversions={.}
can be passed to the .insert()
family of functions to specify SQL conversions that should be applied to values that are being inserted or updated. See Converting column values using SQL functions . (#77).
2.0.1 (2020-01-05)¶
The .upsert()
and .upsert_all()
methods now raise a sqlite_utils.db.PrimaryKeyRequired
exception if you call them without specifying the primary key column using pk=
(#73).
2.0 (2019-12-29)¶
Sqlpro For Sqlite Windows
This release changes the behaviour of upsert
. It's a breaking change, hence 2.0
.
The upsert
command-line utility and the .upsert()
and .upsert_all()
Python API methods have had their behaviour altered. They used to completely replace the affected records: now, they update the specified values on existing records but leave other columns unaffected.
See Upserting data using the Python API and Upserting data using the CLI for full details.
If you want the old behaviour - where records were completely replaced - you can use $sqlite-utilsinsert.--replace
on the command-line and .insert(.,replace=True)
and .insert_all(.,replace=True)
in the Python API. See Insert-replacing data using the Python API and Insert-replacing data using the CLI for more.
For full background on this change, see issue #66.
1.12.1 (2019-11-06)¶
Sqlpro For Mssql
- Fixed error thrown when
.insert_all()
and.upsert_all()
were called with empty lists (#52)
You can use these tools to change column types, rename columns, drop columns, add and remove NOTNULL
and defaults, remove foreign key constraints and more. See the transforming tables (CLI) and transforming tables (Python library) documentation for full details of how to use them.
Extract¶
Sometimes a database table - especially one imported from a CSV file - will contain duplicate data. A Trees
table may include a Species
column with only a few dozen unique values, when the table itself contains thousands of rows.
The table.extract()
method and sqlite-utilsextract
commands can extract a column - or multiple columns - out into a separate lookup table, and set up a foreign key relationship from the original table.
The Python library extract() documentation describes how extraction works in detail, and Extracting columns into a separate table https://wars-torrent-how-do-i-control-alt-delete-on-a-mac.peatix.com. in the CLI documentation includes a detailed example.
Other changes¶
- The
@db.register_function
decorator can be used to quickly register Python functions as custom SQL functions, see Registering custom SQL functions. (#162) - The
table.rows_where()
method now accepts an optionalselect=
argument for specifying which columns should be selected, see Listing rows.
2.19 (2020-09-20)¶
- New
sqlite-utilsadd-foreign-keys
command for Adding multiple foreign keys at once. (#157) - New
table.enable_fts(.,replace=True)
argument for replacing an existing FTS table with a new configuration. (#160) - New
table.add_foreign_key(.,ignore=True)
argument for ignoring a foreign key if it already exists. (#112)
2.18 (2020-09-08)¶
table.rebuild_fts()
method for rebuilding a FTS index, see Rebuilding a full-text search table. (#155)sqlite-utilsrebuild-ftsdata.db
command for rebuilding FTS indexes across all tables, or just specific tables. (#155)table.optimize()
method no longer deletes junk rows from the*_fts_docsize
table. This was added in 2.17 but it turns out runningtable.rebuild_fts()
is a better solution to this problem.- Fixed a bug where rows with additional columns that are inserted after the first batch of records could cause an error due to breaking SQLite's maximum number of parameters. Thanks, Simon Wiles. (#145)
2.17 (2020-09-07)¶
This release handles a bug where replacing rows in FTS tables could result in growing numbers of unneccessary rows in the associated *_fts_docsize
table. (#149)
PRAGMArecursive_triggers=on
by default for all connections. You can turn it off withDatabase(recursive_triggers=False)
. (#152)table.optimize()
method now deletes unnecessary rows from the*_fts_docsize
table. (#153)- New tracer method for tracking underlying SQL queries, see Tracing queries. (#150)
- Neater indentation for schema SQL. (#148)
- Documentation for
sqlite_utils.AlterError
exception thrown by inadd_foreign_keys()
.
2.16.1 (2020-08-28)¶
insert_all(.,alter=True)
now works for columns introduced after the first 100 records. Thanks, Simon Wiles! (#139)- Continuous Integration is now powered by GitHub Actions. (#143)
2.16 (2020-08-21)¶
--load-extension
option forsqlite-utilsquery
for loading SQLite extensions. (#134)- New
sqlite_utils.utils.find_spatialite()
function for finding SpatiaLite in common locations. (#135)
2.15.1 (2020-08-12)¶
- Now available as a
sdist
package on PyPI in addition to a wheel. (#133)
2.15 (2020-08-10)¶
- New
db.enable_wal()
anddb.disable_wal()
methods for enabling and disabling Write-Ahead Logging for a database file - see WAL mode in the Python API documentation. - Also
sqlite-utilsenable-walfile.db
andsqlite-utilsdisable-walfile.db
commands for doing the same thing on the command-line, see WAL mode (CLI). (#132)
2.14 (2020-08-01)¶
- The insert-files command can now read from standard input:
catdog.jpg|sqlite-utilsinsert-filesdogs.dbpics---name=dog.jpg
. (#127) - You can now specify a full-text search tokenizer using the new
tokenize=
parameter to enable_fts(). This means you can enable Porter stemming on a table by runningdb['articles'].enable_fts(['headline','body'],tokenize='porter')
. (#130) - You can also set a custom tokenizer using the sqlite-utils enable-fts CLI command, via the new
--tokenize
option.
2.13 (2020-07-29)¶
memoryview
anduuid.UUID
objects are now supported.memoryview
objects will be stored usingBLOB
anduuid.UUID
objects will be stored usingTEXT
. (#128)
2.12 (2020-07-27)¶
The theme of this release is better tools for working with binary data. The new insert-files
command can be used to insert binary files directly into a database table, and other commands have been improved with better support for BLOB columns.
sqlite-utilsinsert-filesmy.dbgifs*.gif
can now insert the contents of files into a specified table. The columns in the table can be customized to include different pieces of metadata derived from the files. See Inserting binary data from files. (#122)--raw
option tosqlite-utilsquery
- for outputting just a single raw column value - see Returning raw data from a query, such as binary content. (#123)- JSON output now encodes BLOB values as special base64 obects - see Running queries and returning JSON. (#125)
- The same format of JSON base64 objects can now be used to insert binary data - see Inserting JSON data. (#126)
- The
sqlite-utilsquery
command can now accept named parameters, e.g.sqlite-utils:memory:'select:num*:num2'-pnum5-pnum26
- see Running queries and returning JSON. (#124)
2.11 (2020-07-08)¶
- New
--truncate
option tosqlite-utilsinsert
, andtruncate=True
argument to.insert_all()
. Thanks, Thomas Sibley. (#118) - The
sqlite-utilsquery
command now runs updates in a transaction. Thanks, Thomas Sibley. (#120)
2.10.1 (2020-06-23)¶
- Added documentation for the
table.pks
introspection property. (#116)
2.10 (2020-06-12)¶
- The
sqlite-utils
command now supports UPDATE/INSERT/DELETE in addition to SELECT. (#115)
2.9.1 (2020-05-11)¶
- Added custom project links to the PyPI listing.
2.9 (2020-05-10)¶
- New
sqlite-utilsdrop-table
command, see Dropping tables. (#111) - New
sqlite-utilsdrop-view
command, see Dropping views. - Python
decimal.Decimal
objects are now stored asFLOAT
. (#110)
2.8 (2020-05-03)¶
- New
sqlite-utilscreate-table
command, see Creating tables. (#27) - New
sqlite-utilscreate-view
command, see Creating views. (#107)
2.7.2 (2020-05-02)¶
db.create_view(.)
now has additional parametersignore=True
orreplace=True
, see Creating views. (#106)
2.7.1 (2020-05-01)¶
- New
sqlite-utilsviewsmy.db
command for listing views in a database, see Listing views. (#105) sqlite-utilstables
(andviews
) has a new--schema
option which outputs the table/view schema, see Listing tables. (#104)- Nested structures containing invalid JSON values (e.g. Python bytestrings) are now serialized using
repr()
instead of throwing an error. (#102)
2.7 (2020-04-17)¶
- New
columns=
argument for the.insert()
,.insert_all()
,.upsert()
and.upsert_all()
methods, for over-riding the auto-detected types for columns and specifying additional columns that should be added when the table is created. See Custom column order and column types. (#100)
2.6 (2020-04-15)¶
- New
table.rows_where(.,order_by='agedesc')
argument, see Listing rows. (#76)
2.5 (2020-04-12)¶
- Panda's Timestamp is now stored as a SQLite TEXT column. Thanks, b0b5h4rp13! (#96)
table.last_pk
is now only available for inserts or upserts of a single record. (#98)- New
Database(filepath,recreate=True)
parameter for deleting and recreating the database. (#97)
Sqlpro Windows 10
2.4.4 (2020-03-23)¶
- Fixed bug where columns with only null values were not correctly created. (#95)
2.4.3 (2020-03-23)¶
- Column type suggestion code is no longer confused by null values. (#94)
2.4.2 (2020-03-14)¶
table.column_dicts
now works with all column types - previously it would throw errors on types other thanTEXT
,BLOB
,INTEGER
orFLOAT
. (#92)- Documentation for
NotFoundError
thrown bytable.get(pk)
- see Retrieving a specific record.
2.4.1 (2020-03-01)¶
table.enable_fts()
now works with columns that contain spaces. (#90)
2.4 (2020-02-26)¶
table.disable_fts()
can now be used to remove FTS tables and triggers that were created usingtable.enable_fts(.)
. (#88)- The
sqlite-utilsdisable-fts
command can be used to remove FTS tables and triggers from the command-line. (#88) - Trying to create table columns with square braces ([ or ]) in the name now raises an error. (#86)
- Subclasses of
dict
,list
andtuple
are now detected as needing a JSON column. (#87)
2.3.1 (2020-02-10)¶
table.create_index()
now works for columns that contain spaces. (#85)
2.3 (2020-02-08)¶
table.exists()
is now a method, not a property. This was not a documented part of the API before so I'm considering this a non-breaking change. (#83)
2.2.1 (2020-02-06)¶
Fixed a bug where .upsert(.,hash_id='pk')
threw an error (#84).
2.2 (2020-02-01)¶
New feature: sqlite_utils.suggest_column_types([records])
returns the suggested column types for a list of records. See Suggesting column types. (#81).
This replaces the undocumented table.detect_column_types()
method.
2.1 (2020-01-30)¶
New feature: conversions={.}
can be passed to the .insert()
family of functions to specify SQL conversions that should be applied to values that are being inserted or updated. See Converting column values using SQL functions . (#77).
2.0.1 (2020-01-05)¶
The .upsert()
and .upsert_all()
methods now raise a sqlite_utils.db.PrimaryKeyRequired
exception if you call them without specifying the primary key column using pk=
(#73).
2.0 (2019-12-29)¶
Sqlpro For Sqlite Windows
This release changes the behaviour of upsert
. It's a breaking change, hence 2.0
.
The upsert
command-line utility and the .upsert()
and .upsert_all()
Python API methods have had their behaviour altered. They used to completely replace the affected records: now, they update the specified values on existing records but leave other columns unaffected.
See Upserting data using the Python API and Upserting data using the CLI for full details.
If you want the old behaviour - where records were completely replaced - you can use $sqlite-utilsinsert.--replace
on the command-line and .insert(.,replace=True)
and .insert_all(.,replace=True)
in the Python API. See Insert-replacing data using the Python API and Insert-replacing data using the CLI for more.
For full background on this change, see issue #66.
1.12.1 (2019-11-06)¶
Sqlpro For Mssql
- Fixed error thrown when
.insert_all()
and.upsert_all()
were called with empty lists (#52)
1.12 (2019-11-04)¶
Python library utilities for deleting records (#62)
db['tablename'].delete(4)
to delete by primary key, see Deleting a specific recorddb['tablename'].delete_where('id>?',[3])
to delete by a where clause, see Deleting multiple records
1.11 (2019-09-02)¶
Option to create triggers to automatically keep FTS tables up-to-date with newly inserted, updated and deleted records. Medico 2 44 – professional karaoke software download. Thanks, Amjith Ramanujam! (#57)
sqlite-utilsenable-fts.--create-triggers
- see Configuring full-text search using the CLIdb['tablename'].enable_fts(.,create_triggers=True)
- see Configuring full-text search using the Python library- Support for introspecting triggers for a database or table - see Introspection (#59)
1.10 (2019-08-23)¶
Ability to introspect and run queries against views (#54) Zeker quran 1 1 0.
db.view_names()
method and anddb.views
property- Separate
View
andTable
classes, both subclassing newQueryable
class view.drop()
method
See Listing views.
1.9 (2019-08-04)¶
table.m2m(.)
method for creating many-to-many relationships: Working with many-to-many relationships (#23)
1.8 (2019-07-28)¶
table.update(pk,values)
method: Updating a specific record (#35)
1.7.1 (2019-07-28)¶
- Fixed bug where inserting records with 11 columns in a batch of 100 triggered a 'too many SQL variables' error (#50)
- Documentation and tests for
table.drop()
method: Dropping a table or view
1.7 (2019-07-24)¶
Support for lookup tables.
- New
table.lookup({.})
utility method for building and querying lookup tables - see Working with lookup tables (#44) - New
extracts=
table configuration option, see Populating lookup tables automatically during insert/upsert (#46) - Use pysqlite3 if it is available, otherwise use
sqlite3
from the standard library - Table options can now be passed to the new
db.table(name,**options)
factory function in addition to being passed toinsert_all(records,**options)
and friends - see Table configuration options - In-memory databases can now be created using
db=Database(memory=True)
1.6 (2019-07-18)¶
sqlite-utilsinsert
can now accept TSV data via the new--tsv
option (#41)
1.5 (2019-07-14)¶
- Support for compound primary keys (#36)
- Configure these using the CLI tool by passing
--pk
multiple times - In Python, pass a tuple of columns to the
pk=(.,.)
argument: Compound primary keys
- Configure these using the CLI tool by passing
- New
table.get()
method for retrieving a record by its primary key: Retrieving a specific record (#39)
1.4.1 (2019-07-14)¶
- Assorted minor documentation fixes: changes since 1.4
1.4 (2019-06-30)¶
- Added
sqlite-utilsindex-foreign-keys
command (docs) anddb.index_foreign_keys()
method (docs) (#33)
1.3 (2019-06-28)¶
- New mechanism for adding multiple foreign key constraints at once: db.add_foreign_keys() documentation (#31)
1.2.2 (2019-06-25)¶
- Fixed bug where
datetime.time
was not being handled correctly
1.2.1 (2019-06-20)¶
- Check the column exists before attempting to add a foreign key (#29)
1.2 (2019-06-12)¶
- Improved foreign key definitions: you no longer need to specify the
column
,other_table
ANDother_column
to define a foreign key - if you omit theother_table
orother_column
the script will attempt to guess the correct values by instrospecting the database. See Adding foreign key constraints for details. (#25) - Ability to set
NOTNULL
constraints andDEFAULT
values when creating tables (#24). Documentation: Setting defaults and not null constraints (Python API), Setting defaults and not null constraints (CLI) - Support for
not_null_default=X
/--not-null-default
for setting aNOTNULLDEFAULT'x'
when adding a new column. Documentation: Adding columns (Python API), Adding columns (CLI)
1.1 (2019-05-28)¶
- Support for
ignore=True
/--ignore
for ignoring inserted records if the primary key alread exists (#21) - documentation: Inserting data (Python API), Inserting data (CLI) - Ability to add a column that is a foreign key reference using
fk=.
/--fk
(#16) - documentation: Adding columns (Python API), Adding columns (CLI)
1.0.1 (2019-05-27)¶
sqlite-utilsrowsdata.dbtable--json-cols
- fixed bug where--json-cols
was not obeyed
1.0 (2019-05-24)¶
- Option to automatically add new columns if you attempt to insert or upsert data with extra fields:
sqlite-utilsinsert.--alter
- see Adding columns automatically with the sqlite-utils CLIdb['tablename'].insert(record,alter=True)
- see Adding columns automatically using the Python API
New
--json-cols
option for outputting nested JSON, see Nested JSON values
0.14 (2019-02-24)¶
- Ability to create unique indexes:
db['mytable'].create_index(['name'],unique=True)
db['mytable'].create_index(['name'],if_not_exists=True)
$sqlite-utilscreate-indexmydb.dbmytablecol1[col2.]
, see Creating indexestable.add_column(name,type)
method, see Adding columns$sqlite-utilsadd-columnmydb.dbmytablenameofcolumn
, see Adding columns (CLI)db['books'].add_foreign_key('author_id','authors','id')
, see Adding foreign key constraints$sqlite-utilsadd-foreign-keybooks.dbbooksauthor_idauthorsid
, see Adding foreign key constraints (CLI)- Improved (but backwards-incompatible)
foreign_keys=
argument to various methods, see Specifying foreign keys
0.13 (2019-02-23)¶
- New
--table
and--fmt
options can be used to output query results in a variety of visual table formats, see Running queries and outputting a table - New
hash_id=
argument can now be used for Setting an ID based on the hash of the row contents - Can now derive correct column types for numpy int, uint and float values
table.last_id
has been renamed totable.last_rowid
table.last_pk
now contains the last inserted primary key, ifpk=
was specified- Prettier indentation in the
CREATETABLE
generated schemas
0.12 (2019-02-22)¶
- Added
db[table].rows
iterator - see Listing rows - Replaced
sqlite-utilsjson
andsqlite-utilscsv
with a new default subcommand calledsqlite-utilsquery
which defaults to JSON and takes formatting options--nl
,--csv
and--no-headers
- see Running queries and returning JSON and Running queries and returning CSV - New
sqlite-utilsrowsdata.dbname-of-table
command, see Returning all rows in a table sqlite-utilstable
command now takes options--counts
and--columns
plus the standard output format options, see Listing tables
0.11 (2019-02-07)¶
New commands for enabling FTS against a table and columns:
See Configuring full-text search.
0.10 (2019-02-06)¶
Handle datetime.date
and datetime.time
values.
New option for efficiently inserting rows from a CSV:
0.9 (2019-01-27)¶
Improved support for newline-delimited JSON.
sqlite-utilsinsert
has two new command-line options:
--nl
means 'expect newline-delimited JSON'. This is an extremely efficient way of loading in large amounts of data, especially if you pipe it into standard input.--batch-size=1000
lets you increase the batch size (default is 100). A commit will be issued every X records. This also control how many initial records are considered when detecting the desired SQL table schema for the data.
In the Python API, the table.insert_all(.)
Pictorial 3 0 6 – non destructive photo editors. method can now accept a generator as well as a list of objects. This will be efficiently used to populate the table no matter how many records are produced by the generator.
The Database()
constructor can now accept a pathlib.Path
object in addition to a string or an existing SQLite connection object.
0.8 (2019-01-25)¶
Two new commands: sqlite-utilscsv
and sqlite-utilsjson
These commands execute a SQL query and return the results as CSV or JSON. See Running queries and returning CSV and Running queries and returning JSON for more details.
Sqlpro Sqlite
0.7 (2019-01-24)¶
This release implements the sqlite-utils
command-line tool with a number of useful subcommands.
sqlite-utilstablesdemo.db
lists the tables in the databasesqlite-utilstablesdemo.db--fts4
shows just the FTS4 tablessqlite-utilstablesdemo.db--fts5
shows just the FTS5 tablessqlite-utilsvacuumdemo.db
runs VACUUM against the databasesqlite-utilsoptimizedemo.db
runs OPTIMIZE against all FTS tables, then VACUUMsqlite-utilsoptimizedemo.db--no-vacuum
runs OPTIMIZE but skips VACUUM
The two most useful subcommands are upsert
and insert
, which allow you to ingest JSON files with one or more records in them, creating the corresponding table with the correct columns if it does not already exist. See Inserting JSON data for more details.
sqlite-utilsinsertdemo.dbdogsdogs.json--pk=id
inserts new records fromdogs.json
into thedogs
tablesqlite-utilsupsertdemo.dbdogsdogs.json--pk=id
upserts records, replacing any records with duplicate primary keys
Wave arts panorama 5 89. One backwards incompatible change: the db['table'].table_names
property is now a method:
db['table'].table_names()
returns a list of table namesdb['table'].table_names(fts4=True)
returns a list of just the FTS4 tablesdb['table'].table_names(fts5=True)
returns a list of just the FTS5 tables
A few other changes:
- Plenty of updated documentation, including full coverage of the new command-line tool
- Allow column names to be reserved words (use correct SQL escaping)
- Added automatic column support for bytes and datetime.datetime
0.6 (2018-08-12)¶
.enable_fts()
now takes optional argumentfts_version
, defaults toFTS5
. UseFTS4
if the version of SQLite bundled with your Python does not support FTS5- New optional
column_order=
argument to.insert()
and friends for providing a partial or full desired order of the columns when a database table is created - New documentation for
.insert_all()
and.upsert()
and.upsert_all()
0.5 (2018-08-05)¶
db.tables
anddb.table_names
introspection propertiesdb.indexes
property for introspecting indexestable.create_index(columns,index_name)
methoddb.create_view(name,sql)
method- Table methods can now be chained, plus added
table.last_id
for accessing the last inserted row ID
0.4 (2018-07-31)¶
enable_fts()
,populate_fts()
andsearch()
table methods