Commit Graph

119 Commits

Author SHA1 Message Date
Julien BLACHE
d05634fddd Print query execution time in milliseconds 2011-09-10 12:56:29 +02:00
Julien BLACHE
a2b7b811b8 Add query plan to DB profiling callback 2011-09-10 12:56:29 +02:00
Julien BLACHE
1909623d43 Run ANALYZE after DB startup 2011-09-10 12:56:29 +02:00
Peter Carmichael
3caae459be Add DB maintenance routines 2011-09-10 12:56:29 +02:00
Julien BLACHE
759cc55b0f Fix bad parameters in I_LAST index clause 2011-06-05 11:04:57 +02:00
Julien BLACHE
4f3635e354 Handle SQLITE_SCHEMA error in db_exec()
This happens under database load with many concurrent threads doing updates;
queries failing with SQLITE_SCHEMA at step time need to retried from scratch
until they succeeded or hit a best-effort limit of 5 retries.
2011-05-28 10:48:31 +02:00
Julien BLACHE
4594cc3d63 Enhance db_exec() error messages 2011-05-28 10:46:41 +02:00
Julien BLACHE
54c5314712 Handle empty files table when upgrading from schema v11 -> v12 2011-04-06 18:38:53 +02:00
Julien BLACHE
e5b4c1146e Handle database upgrade v11 -> v12 2011-03-24 19:23:08 +01:00
Julien BLACHE
9759eeba71 Remove database upgrade for schema version before 10 (v0.12) 2011-03-21 18:48:00 +01:00
Kai Elwert
cb9dc5ad7c Add COLLATE DAAP to all char-type fields
As a consequence, we can remove the explicit COLLATE DAAP from sort
clauses, index definitions and queries.
2011-03-21 18:48:00 +01:00
Kai Elwert
e226c38d4f Add db_query_fetch_string_sort() to fetch string+sortstring results 2011-03-21 18:48:00 +01:00
Kai Elwert
d8bf5eedce db_build_query_browse() query changes ("DISTINCT %s, %s", field, field) 2011-03-21 18:48:00 +01:00
Kai Elwert
9e5015ffc8 Switch sort clauses to *_sort fields 2011-03-21 18:47:59 +01:00
Kai Elwert
373c5584af Add sort tags to the database 2011-03-21 18:47:59 +01:00
Julien BLACHE
eeb5a7974d Trim metadata strings on files INSERT/UPDATE 2011-03-08 18:55:51 +01:00
Julien BLACHE
69396f3da0 Kill bogus comments 2011-03-07 19:51:43 +01:00
Julien BLACHE
6f7b12b1f2 Handle database upgrade v10 -> v11 2010-12-04 15:08:06 +01:00
Julien BLACHE
27c89cf312 Remove old db_config_* interface 2010-12-04 15:08:06 +01:00
Julien BLACHE
012e90b4a3 Add a dedicated table for speakers 2010-12-04 15:08:06 +01:00
Kai Elwert
e5af78fe9f Implement sort=artist for DAAP queries 2010-10-09 16:06:00 +02:00
Kai Elwert
cd8686be82 Add DB profiling support 2010-09-29 18:56:38 +02:00
Julien BLACHE
5c81144beb Revert to standard SQLite functions for DB startup, creation and upgrade
No need to use the blocking variants here as there is no concurrency during
DB startup.
2010-09-29 18:26:31 +02:00
Julien BLACHE
b79cf13c95 Remove custom collation and custom daap_songalbumid() function code 2010-09-28 18:39:43 +02:00
Julien BLACHE
da0011de3b Load our SQLite extension 2010-09-28 18:38:10 +02:00
Julien BLACHE
c6c53e6a28 Fix integer type mismatch in SQL query
sample_count is uint64, not int.
2010-09-10 20:58:10 +02:00
Julien BLACHE
e90e81cdf5 Remove no-op "OR REPLACE" 2010-09-04 11:38:15 +02:00
John Thomson
f50e17b60f Take disc number into account for track ordering inside albums 2010-09-04 11:33:30 +02:00
Kai Elwert
9dec6d23be Use DAAP collation in sort clauses 2010-08-29 12:07:07 +02:00
Kai Elwert
5dd58ea7a8 Use DAAP collation for browse queries 2010-08-29 12:07:07 +02:00
Kai Elwert
b5e3163d35 Use DAAP collation for group queries 2010-08-29 12:07:07 +02:00
Kai Elwert
f79dbc93cb Introduce DAAP-specific collation function for SQLite 2010-08-29 12:07:07 +02:00
Kai Elwert
1eec8e1a7b Modify groups query to group by album name and with COLLATE NOCASE 2010-08-14 11:58:21 +02:00
Kai Elwert
dce9eb8d1f Use COLLATE NOCASE for browse queries 2010-08-14 11:55:11 +02:00
Julien BLACHE
1d35afbe62 Fixup file modes 2010-08-06 17:27:56 +02:00
Julien BLACHE
5d69a8e34c Consolidate sort clauses 2010-08-05 18:28:02 +02:00
Kai Elwert
20486ee0dd Implement sorting for smart playlists queries
This will be used by the Title view in Remote.
2010-08-05 18:25:34 +02:00
Julien BLACHE
058e2e9b2b Add config variables save/test/clear for 64bit integer as hex string 2010-08-04 19:17:21 +02:00
Julien BLACHE
e396906fee Protect db_perthread_deinit() against NULL hdl 2010-07-17 14:41:11 +02:00
Julien BLACHE
35d6ac4cfa Add unicode_fixup_mfi() to check & reencode UTF-8 fields in struct media_file_info 2010-06-21 17:50:09 +02:00
Julien BLACHE
dc95a04562 Add optional sorting clause to Q_ITEMS 2010-05-02 11:44:43 +02:00
Julien BLACHE
4dc8f11887 Handle database upgrade v9 -> v10 2010-05-02 11:44:43 +02:00
Julien BLACHE
74cc5a7a13 Add config variables save/fetch for integer variables 2010-05-02 11:44:43 +02:00
Julien BLACHE
f696aa321e Fix error message in db_file_add() 2010-05-02 08:23:21 +02:00
Julien BLACHE
465c10ded3 Rework database version check to error out on newer databases 2010-05-02 08:23:21 +02:00
Julien BLACHE
00d6381f15 Introduce and use db_blocking_{prepare_v2,step}
Make use of the SQLite3 unlock notify API to wait for the database to
become available. From the SQLite3 sample code for the unlock notify API.

This requires SQLite3 to be built with SQLITE_ENABLE_UNLOCK_NOTIFY.
2010-05-02 08:23:21 +02:00
Julien BLACHE
f9454aa4a3 Introduce db_exec(), replacing sqlite3_exec() 2010-05-02 08:23:21 +02:00
Julien BLACHE
dc18860dc5 Enable SQLite3 shared-cache mode
This requires SQLite 3.5.0+ for per-process (as opposed to per-thread)
shared-cache support.

It also enables the use of the unlock notify API.
2010-05-02 08:22:41 +02:00
Julien BLACHE
d2932896a3 Switch SQLite3 to SQLITE_CONFIG_MULTITHREAD mode 2010-05-02 08:22:41 +02:00
Julien BLACHE
0411720a58 Perform explicit sqlite3 init/deinit 2010-04-26 18:24:09 +02:00