Index: common_links.tcl ================================================================== --- common_links.tcl +++ common_links.tcl @@ -10,10 +10,11 @@
Hashes: +
Hashes: +
Having been encouraged by clients to adopt a written -code of conduct, the SQLite developers elected to govern their -interactions with each other, with their clients, -and with the larger SQLite user community in -accordance with the "instruments of good works" from chapter 4 of -[https://en.wikipedia.org/wiki/Rule_of_Saint_Benedict|The Rule of St. Benedict]. -This code of conduct has proven its mettle in thousands of diverse -communities for over 1,500 years, and has served as a baseline for many -civil law codes since the time of Charlemagne. - -
-This rule is strict, and none are able to comply perfectly. -Grace is readily granted for minor transgressions. -All are encouraged to follow this rule closely, as in so -doing they may expect to live happier, healthier, and more -productive lives. The entire rule is good and wholesome, and -yet we make no enforcement of the more introspective aspects. - -
-Everyone is free to use the SQLite source code, object code, -and/or documentation regardless of their opinion of and adherence -to this rule. -SQLite has been and continues to be completely free to everyone, -without precondition. - -
-However, those who wish to participate in the SQLite community, -either by commenting on the public mailing lists or by contributing -patches or suggestions or in any other way, -are expected to conduct themselves in a manner -that honors the overarching spirit of the rule, even if they -disagree with specific details. -Polite and professional discussion is always welcomed, from anyone. - -
+The original document we put here was more of a +[Code of Ethics of the Project Founder]. +While we stand by those principles, they are not in line with the modern +technical meaning of a Code of Conduct and have hence been renamed. + +
+The SQLite community has been a kind, welcoming and well-mannered community +since its inception nearly two decades ago. In that time many of the +qualities we've worked hard to bring to our project - safety, consistency, +usability and integrity among them - have become part of our community's +culture as well. Much like the care and effort we've put into securing the +longevity of SQLite, we'd like to do the same for that community by +clarifying our goals and expectations for all involved. To that end +the SQLite project has officially adopted the +[https://www.mozilla.org/en-US/about/governance/policies/participation/|Mozilla Community Participation Guidelines] +as its Code of Conduct with the exception that the reporting +email address is changed to +codeofconduct@sqlite.org. +While we are not doing so in reaction to any current or ongoing issues, +we believe that this will be a helpful part of maintaining the long-term +sustainability of the project. ADDED pages/codeofethics.in Index: pages/codeofethics.in ================================================================== --- /dev/null +++ pages/codeofethics.in @@ -0,0 +1,150 @@ +
This document was originally called a "Code of Conduct" and +was created (in a slightly different format) for the purpose of +filling in a box on "supplier registration" forms +submitted to the SQLite developers by various minor clients. However, +we subsequently learned that "Code of Conduct" has a specific technical +meaning within many software development communities, a meaning which +was at odds with the intent of this document. Hence, this document +is now renamed and replaced by a +[Code of Conduct|Code of Conduct] that does comply with the +specific techical requirements was inserted in the place of +the old name. + +
+This document is still sometimes used as a "Code of Conduct" on supplier +registration forms. But it is not a Code of Conduct in the same sense +that many communities mean a Code of Conduct. Rather, +this document describes the foundational ethical principals upon +which SQLite is based. Another way to look at this document is +as a succinct description of the SQLite Founder's idea of what it +means to be "virtuous". + +
+Readers can also interpret this document as a primer on the +world-view of the SQLite Founder, to help them better understand +"where he is coming from". + +
The founder of SQLite, and all of the current developers at the time +when this document was composed, have pledged to govern their +interactions with each other, with their clients, +and with the larger SQLite user community in +accordance with the "instruments of good works" from chapter 4 of +[https://en.wikipedia.org/wiki/Rule_of_Saint_Benedict|The Rule of St. Benedict] +(hereafter: "The Rule"). +This code of ethics has proven its mettle in thousands of diverse +communities for over 1,500 years, and has served as a baseline for many +civil law codes since the time of Charlemagne. + +
+No one is required to follow The Rule, to know The Rule, or even +to think that The Rule is a good idea. The Founder of SQLite believes +that anyone who follows The Rule will live a happier and more productive +life, but individuals are free to dispute or ignore that advice if +they wish. + +
+The founder of SQLite and all +current developers have pledged to follow spirit of The Rule +to the best of their ability. They +view The Rule as their promise to all SQLite users of how the developers +are expected to behave in community. +This is a one-way promise, or covenant. +In other words, the developers are saying: "We will treat you this +way regardless of how you treat us." + + +
-The DBSTAT virtual tables is a read-only [eponymous virtual table] that returns +The DBSTAT virtual table is a read-only [eponymous virtual table] that returns information about which pages of the database files are used by which tables and indexes in the schema. The DBSTAT virtual table is used to implement [sqlite3_analyzer.exe] utility program, and to help compute the [https://www.sqlite.org/src/repo-tabsize|table size pie-chart] in Index: pages/index.in ================================================================== --- pages/index.in +++ pages/index.in @@ -12,11 +12,11 @@ SQLite is the [most used] database engine in the world. More Info
SQLite supports many [corefunc|simple] and [aggfunc|aggregate] +
SQLite supports many [corefunc|simple], [aggfunc|aggregate], +and [window functions|window] SQL functions. For presentation purposes, simple functions are further -subdivided into [corefunc | core functions] and [datefunc|date-time functions]. +subdivided into [corefunc | core functions], [datefunc|date-time functions], +and [json1|JSON functions]. Applications can add new functions, written in C/C++, using the [sqlite3_create_function()] interface.
^It is possible to have an aggregate function with the same name as a @@ -2442,12 +2444,17 @@ funcdef {glob(X,Y)} {} { ^The glob(X,Y) function is equivalent to the expression "Y GLOB X". Note that the X and Y arguments are reversed in the glob() function - relative to the infix [GLOB] operator. - ^If the [sqlite3_create_function()] interface is used to + relative to the infix [GLOB] operator. Y is the string and X is the + pattern. So, for example, the following expressions are equivalent: +
++ name GLOB '*helium*' + glob('*helium*',name) +
^If the [sqlite3_create_function()] interface is used to override the glob(X,Y) function with an alternative implementation then the [GLOB] operator will invoke the alternative implementation. } funcdef {ifnull(X,Y)} {} { @@ -2498,10 +2505,16 @@ "Y LIKE X [ESCAPE Z]" expression. ^If the optional ESCAPE clause is present, then the like() function is invoked with three arguments. ^Otherwise, it is invoked with two arguments only. Note that the X and Y parameters are reversed in the like() function relative to the infix [LIKE] operator. + X is the pattern and Y is the string to match against that pattern. + Hence, the following expressions are equivalent: +
^The [sqlite3_create_function()] interface can be used to override the like() function and thereby change the operation of the [LIKE] operator. When overriding the like() function, it may be important to override both the two and three argument versions of the like() function. Otherwise, different code may be called to implement the @@ -2787,11 +2800,12 @@ }+ name LIKE '%neon%' + like('%neon%',name) +
The core functions shown below are available by default. [datefunc | Date & Time functions], -[aggfunc | aggregate functions], and +[aggfunc | aggregate functions], +[builtin window functions|window functions], and [json1 | JSON functions] are documented separately. An application may define additional functions written in C and added to the database engine using the [sqlite3_create_function()] API.
@@ -3012,12 +3026,15 @@ ±N years where N is not a multiple of four.^The "start of" modifiers (7 through 9) shift the date backwards to the beginning of the current month, year or day.
-^The "weekday" modifier advances the date forward to the next date -where the weekday number is N. Sunday is 0, Monday is 1, and so forth.
+^The "weekday" modifier advances the date forward, if necessary, +to the next date where the weekday number is N. Sunday is 0, Monday is 1, +and so forth. +^If the date is already on the desired weekday, the "weekday" modifier +leaves the date unchanged.
^The "unixepoch" modifier (11) only works if it immediately follows a timestring in the DDDDDDDDDD format. ^This modifier causes the DDDDDDDDDD to be interpreted not as a Julian day number as it normally would be, but as @@ -3638,10 +3655,12 @@ must be a [compound select] where the right-most [compound-operator] is either UNION or UNION ALL.
To put it another way, a recursive common table expression must look like the following: Index: pages/news.in ================================================================== --- pages/news.in +++ pages/news.in @@ -16,10 +16,32 @@ regsub -all {[Tt]icket #(\d+)} $txt \ {\0} txt hd_resolve "
$txt" hd_puts "
^(PRAGMA legacy_alter_table;
+
PRAGMA legacy_alter_table = boolean
This pragma sets or queries the value of the legacy_alter_table + flag.)^ ^(When this flag is on, the ALTER TABLE RENAME + command (for changing the name of a table) works as it did + in SQLite 3.24.0 ([dateof:3.24.0]) and earlier.)^ More specifically, + when this flag is on + the ALTER TABLE RENAME command only rewrites the initial occurrence + of the table name in its CREATE TABLE statement and in any associated + CREATE INDEX and CREATE TRIGGER statements. Other references to the + table are unmodifed, including: +
This pragma is provided as a work-around for older programs that + contain code that expect the incomplete behavior + of ALTER TABLE RENAME found in older versions of SQLite. + New applications should leave this flag turned off. +
For compability with older [virtual table] implementations, + this flag is turned on temporarily while the [sqlite3_module.xRename] + method is being run. The value of this flag is restore after the + [sqlite3_module.xRename] method finishes. +} Pragma legacy_file_format {
^(PRAGMA legacy_file_format;
PRAGMA legacy_file_format = boolean
This pragma sets or queries the value of the legacy_file_format Index: pages/prosupport.in ================================================================== --- pages/prosupport.in +++ pages/prosupport.in @@ -242,11 +242,11 @@ an as-deployed configuration using only published and documented interfaces. TH3 is designed for use with embedded devices, and is compatible with DO-178B. Every release of the public-domain SQLite is tested using TH3, and so all users benefit from the TH3 tests. But the TH3 tests are not themselves public. Hardware or system manufactures who want to have -TH3 test run on their systems can negotiation a service agreement to have +TH3 test run on their systems can negotiate a service agreement to have the SQLite Developers run those tests.
Paid support options and products are provided by Index: pages/rescode.in ================================================================== --- pages/rescode.in +++ pages/rescode.in @@ -742,10 +742,50 @@ The SQLITE_READONLY_DIRECTORY result code indicates that the database is read-only because process does not have permission to create a journal file in the same directory as the database and the creation of a journal file is a prerequisite for writing. } + +RESCODE SQLITE_ERROR_SNAPSHOT {SQLITE_ERROR | (3<<8)} { + The SQLITE_ERROR_SNAPSHOT result code might be returned when attempting + to start a read transaction on an historical version of the database + by using the [sqlite3_snapshot_open()] interface. If the historical + snapshot is no longer available, then the read transaction will fail + with the SQLITE_ERROR_SNAPSHOT. This error code is only possible if + SQLite is compiled with [-DSQLITE_ENABLE_SNAPSHOT]. +} + +RESCODE SQLITE_LOCKED_VTAB {SQLITE_LOCKED | (2<<8)} { + The SQLITE_LOCKED_VTAB result code is not used by the SQLite core, but + it is available for use by extensions. Virtual table implementations + can return this result code to indicate that they cannot complete the + current operation because of locks held by other threads or processes. +
+ The [R-Tree extension] returns this result code when an attempt is made + to update the R-Tree while another prepared statement is actively reading + the R-Tree. The update cannot proceed because any change to an R-Tree + might involve reshuffling and rebalancing of nodes, which would disrupt + read cursors, causing some rows to be repeated and other rows to be + omitted. +} + +RESCODE SQLITE_CORRUPT_SEQUENCE {SQLITE_CORRUPT | (2<<8)} { + The SQLITE_CORRUPT_SEQUENCE result code means that the schema of + the sqlite_sequence table is corrupt. The sqlite_sequence table + is used to help implement the [AUTOINCREMENT] feature. The + sqlite_sequence table should have the following format: +
++ CREATE TABLE sqlite_sequence(name,seq); +
If SQLite discovers that the sqlite_sequence table has any other
+ format, it returns the SQLITE_CORRUPT_SEQUENCE error.
+}
+
+RESCODE SQLITE_CANTOPEN_DIRTYWAL {SQLITE_CANTOPEN | (5<<8)} {
+ The SQLITE_CANTOPEN_DIRTYWAL result code is not used at this time.
+}
+
#############################################################################
# Code to process the RESCODE values
#
# Convert formula RESCODE values into numerics
Index: pages/rtree.in
==================================================================
--- pages/rtree.in
+++ pages/rtree.in
@@ -434,11 +434,11 @@
R*Tree entries that overlap with a circle centered a 45.3,22.9 with a
radius of 5.0:
^The SQL syntax for custom queries is the same regardless of which interface, sqlite3_rtree_geometry_callback() or sqlite3_rtree_query_callback(), is used to register the SQL function. However, the newer query-style callbacks give the application greater control over how the query proceeds. Index: pages/tclsqlite.in ================================================================== --- pages/tclsqlite.in +++ pages/tclsqlite.in @@ -533,10 +533,14 @@ the callback will do some other useful work for a short while (such as service GUI events) then return so that the lock can be tried again. The callback procedure should return "0" if it wants SQLite to try again to open the database and should return "1" if it wants SQLite to abandon the current operation. +
+If the busy method is invoked without an argument, the name of the callback +procedure last set by the busy method is returned. If no callback procedure +has been set, an empty string is returned. } ############################################################################## METHOD enable_load_extension { Index: pages/vtab.in ================================================================== --- pages/vtab.in +++ pages/vtab.in @@ -1375,11 +1375,20 @@
This method provides notification that the virtual table implementation that the virtual table will be given a new name. If this method returns [SQLITE_OK] then SQLite renames the table. If this method returns an [error code] then the renaming is prevented. -
The xRename method is required for every virtual table implementation. +
The xRename method is optional. If omitted, then the virtual +table may not be renamed using the ALTER TABLE RENAME command. + +
The [PRAGMA legacy_alter_table] setting is enabled prior to invoking this
+method, and the value for legacy_alter_table is restored after this
+method finishes. This is necessary for the correct operation of virtual
+tables that make use of [shadow tables] where the shadow tables must be
+renamed to match the new virtual table name. If the legacy_alter_format is
+off, then the xConnect method will be invoked for the virtual table every
+time the xRename method tries to change the name of the shadow table.
Even though it is possible to open a read-only WAL-mode database, -it is good practice is to converted to +it is good practice to converted to [journal_mode | PRAGMA journal_mode=DELETE] prior to burning an SQLite database image onto read-only media.
Most built-in window functions ignore the
SQLite supports the following 11 built-in window functions:
row_number()
The number of the row within the current partition. Rows are