DISQLite3 implements a self-contained, embeddable, zero-configuration SQL database engine for Delphi (Embarcadero / CodeGear / Borland).
Update to SQLite Version 3.47.0.
→>
operator is negative, then access array elements counting from the right.NULL
, if it receives a single input value which is an empty string.NULL
default value.Performance optimizations:
SELECT func(a) FROM tab GROUP BY 1
” only invoke the func() function once per row.FTS5 Changes:
fts5_tokenizer_v2
API and the locale=1
option, for creating custom locale-aware tokenizers and fts5 tables that may take advantage of them. See DISQLite3Fts5Tokenizer_v2
for a fts5_tokenizer_v2
example tokenizer.contentless_unindexed=1
option, for creating contentless fts5 tables that store the values of any UNINDEXED columns persistently in the database.Update to SQLite Version 3.46.1.
sqlite3_prepare
will return an error rather than just generate bad bytecode.SQLITE_ERROR
. In some cases, they were formerly returning SQLITE_INTERNAL
.Update to SQLite Version 3.46.0.
sqlite3_result_subtype
must be registered with SQLITE_RESULT_SUBTYPE
. Failing to do so now causes sqlite3_result_subtype
to raise an SQL error whereas before it might have behaved as a no-op.nil
pointer dereference might occur in the bytecode engine due to incorrect bytecode being generated for a class of SQL statements that are deliberately designed to stress the query planner but which are otherwise pointless.SQLITE_RESULT_SUBTYPE
property for application-defined SQL functions. All application defined SQL functions that invokes sqlite3_result_subtype
must be registered with this new property. Failure to do so might cause the call to sqlite3_result_subtype
to behave as a no-op.sqlite3_get_clientdata
and sqlite3_set_clientdata
.Update to SQLite Version 3.43.2.
sqlite3_blob_reopen
.Update to SQLite Version 3.43.1.
Update to SQLite Version 3.43.0.
Key enhancements include added support for Contentless-Delete FTS5 Indexes, and performance improvements in JSON processing.
Details:
±YYYY-MM-DD HH:MM:SS.SSS
.sqlite3_stmt_explain
API.SQLITE_CONFIG_LOG
and SQLITE_CONFIG_PCACHE_HDRSZ
calls to sqlite3_config
are now allowed to occur after sqlite3_initialize
.sqlite3_db_config
options: SQLITE_DBCONFIG_STMT_SCANSTATUS
and SQLITE_DBCONFIG_REVERSE_SCANORDER
.NOT NULL
column.sqlite3_sleep
are henceforth interpreted as 0.sqlite3_error_offset
so that it does not return out-of-range values when reporting errors associated with generated columns.CREATE TABLE t1 AS SELECT CAST(7 AS INT) AS x;
continues to be INT and is not NUM, for historical compatibility.sqlite3_stmt_scanstatus_v2
interface.sqlite3_deserialize
now report their filename as an empty string, not as 'x'.sqlite3_is_interrupted
interface.sqlite3_prepare
and similar now invoke the progress handler callback and react to sqlite3_interrupt
.sqlite3_vtab_in_first
and sqlite3_vtab_in_next
functions are enhanced so that they reliably detect if they are invoked on a parameter that was not selected for multi-value IN processing using sqlite3_vtab_in
. They return SQLITE_ERROR
instead of SQLITE_MISUSE
in this case.SQLITE_FCNTL_RESET_CACHE
option to the sqlite3_file_control
API.sqlite3_filename
is added and used to represent the name of a database file. Various interfaces are modified to use the new typedef instead of C_char_ptr
. This interface change should be fully backwards compatible, though it might cause (harmless) compiler warnings when rebuilding some legacy applications.sqlite3_value_encoding
interface.sqlite3_strglob
and sqlite3_strlike
APIs so that they are able to accept nil
pointers for their string parameters and still generate a sensible result.This is a security release that addresses a single long-standing problem in the FTS3 extension. An attacker who is able to execute arbitrary SQL statements and who can create a corrupt database that is 2GB or larger in size might be able to trick FTS3 into overflowing an integer used to size a memory allocation, causing the allocation to be too small and ultimately resulting in a buffer overrun. It also includes fixes for other obscure weaknesses.
sqlite3_vtab_distinct
interface that indicates a query that has both DISTINCT and ORDER BY clauses.sqlite3_db_name
interface.sqlite3_json_init()
, that function is now deprecated and does nothing.->
and ->>
operators for easier processing of JSON. The new operators are compatible with MySQL and PostgreSQL.sqlite3_error_offset
interface, which can sometimes help to localize an SQL error to a specific character in the input SQL text, so that applications can provide better error messages.sqlite3_vtab_distinct
interface.sqlite3_vtab_rhs_value
interface.sqlite3_vtab_in
interface (and related) to enable a virtual table to process IN operator constraints all at once, rather than processing each value of the right-hand side of the IN operator separately.nil
-pointer dereference.sqlite3_autovacuum_pages
interface.sqlite3_deserialize
does not and has never worked for the TEMP database. That limitation is now noted in the documentation.sqlite3_changes64
and sqlite3_total_changes64
interfaces.sqlite3_open_v2
.Incremental feature and performance improvements:
New APIs:
sqlite3_preupdate_blobwrite
: Return the index of the column being written in a preupdate callback.sqlite3session_object_config
: Configure a session object.sqlite3session_changeset_size
: Return an upper-limit for the size of a session changeset.Yet another patch release to fix obscure problems in features associated with SQLite 3.35.0:
Fix a handful of problems discovered in prior releases:
This is a patch release to fix problems that were discovered shortly after the previous release:
Bug fixes:
sqlite3_expanded_sql
.TDISQLite3UniDirQuery.IntegerPrimaryKeyField
option to work around the 32-bit limitation of Delphi's ftAutoInc DataType and its corresponding TAutoIncField. Data loss may occur if an INTEGER PRIMARY KEY column uses the full 64-bit range available to SQLite3 integers.sqlite3_txn_state
interface for reporting on the current transaction state of the database connection.sqlite3_carray_bind
interface.SQLITE_PROTOCOL
error.SQLITE_BUSY
, it might have eventually reported success, even though it was still blocked.sqlite3_create_filename
, sqlite3_free_filename
, and sqlite3_database_file_object
interfaces to better support of VFS shim implementations.sqlite3_decode_utf8
and sqlite3_encode_utf8
, but also internal conversions, i.e. in TDISQLite3UniDirQuery
, which use these functions.sqlite3_hard_heap_limit64
interface and the corresponding PRAGMA hard_heap_limit command.SQLITE_DETERMINISTIC
, SQLITE_DIRECTONLY
, SQLITE_INNOCUOUS
, and/or SQLITE_SUBTYPE
.SQLITE_OPEN_NOFOLLOW
option to sqlite3_open_v2
that prevents SQLite from opening symbolic links.SQLITE_DBCONFIG_TRUSTED_SCHEMA
connection setting which is also controllable via the new trusted_schema pragma.sqlite3_filename_database
, sqlite3_filename_journal
, and sqlite3_filename_wal
which are useful for specialized extensions.sqlite3_uri_key
interface.sqlite3_uri_parameter
function so that it works with the rollback journal or WAL filename in addition to the database filename.SQLITE_INNOCUOUS
or SQLITE_DIRECTONLY
.sqlite3_vtab_config
so that the xConnect method of virtual tables can declare the virtual table as SQLITE_VTAB_INNOCUOUS
or SQLITE_VTAB_DIRECTONLY
.sqlite3_interrupt
.SQLITE_DBCONFIG_LEGACY_FILE_FORMAT
option to sqlite3_db_config
is provided. The legacy_file_format pragma is deactivated because (1) it is rarely useful and (2) it is incompatible with VACUUM in schemas that have tables with both generated columns and descending indexes.TDISQLite3UniDirQuery
: ftMemo
and ftWideMemo
fields return string representations of SQLITE_INTEGER
and SQLITE_FLOAT
content..hpp
and .obj
with the -JPHNE
option:.hpp
and .obj
files are not included for these compilers.sqlite3_drop_modules
interface, allowing applications to disable automatically loaded virtual tables that they do not need.SQLITE_DBCONFIG_ENABLE_VIEW
option for sqlite3_db_config
.SQLITE_DIRECTONLY
flag for application-defined SQL functions to prevent those functions from being used inside triggers and views.SQLITE_DBCONFIG_DQS_DML
and SQLITE_DBCONFIG_DQS_DDL
actions to sqlite3_db_config
for activating and deactivating the double-quoted string literal misfeature. Both default to “on” for legacy compatibility, but developers are encouraged to turn them “off”.sqlite3_stmt_isexplain
interface for determining whether or not a prepared statement is an EXPLAIN.SQLITE_DBCONFIG_WRITABLE_SCHEMA
verb for the sqlite3_db_config
interface, that does the same work as PRAGMA writable_schema without using the SQL parser.sqlite3_value_frombind
API for determining if the argument to an SQL function is from a bound parameter.
sqlite3_db_config(
SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER)
setting, or unless the first argument to fts3_tokenizer() is a bound parameter.
sqlite3_db_config(
SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER)
setting if the second argument is a bound parametersqlite3_normalized_sql
interface works on any prepared statementcreated using sqlite3_prepare_v2
or sqlite3_prepare_v3
. It is no longer necessary to use sqlite3_prepare_v3
with SQLITE_PREPARE_NORMALIZE
in order to use sqlite3_normalized_sql
.SQLITE_PREPARE_NO_VTAB
option to sqlite3_prepare_v3
. Use that option to prevent circular references to shadow tables from causing resource leaks.sqlite3_deserialize
interface:SQLITE_FCNTL_SIZE_LIMIT
file-control for setting an upper bound on the size of the in-memory database created by sqlite3_deserialize. The default upper bound is 1GiB, or whatever alternative value is specified by sqlite3_config
(SQLITE_CONFIG_MEMDB_MAXSIZE
).SQLITE_DESERIALIZE_READONLY
flag, which was previously described in the documentation, but was previously a no-op.Bug fixes:
sqlite3_rekey
and sqlite3_rekey_v2
encryption errors with databases greater than about 4 MB.Enhancements:
SQLITE_CONSTRAINT
to indicate that the proposed query plan is unusable and should not be given further consideration.SQLITE_DBCONFIG_DEFENSIVE
option which disables the ability to create corrupt database files using ordinary SQL.SQLITE_DBCONFIG_DEFENSIVE
option is enabled.sqlite3_prepare
times for certain pathological SQL inputs.sqlite3_normalized_sql
interface.SQLITE_FCNTL_DATA_VERSION
file-control.sqlite3_keyword_count
, sqlite3_keyword_name
, and sqlite3_keyword_check
.sqlite3_str
object.SQLITE_DBCONFIG_RESET_DATABASE
option to the sqlite3_db_config
API.SQLITE_CHANGESETAPPLY_INVERT
flagsqlite3changeset_start_v2
interface and the SQLITE_CHANGESETSTART_INVERT
flag.Performance:
Bug fixes:
TDISQLite3UniDirQuery
string fields.sqlite3_serialize
and sqlite3_deserialize
interfaces.SQLITE_DBSTATUS_CACHE_SPILL
option to sqlite3_db_status
for reporting the number of cache spills that have occurred.sqlite3_result_error
then give that error message preference over internally-generated messages.sqlite3_normalize
extension function.sqlite3_trace_v2
now shows each individual SQL statement run within a trigger.sqlite3_vtab_nochange
and sqlite3_value_nochange
interfaces to help virtual table implementations optimize UPDATE operations.sqlite3_vtab_collation
interface.sqlite3_update_hook
callback zDB
argument type.SQLITE_CONFIG_SMALL_MALLOC
configuration setting that gives SQLite a hint that large memory allocations should be avoided when possible.Bug fixes:
sqlite3_result_pointer
.sqlite3_errmsg
for some error codes.sqlite3_bind_pointer
to find the fts5_api pointer.sqlite3_bind_pointer
to set the PTR parameter.sqlite3_bind_pointer
to set the PTR parameter.sqlite3_prepare_v3
and sqlite3_prepare16_v3
interfaces with the extra “prepFlags” parameters.SQLITE_PREPARE_PERSISTENT
flag for sqlite3_prepare_v3
and use it to limit lookaside memory misuse by FTS3, FTS5, and the R-Tree extension.SQLITE_STMTSTATUS_REPREPARE
, SQLITE_STMTSTATUS_RUN
, and SQLITE_STMTSTATUS_MEMUSED
options for the sqlite3_stmt_status
interface.SQLITE_DBCONFIG_ENABLE_QPSG
run-time option enables the query planner stability guarantee.Bug Fixes:
sqlite3_column_name
for queries that use the flattening optimization so that the result is consistent with other queries that do not use that optimization, and with PostgreSQL, MySQL, and SQLServer.SQLITE_READ
authorizer callback is invoked once with a column name that is an empty string for every table referenced in a query from which no columns are extracted.sqlite3_blob
handles when making changes to unrelated tables.Bug Fixes:
sqlite3_sourceid
C API is now a 64-digit SHA3-256 hash instead of a 40-digit SHA1 hash.sqlite3_set_last_insert_rowid
interface and use the new interface in the FTS3, FTS4, and FTS5 extensions to ensure that the sqlite3_last_insert_rowid
interface always returns reasonable values.sqlite3_mprintf
family of interfaces and the printf SQL function to put comma separators at the thousands marks for integers, if the “,” format modifier is used in between the “%” and the “d” (example: “%,d”).SQLITE_LIMIT_VDBE_OP
. This can be used, for example, to prevent excessively large prepared statements in systems that accept SQL queries from untrusted users.Bug Fixes:
sqlite3_trace_v2
output for nested SQL statements should always begin with a “–” comment marker.sqlite3_blob
key/value access object instead of SQL for pulling content out of R-Tree nodes.Bug Fixes:
sqlite3_blob_reopen
interface can correctly handle short rows.sqlite3_value_text
interface so that it correctly translates content generated by zeroblob() into a string of all 0x00 characters. This is a long-standing issue discovered after the DISQLite3 5.17.0 release.sqlite3_column_count
API so it more often returns the same values for PRAGMA statements as it did in prior releases, to minimize disruption to applications that might be using that interface in unexpected ways.Bug Fixes:
SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE
option to sqlite3_db_config
.sqlite3_interrupt
so that it interrupts checkpoint operations that are in process.SQLITE_FCNTL_WIN32_GET_HANDLE
file control opcode.Bug Fixes:
SQLITE_DBCONFIG_MAINDBNAME
.sqlite3_prepare_v2
).Bug Fixes:
SQLITE_OK_LOAD_PERMANENTLY
return code from the extension entry point.SQLITE_DBSTATUS_CACHE_USED_SHARED
option to sqlite3_db_status
.sqlite3_expanded_sql
and sqlite3_trace_v2
.Bug Fixes:
sqlite3_trace_v2
interface so that it is disabled if either the callback or the mask arguments are zero, in accordance with the documentation.
sqlite3_db_config(db,
SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION)
interface which allows the sqlite3_load_extension
C-API to be enabled while keeping the load_extension() SQL function disabled for security.Bug fixes:
sqlite3rbu_bp_progress
interface to the RBU extension.sqlite3_system_errno
interface.Potentially Disruptive Change:
Backwards Compatibility:
SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER
option to sqlite3_db_config
allows to enable or disable it at run-time.New features:
SQLITE_FCNTL_JOURNAL_POINTER
file control.colUsed
field to sqlite3_index_info
for use by the sqlite3_module.xBestIndex
method.sqlite3_db_cacheflush
interface.sqlite3_strlike
interface.sqlite3_snapshot_get
, sqlite3_snapshot_open
, and sqlite3_snapshot_free
interfaces. These are subject to change or removal in a subsequent release.Performance enhancements:
sqlite3_config(
SQLITE_CONFIG_STMTJRNL_SPILL)
.sqlite3_index_constraint_usage.omit
flag of the virtual table column to the left of the IN operator.General improvements:
Bug fixes:
sqlite3_set_auxdata
values from multiple triggers within a single statement do not interfere with one another.sqlite3_result_subtype
interface that could cause problems for the json1 extension under obscure circumstances.sqlite3_value_subtype
and sqlite3_result_subtype
interfaces.This is a bug fix release:
New Features And Enhancements:
Other changes:
fts5_api.iVersion
value is now set to 2. Existing FTS5 custom tokenizers will need to be updated to use the new api version.sqlite3_memory_alarm
interface, which has been deprecated and undocumented for 8 years, is changed into a no-op.Fixes:
sqlite3_initialize
to help ensure that it is thread-safe.sqlite3_value_dup
and sqlite3_value_free
interfaces.sqlite3_result_zeroblob64
and sqlite3_bind_zeroblob64
interfaces.sqlite3_profile
callback is invoked (by sqlite3_reset
or sqlite3_finalize
) for statements that did not run to completion.TDISQLite3Database.BusyTimeout
property.sqlite3_exec_with_callback
error results.sqlite3_status64
interface.sqlite3_blob_read
and sqlite3_blob_write
interfaces.New Features:
SQLITE_CHECKPOINT_TRUNCATE
option to the sqlite3_wal_checkpoint_v2
interface, with corresponding enhancements to PRAGMA wal_checkpoint.
sqlite3_wal_checkpoint_v2(
SQLITE_CHECKPOINT_TRUNCATE)
truncates the WAL file even if there is no checkpoint work to be done.sqlite3_stmt_scanstatus
interface.sqlite3_table_column_metadata
is enhanced to work correctly on WITHOUT ROWID tables and to check for the existence of a table if the column name parameter is nil
.SQLITE_CONFIG_PMASZ
start-time option.SQLITE_CONFIG_PCACHE_HDRSZ
option to sqlite3_config
which makes it easier for applications to determine the appropriate amount of memory for use with SQLITE_CONFIG_PAGECACHE
.Performance Enhancements:
Bug fixes:
SQLITE_ABORT
or SQLITE_ABORT_ROLLBACK
error. That error is still returned if the ROLLBACK modifies the schema.%c
format in sqlite3_mprintf
is able to handle precisions greater than 70.Performance Enhancements:
New Features:
sqlite3_malloc64
sqlite3_realloc64
sqlite3_bind_blob64
sqlite3_result_blob64
sqlite3_bind_text64
andsqlite3_result_text64
.sqlite3_msize
that returns the size of a memory allocation obtained from sqlite3_malloc64
and its variants.SQLITE_LIMIT_WORKER_THREADS
option to sqlite3_limit
and PRAGMA threads command for configuring the number of available worker threads.Bug Fixes:
sqlite3_trace
that was causing it to sometimes fail to print an SQL statement if that statement needed to be re-prepared.SQLITE_PROTOCOL
error from 1 second to 10 seconds.Performance Enhancements:
Bug Fixes:
sqlite3_stmt_busy
interface so that it gives the correct answer for ROLLBACK statements that have been stepped but never reset.sqlite3_rtree_query_callback
interface to R-Tree extensionSQLITE_IOCAP_IMMUTABLE
bit to the set of bits that can be returned by the xDeviceCharacteristics method of a VFS.Bug Fixes:
sqlite3_db_readonly
interface so that it returns true if the database is read-only due to the file format write version number being too large.QuoteIdent
and QuoteIdent16
. Very much like QuotedStr
and QuotedStr16
but they also quote SQLite keywords.SqlBufToFloat
and related functions:Length
parameter is now an Integer type.SqlBufToFloatDef
and SqlStrToFloatDef
functions must successfully process the entire string, otherwise the default value is returned.TDISQLite3Database
design-time properties: TDISQLite3Database.Access
, TDISQLite3Database.Cache
, TDISQLite3Database.Mutex
, TDISQLite3Database.Options
, TDISQLite3Database.VFS
.TDISQLite3Database.ReadOnly
and TDISQLite3Database.ReadOnly16
methods.SQLITE_DETERMINISTIC
optimization when creating these functions: math, regexp, regextract and zlib.sqlite3_is_memory_name
is now case sensitive, the same way SQLite handles the :memory:
file name.SQLITE_DETERMINISTIC
as an optional bit in the 4th argument to the sqlite3_create_function
and related interfaces, providing applications with the ability to create new functions that can be factored out of inner loops when they have constant arguments.SQLITE_READONLY_DBMOVED
error code, returned at the beginning of a transaction, to indicate that the underlying database file has been renamed or moved out from under SQLite.sqlite3_randomness(N,P)
when invoked with N=0
.sqlite3_column_int64
do an implicit cast if the value being accessed is really a floating point number, they are also affected by this change.sqlite3_index_info
object to allow a virtual table to report its estimate on the number of rows that will be returned by a query.win32-longpath
VFS, permitting filenames up to 32K characters in length (DISQLite3 Pro only).sqlite3_step
call.tointeger()
and toreal()
SQL functions.docid < limit
constraints to limit the amount of I/O required.SQLITE_STMTSTATUS_VM_STEP
option to sqlite3_stmt_status
.sqlite3_db_status
(db,
SQLITE_DBSTATUS_DEFERRED_FKS
,…)
interface.percentile
()
” function as a loadable extension.sqlite3_cancel_auto_extension
(X)
interface.SQLITE_WARNING_AUTOINDEX
warning on the SQLITE_CONFIG_LOG
whenever the query planner uses an automatic index.next_char()
” extension SQL function.SQLITE_BUSY_SNAPSHOT
extended error code is returned in WAL mode when a read transaction cannot be upgraded to a write transaction because the read is on an older snapshot.sqlite3_strglob
convenience interface.SQLITE_NOTICE_RECOVER_ROLLBACK
. Change the error log code for WAL recover from SQLITE_OK
to SQLITE_NOTICE_RECOVER_WAL
.SQLITE_WARNING
messages in the error log.sqlite3_load_extension
may omit the filename suffix, and an appropriate architecture-dependent suffix (“.dll”) will be added automatically.sqlite3_trace
output.SQLITE_CORRUPT
error but which was otherwise harmless.SQLITE_CONSTRAINT
errorsSQLITE_READONLY_ROLLBACK
extended error code for when a database cannot be opened because it needs rollback recovery but is read-only.DISQLite3Database
: Remove deprecated functions and procedures.DISQLite3Database
: User helper functions and procedures from DIUtils.pas to remove duplicates.sqlite3_errstr
interface.sqlite3_trace
callback multiple times when a statement is automatically reprepared due to SQLITE_SCHEMA
errors.SQLITE_FCNTL_BUSYHANDLER
file control, used to allow VFS implementations to get access to the busy handler callback.SQLITE_IOERR_DELETE_NOENT
if the file to be deleted does not exist.sqlite3_close_v2
interface.sqlite3_create_module
and sqlite3_create_module_v2
interfaces return SQLITE_MISUSE
on any attempt to overload or replace a virtual table module. The destructor is always called in this case, in accordance with historical and current documentation.SQLITE_DBSTATUS_CACHE_WRITE
option for sqlite3_db_status
.TParam
filtering to the DISQLite3_ClientDataSet_Grid demo project.sqlite3_stricmp
interface as a counterpart to sqlite3_strnicmp
.sqlite3_db_readonly
interface.SQLITE_FCNTL_PRAGMA
file control, giving VFS implementations the ability to add new PRAGMA statements or to override built-in PRAGMAs.SQLITE_ABORT
upon next access after the ROLLBACK.sqlite3_pcache_methods
structure and the SQLITE_CONFIG_PCACHE
and SQLITE_CONFIG_GETPCACHE
configuration parameters are deprecated. They are replaced by a new sqlite3_pcache_methods2 structure and SQLITE_CONFIG_PCACHE2
and SQLITE_CONFIG_GETPCACHE2
configuration parameters.SQLITE_IOCAP_POWERSAFE_OVERWRITE
I/O capability, the SQLITE_POWERSAFE_OVERWRITE compile-time option, and the “psow=BOOLEAN” query parameter for URI filenames.sqlite3_db_release_memory
interface and the shrink_memory pragma. Added the sqlite3_db_filename
interface.sqlite3_stmt_busy
interface.sqlite3_uri_boolean
and sqlite3_uri_int64
interfaces.SQLITE_DBSTATUS_CACHE_HIT
and SQLITE_DBSTATUS_CACHE_MISS
to the sqlite3_db_status
interface.sqlite_stat3
table, a much more capbable enhancement of the previous sqlite_stat2
.sqlite3_data_count
interface so that it can be used to determine if SQLITE_DONE
has been seen on the prepared statement.SQLITE_FCNTL_OVERWRITE
file-control by which the SQLite core indicates to the VFS that the current transaction will overwrite the entire database file.sqlite3_mprintf
family of string rendering routines.sqlite3_vtab_config
interface in support of ON CONFLICT clauses with virtual tables.This is an intermediate release based on an a pre SQLite 3.7.6 snapshot. Recommended only to make use of the newly added functionality.
DISQLite3Ext
.sqlite3_wal_checkpoint_v2
interface and enhanced the wal_checkpoint pragma to support blocking checkpoints.sqlite3_finalize
was not called by one statement with a failed foreign key constraint prior to another statement with foreign key constraints running.SQLITE_DBSTATUS_LOOKASIDE_HIT
, SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE
, and SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL
options for the sqlite3_db_status
interface.sqlite3_stmt_readonly
so that its result is well-defined for all prepared statements and so that it works with VACUUM.sqlite3_trace
mechanism so that nested SQL statements such as might be generated by virtual tables are shown but are shown in comments and without parameter expansion. This greatly improves tracing output when using the FTS3/4 and/or RTREE virtual tables.SQLITE_NOTFOUND
instead of SQLITE_ERROR
for an unrecognized operation code.SQLITE_FCNTL_SYNC_OMITTED
file control to the VFS in place of a call to xSync if the database has PRAGMA synchronous set to OFF.sqlite3_blob_reopen
interface to allow an existing sqlite3_blob
object to be rebound to a new row. Also use this to improve the performance of FTS3.sqlite3_create_function_v2
interface that includes a destructor callback.sqlite3_stmt_readonly
interface.SQLITE_FCNTL_FILE_POINTER
option to sqlite3_file_control
.sqlite3_soft_heap_limit64
interface as a replacement for sqlite3_soft_heap_limit
.SQLITE_CONFIG_PAGECACHE
. Or if using page cache is allocating from the heap, it strives to avoid going over the sqlite3_soft_heap_limit64
, even if SQLITE_ENABLE_MEMORY_MANAGEMENT is not defined at compile time.SQLITE_DBSTATUS_SCHEMA_USED
and SQLITE_DBSTATUS_STMT_USED
to the sqlite3_db_status
interface, in order to report out the amount of memory used to hold the schema and prepared statements of a connection.SQLITE_FCNTL_CHUNK_SIZE
verb to the sqlite3_file_control
interface, to cause database files to grow in large chunks in order to reduce disk fragmentation.TDISQLite3Database.Execute
when processing very large SQL scripts.The differences between DISQLite3 2.3.0.1 and DISQLite3 2.3.0 are minimal, but because of the possibility of database corruption, upgrading is highly recommended.
SQLITE_DBSTATUS_CACHE_USED
verb for sqlite3_db_status
.sqlite3_last_insert_rowid
.sqlite3_compileoption_used
and sqlite3_compileoption_get
interfaces as well as the compile_options pragma and the sqlite_compileoption_used() and sqlite_compileoption_get() SQL functions.sqlite3_log
interface together with the SQLITE_CONFIG_LOG
verb to sqlite3_config
.IMPORTANT INCOMPATIBILITY CHANGE – please read carefully:
Up to this version, the sqlite3
type was an untyped Pointer
. This worked fine when used correctly, but caused hard to identify errors when not. Incompatible variable types are usually detected by the compiler's type checking. But as a matter of fact, Delphi does not generate type errors for untyped Pointer
. Code would compile happily if sqlite3
was used instead of sqlite3_stmt
, and Delphi would not even object to TDISQLite3Database
in place of sqlite3
.
Instead, problems surfaced at runtime. They often materialized as access violations with no meaningful error message and could drive helpless developers into despair. When contacting support, some of them even attributed the problem to a bug in DISQLite3. Even though this was not correct, they certainly had a point. So after careful consideration I decided to change all untyped Pointer
types to pointers to record
structures.
For record
pointers, Delphi can detect type conflicts at compile time, so the likelihood of critical runtime errors is greatly reduced. For most stringent type checking, I recommend to compile with “Typed @ operator” always enabled. This can be set as a project option or in code using {$T+}
or {$TYPEDADDRESS ON}
. With typed @ operator enabled, Delphi also detects incompatible output variable types passed to sqlite3_open
, sqlite3_prepare_v2
, and similar routines.
Unfortunately, the modified strong typing might ask to change existing code before it compiles. Luckily, however, with {$TYPEDADDRESS ON}
Delphi now catches all type incompatibilities so they can be fixed easily. For smaller projects, this is a simple search and replace (older IDEs) or code refactoring (newer ones).
Automatic conversion for larger projects is at hand here:
DISQLite3_Type_Converter.zip contains a precompiled version of the JVCLConverter utility plus the conversion data file. It takes less than a minute to update the DISQLite3 Demos from previous versions: Run JVCLConverter.exe, select the source code folder, and convert. Converting other projects should be just as quickly.
Limit to auto-conversion: The PPointerArray
type (mostly used in sqlite3_create_function
callbacks) is a standard Delphi type. Converting this automatically might cause unintended side effects if used outside the DISQLite3 context. Therefore PPointerArray
must be manually changed to sqlite3_value_ptr_array_ptr
.
This table lists all modified, renamed, or deleted type names and their new counterparts. Only those at the top of the list should be in frequent use:
Old | New |
---|---|
sqlite3_ptr | sqlite3_ptr_ptr |
sqlite3 | sqlite3_ptr |
TDISQLite3DatabaseHandle | sqlite3_ptr |
PDISQLite3DatabaseHandle | sqlite3_ptr_ptr |
sqlite3_stmt_ptr | sqlite3_stmt_ptr_ptr |
sqlite3_stmt | sqlite3_stmt_ptr |
TDISQLite3StatementHandle | sqlite3_stmt_ptr |
PDISQLite3StatementHandle | sqlite3_stmt_ptr_ptr |
sqlite3_blob | sqlite3_blob_ptr |
TDISQLite3BlobHandle | sqlite3_blob_ptr |
PDISQLite3BlobHandle | sqlite3_blob_ptr_ptr |
TSQLite3_Module | sqlite3_module |
Psqlite3_module | sqlite3_module_ptr |
Tsqlite3_tokenizer | sqlite3_tokenizer |
Psqlite3_tokenizer | sqlite3_tokenizer_ptr |
PPsqlite3_tokenizer | sqlite3_tokenizer_ptr_ptr |
Tsqlite3_tokenizer_module | sqlite3_tokenizer_module |
Psqlite3_tokenizer_module | sqlite3_tokenizer_module_ptr |
Tsqlite3_tokenizer_cursor | sqlite3_tokenizer_cursor |
Psqlite3_tokenizer_cursor | sqlite3_tokenizer_cursor_ptr |
PPsqlite3_tokenizer_cursor | sqlite3_tokenizer_cursor_ptr_ptr |
Tsqlite3_vtab | sqlite3_vtab |
Psqlite3_vtab | sqlite3_vtab_ptr |
PPsqlite3_vtab | sqlite3_vtab_ptr_ptr |
Tsqlite3_vtab_cursor | sqlite3_vtab_cursor |
Psqlite3_vtab_cursor | sqlite3_vtab_cursor_ptr |
PPsqlite3_vtab_cursor | sqlite3_vtab_cursor_ptr_ptr |
TSQLite3_index_info | sqlite3_index_info |
Psqlite3_index_info | sqlite3_index_info_ptr |
Tsqlite3_index_constraint | sqlite3_index_constraint |
Tsqlite3_index_constraint_array | sqlite3_index_constraint_array |
Psqlite3_index_constraint_array | sqlite3_index_constraint_array_ptr |
Tsqlite3_index_orderby | sqlite3_index_orderby |
Tsqlite3_index_orderby_array | sqlite3_index_orderby_array |
Psqlite3_index_orderby_array | sqlite3_index_orderby_array_ptr |
Tsqlite3_index_constraint_usage | sqlite3_index_constraint_usage |
Tsqlite3_index_constraint_usage_array | sqlite3_index_constraint_usage_array |
Psqlite3_index_constraint_usage_array | sqlite3_index_constraint_usage_array_ptr |
Bugs fixed in this version:
TDISQLite3Database
, the internal transaction counter was not reset when opening another database so its InTransaction property could return wrong results. Fixed.sqlite3_trace
is now modified to include the values of bound parameters.SQLITE_OPEN_SHAREDCACHE
and SQLITE_OPEN_PRIVATECACHE
flags for sqlite3_open_v2
used to override the global shared cache mode settings for individual database connections.sqlite3_sourceid
interface and SQL function sqlite_source_id().sqlite3_key
so that it successfully sets a correct password after an incorrect one.sqlite3_prepare
and sqlite3_prepare16
as deprecated. They are retained for backwards compatibility, but their use is discounraged. Instead, sqlite3_prepare_v2
and sqlite3_prepare16_v2
should be used, which work much better with SQLITE_SCHEMA
errors.sqlite3_strnicmp
interface for use by extensions and applications.sqlite3_create_function
family of interfaces now return SQLITE_MISUSE
instead of SQLITE_ERROR
when passed invalid parameter combinations.sqlite3_shutdown
interface frees all mutexes.sqlite3_backup
implementation that can lead to a corrupt backup database.TDISQLite3Database.DatabaseName
to create temporary databases. A warning is issued a design time.sqlite3_unlock_notify
interface (DISQLite3 Pro only).TDISQLite3UniDirQuery
Provider Support when inserting and updating BLOB fields with #0 values and NULL BLOBs.TDISQLite3UniDirQuery
. This helps to handle multiple insert problems with TClientDataSet.sqlite3_context
and sqlite3_context_ptr
. This an unfortunate incompatibility change. To find out if you are affected, recompile your code and watch for compiler errors. If so, update your code by replacing “sqlite3_context” with “sqlite3_context_ptr”.TDISQLite3UniDirQuery
support for TClientDataSet.RefreshRecord.TDISQLite3UniDirQuery
now sets the TField.Required property for columns declared as NOT NULL.TDISQLite3DataSetImporter.OnImportError
event to catch and log exceptions (which may be caused by, for example, invalid data conversions on certain records) and continue the import.TDISQLite3DataSetImporter
, call the progress event for every single record instead of every 16th one only.TDISQLite3DataSetImporter
in the line wrap functions for textual blob data.sqlite3_db_mutex
interface.sqlite3_extended_errcode
interface.SQLITE_BUSY
if there are pending incremental BLOB I/O requests.SQLITE_BUSY
(instead of SQLITE_ERROR
) when an attempt is made to ROLLBACK while one or more queries are still pending.sqlite3_stmt_status
interface for performance monitoring.SQLITE_CONFIG_LOOKASIDE
verb to sqlite3_config
to control the default lookaside configuration.SQLITE_STATUS_PAGECACHE_SIZE
and SQLITE_STATUS_SCRATCH_SIZE
to the sqlite3_status
interface.SQLITE_CONFIG_PAGECACHE
and SQLITE_CONFIG_SCRATCH
to remove the “+4” magic number in the buffer size computation.sqlite3_db_config
and sqlite3_db_status
interfaces for controlling and monitoring the lookaside allocator separately on each database connection.