Skip to content

Commit 59bae3d

Browse files
committed
Update SQLite to 3.52.0
1 parent 4d3540c commit 59bae3d

12 files changed

Lines changed: 151 additions & 20 deletions

‎ps1/Update-Deps.ps1‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Downloads non-NuGet deps
22

3-
$sqliteCodeUrl = 'https://sqlite.org/2025/sqlite-amalgamation-3500100.zip'
4-
$sqliteCodeHash = '41716B44AC8777188C4C3F1F370F01C9CB9E3B6428EB5C981D086C35DE2D9D3F'
5-
$sqliteDocUrl = 'https://sqlite.org/2025/sqlite-doc-3500100.zip'
6-
$sqliteDocHash = '662205F63382E57D1071EAABD3C7908DD72114A820A8EBCF1A0D71A9D6B382B4'
7-
$sqliteSrcUrl = 'https://sqlite.org/2025/sqlite-src-3500100.zip'
8-
$sqliteSrcHash = '9090597773C60A49CAEBB3C1AC57DB626FAC4D97CB51890815A8B529A4D9C3DC'
3+
$sqliteCodeUrl = 'https://sqlite.org/2026/sqlite-amalgamation-3520000.zip'
4+
$sqliteCodeHash = '45D0FEA15971DD1300E5B509F48CA134621E10D9297713B64618FBCA21B325FA'
5+
$sqliteDocUrl = 'https://sqlite.org/2026/sqlite-doc-3520000.zip'
6+
$sqliteDocHash = '6F0D517E0C47E6446C74CF5503C87312181B80F04C95743F99F05AF3CCC5E5A6'
7+
$sqliteSrcUrl = 'https://sqlite.org/2026/sqlite-src-3520000.zip'
8+
$sqliteSrcHash = '652A98CA833ED638809A52BEC225A7F37799F71A995778F9CCB68AD03BD1FC11'
99

1010
$sqleanVersion = '0.27.2'
1111
$sqleanZipUrl = "https://github.com/nalgeon/sqlean/archive/refs/tags/$sqleanVersion.zip"

‎src/SqlNotebook/SqlNotebook.csproj‎

Lines changed: 49 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,6 @@
340340
<None Update="doc\sqlite\assert.html">
341341
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
342342
</None>
343-
<None Update="doc\sqlite\asyncvfs.html">
344-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
345-
</None>
346343
<None Update="doc\sqlite\atomiccommit.html">
347344
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
348345
</None>
@@ -391,6 +388,9 @@
391388
<None Update="doc\sqlite\cli.html">
392389
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
393390
</None>
391+
<None Update="doc\sqlite\climode.html">
392+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
393+
</None>
394394
<None Update="doc\sqlite\codeofconduct.html">
395395
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
396396
</None>
@@ -550,6 +550,9 @@
550550
<None Update="doc\sqlite\getthecode.html">
551551
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
552552
</None>
553+
<None Update="doc\sqlite\glossary.html">
554+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
555+
</None>
553556
<None Update="doc\sqlite\hirely.html">
554557
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
555558
</None>
@@ -817,9 +820,6 @@
817820
<None Update="doc\sqlite\rescode.html">
818821
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
819822
</None>
820-
<None Update="doc\sqlite\robots.txt">
821-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
822-
</None>
823823
<None Update="doc\sqlite\rowidtable.html">
824824
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
825825
</None>
@@ -901,6 +901,9 @@
901901
<None Update="doc\sqlite\syntaxdiagrams.html">
902902
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
903903
</None>
904+
<None Update="doc\sqlite\tcljson.html">
905+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
906+
</None>
904907
<None Update="doc\sqlite\tclsqlite.html">
905908
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
906909
</None>
@@ -1048,6 +1051,9 @@
10481051
<None Update="doc\sqlite\c3ref\cancel_auto_extension.html">
10491052
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
10501053
</None>
1054+
<None Update="doc\sqlite\c3ref\carray_bind.html">
1055+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
1056+
</None>
10511057
<None Update="doc\sqlite\c3ref\changes.html">
10521058
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
10531059
</None>
@@ -1126,6 +1132,9 @@
11261132
<None Update="doc\sqlite\c3ref\c_blob.html">
11271133
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
11281134
</None>
1135+
<None Update="doc\sqlite\c3ref\c_carray_blob.html">
1136+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
1137+
</None>
11291138
<None Update="doc\sqlite\c3ref\c_checkpoint_full.html">
11301139
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
11311140
</None>
@@ -1183,6 +1192,9 @@
11831192
<None Update="doc\sqlite\c3ref\c_scanstat_est.html">
11841193
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
11851194
</None>
1195+
<None Update="doc\sqlite\c3ref\c_scm_branch.html">
1196+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
1197+
</None>
11861198
<None Update="doc\sqlite\c3ref\c_serialize_nocopy.html">
11871199
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
11881200
</None>
@@ -1195,9 +1207,6 @@
11951207
<None Update="doc\sqlite\c3ref\c_shm_nlock.html">
11961208
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
11971209
</None>
1198-
<None Update="doc\sqlite\c3ref\c_source_id.html">
1199-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
1200-
</None>
12011210
<None Update="doc\sqlite\c3ref\c_static.html">
12021211
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
12031212
</None>
@@ -1447,6 +1456,9 @@
14471456
<None Update="doc\sqlite\c3ref\set_authorizer.html">
14481457
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
14491458
</None>
1459+
<None Update="doc\sqlite\c3ref\set_errmsg.html">
1460+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
1461+
</None>
14501462
<None Update="doc\sqlite\c3ref\set_last_insert_rowid.html">
14511463
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
14521464
</None>
@@ -1660,7 +1672,7 @@
16601672
<None Update="doc\sqlite\images\chw.jpg">
16611673
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
16621674
</None>
1663-
<None Update="doc\sqlite\images\cpu-usage.jpg">
1675+
<None Update="doc\sqlite\images\cpuusage.png">
16641676
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
16651677
</None>
16661678
<None Update="doc\sqlite\images\direct1b.gif">
@@ -2092,6 +2104,12 @@
20922104
<None Update="doc\sqlite\images\foreignlogos\tcl.gif">
20932105
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
20942106
</None>
2107+
<None Update="doc\sqlite\images\foreignlogos\visualdb-txt.png">
2108+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
2109+
</None>
2110+
<None Update="doc\sqlite\images\foreignlogos\visualdb.png">
2111+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
2112+
</None>
20952113
<None Update="doc\sqlite\images\foreignlogos\xojo.png">
20962114
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
20972115
</None>
@@ -2617,6 +2635,27 @@
26172635
<None Update="doc\sqlite\releaselog\3_50_1.html">
26182636
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
26192637
</None>
2638+
<None Update="doc\sqlite\releaselog\3_50_2.html">
2639+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
2640+
</None>
2641+
<None Update="doc\sqlite\releaselog\3_50_3.html">
2642+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
2643+
</None>
2644+
<None Update="doc\sqlite\releaselog\3_50_4.html">
2645+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
2646+
</None>
2647+
<None Update="doc\sqlite\releaselog\3_51_0.html">
2648+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
2649+
</None>
2650+
<None Update="doc\sqlite\releaselog\3_51_1.html">
2651+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
2652+
</None>
2653+
<None Update="doc\sqlite\releaselog\3_51_2.html">
2654+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
2655+
</None>
2656+
<None Update="doc\sqlite\releaselog\3_52_0.html">
2657+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
2658+
</None>
26202659
<None Update="doc\sqlite\releaselog\3_5_0.html">
26212660
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
26222661
</None>

‎src/SqlNotebookDb/db.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
#define SQLITE_SOUNDEX 1
4444
#define SQLITE_USE_SEH 1
4545

46+
// The percentile extension has been part of the amalgamation since SQLite version 3.51.0.
47+
#define SQLITE_ENABLE_PERCENTILE 1
48+
4649
// Options To Omit Features
4750
#define SQLITE_OMIT_DESERIALIZE 1
4851
#define SQLITE_OMIT_GET_TABLE 1

‎src/SqlNotebookScript/Interpreter/Matcher.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// define this symbol to log Matcher stack frames to C:\temp\matcher.log
2-
//#define MATCHER_LOG
2+
// #define MATCHER_LOG
33

44
using System;
55
using System.Collections.Generic;

‎src/SqlNotebookScript/Interpreter/SqliteGrammar.cs‎

Lines changed: 63 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,20 @@ static SqliteGrammar()
5858
// ( RENAME TO new-table-name ) |
5959
// ( RENAME [COLUMN] column-name TO new-column-name ) |
6060
// ( ADD [COLUMN] <column-def> ) |
61-
// ( DROP [COLUMN] column-name )
61+
// (
62+
// ADD [CONSTRAINT constraint-name]
63+
// CHECK "(" <expr> ")" [<conflict-clause>]
64+
// ) |
65+
// ( DROP [COLUMN] column-name ) |
66+
// ( DROP CONSTRAINT constraint-name ) |
67+
// (
68+
// ALTER [COLUMN] column-name
69+
// SET NOT NULL [<conflict-clause>]
70+
// ) |
71+
// (
72+
// ALTER [COLUMN] column-name
73+
// DROP NOT NULL
74+
// ) |
6275
// )
6376
TopProd(
6477
p = "alter-table-stmt",
@@ -84,8 +97,55 @@ static SqliteGrammar()
8497
)
8598
)
8699
),
87-
Prod($"{p}.add", 1, Tok(TokenType.Add), Opt(Tok(TokenType.Columnkw)), SubProd("column-def")),
88-
Prod($"{p}.drop", 1, Tok(TokenType.Drop), Opt(Tok(TokenType.Columnkw)), Id("column name"))
100+
Prod($"{p}.add", 1,
101+
Tok(TokenType.Add),
102+
Or(
103+
Prod($"{p}.add-column", 1,
104+
Opt(Tok(TokenType.Columnkw)),
105+
SubProd("column-def")
106+
),
107+
Prod($"{p}.add-constraint", 1,
108+
Opt(1,
109+
Tok(TokenType.Constraint),
110+
Id("constraint name")
111+
),
112+
Tok(TokenType.Check),
113+
Tok(TokenType.Lp),
114+
SubProd("expr"),
115+
Tok(TokenType.Rp),
116+
Opt(SubProd("conflict-clause"))
117+
)
118+
)
119+
),
120+
Prod($"{p}.drop", 1,
121+
Tok(TokenType.Drop),
122+
Or(
123+
Prod($"{p}.drop-column", 1,
124+
Opt(1, Tok(TokenType.Columnkw)), Id("column name")
125+
),
126+
Prod($"{p}.drop-constraint", 1,
127+
Opt(1, Tok(TokenType.Constraint)), Id("constraint name")
128+
)
129+
)
130+
),
131+
Prod($"{p}.alter", 1,
132+
Tok(TokenType.Alter),
133+
Opt(Tok(TokenType.Column)),
134+
Id("column name"),
135+
Or(
136+
Prod($"{p}.alter-set", 1,
137+
Tok(TokenType.Set),
138+
Tok(TokenType.Not),
139+
Tok(TokenType.Null),
140+
Opt(SubProd("conflict-clause"))
141+
),
142+
Prod($"{p}.alter-drop", 1,
143+
Tok(TokenType.Drop),
144+
Tok(TokenType.Not),
145+
Tok(TokenType.Null)
146+
)
147+
)
148+
)
89149
)
90150
);
91151

‎src/Tests/ScriptTest.g.cs‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@ namespace Tests;
33
// Update this with ps1/Update-Tests.ps1. Do not edit manually.
44
public sealed partial class ScriptTest {
55
[TestMethod] public void Test_Aggregate_function_filter_clause_sql() => TestScript(@"Aggregate function filter clause.sql");
6+
[TestMethod] public void Test_ALTER_TABLE_ADD_CONSTRAINT_CHECK_anonymous_sql() => TestScript(@"ALTER TABLE ADD CONSTRAINT CHECK anonymous.sql");
7+
[TestMethod] public void Test_ALTER_TABLE_ADD_CONSTRAINT_CHECK_named_sql() => TestScript(@"ALTER TABLE ADD CONSTRAINT CHECK named.sql");
68
[TestMethod] public void Test_ALTER_TABLE_DROP_COLUMN_1_sql() => TestScript(@"ALTER TABLE DROP COLUMN 1.sql");
79
[TestMethod] public void Test_ALTER_TABLE_DROP_COLUMN_2_sql() => TestScript(@"ALTER TABLE DROP COLUMN 2.sql");
10+
[TestMethod] public void Test_ALTER_TABLE_DROP_CONSTRAINT_CHECK_sql() => TestScript(@"ALTER TABLE DROP CONSTRAINT CHECK.sql");
11+
[TestMethod] public void Test_ALTER_TABLE_DROP_NOT_NULL_sql() => TestScript(@"ALTER TABLE DROP NOT NULL.sql");
812
[TestMethod] public void Test_ALTER_TABLE_RENAME_COLUMN_1_sql() => TestScript(@"ALTER TABLE RENAME COLUMN 1.sql");
913
[TestMethod] public void Test_ALTER_TABLE_RENAME_COLUMN_2_sql() => TestScript(@"ALTER TABLE RENAME COLUMN 2.sql");
14+
[TestMethod] public void Test_ALTER_TABLE_SET_NOT_NULL_copy_sql() => TestScript(@"ALTER TABLE SET NOT NULL copy.sql");
1015
[TestMethod] public void Test_CONCAT_and_CONCAT_WS_sql() => TestScript(@"CONCAT and CONCAT_WS.sql");
1116
[TestMethod] public void Test_CREATE_TABLE_duplicate_options_sql() => TestScript(@"CREATE TABLE duplicate options.sql");
1217
[TestMethod] public void Test_CREATE_TABLE_STRICT_sql() => TestScript(@"CREATE TABLE STRICT.sql");
@@ -111,6 +116,7 @@ public sealed partial class ScriptTest {
111116
[TestMethod] public void Test_JSON_GROUP_ARRAY_with_ORDER_BY_sql() => TestScript(@"JSON_GROUP_ARRAY with ORDER BY.sql");
112117
[TestMethod] public void Test_JSON_GROUP_ARRAY_sql() => TestScript(@"JSON_GROUP_ARRAY.sql");
113118
[TestMethod] public void Test_LIST_FILES_sql() => TestScript(@"LIST_FILES.sql");
119+
[TestMethod] public void Test_MEDIAN_sql() => TestScript(@"MEDIAN.sql");
114120
[TestMethod] public void Test_NEWID_sql() => TestScript(@"NEWID.sql");
115121
[TestMethod] public void Test_NOW_sql() => TestScript(@"NOW.sql");
116122
[TestMethod] public void Test_ORDER_BY_NULLS_FIRST_sql() => TestScript(@"ORDER BY NULLS FIRST.sql");
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CREATE TABLE t3 (id INTEGER, age INTEGER);
2+
ALTER TABLE t3 ADD CHECK (age >= 0);
3+
--output--
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CREATE TABLE t3 (id INTEGER, age INTEGER);
2+
ALTER TABLE t3 ADD CONSTRAINT chk_age CHECK (age >= 0);
3+
--output--
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CREATE TABLE t4 (id INTEGER, age INTEGER CONSTRAINT chk_age CHECK (age >= 0));
2+
ALTER TABLE t4 DROP CONSTRAINT chk_age;
3+
--output--
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CREATE TABLE t2 (id INTEGER, name TEXT NOT NULL);
2+
ALTER TABLE t2 ALTER COLUMN name DROP NOT NULL;
3+
--output--

0 commit comments

Comments
 (0)