extralite-bundle 2.8 → 2.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -146,9 +146,9 @@ extern "C" {
146
146
  ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147
147
  ** [sqlite_version()] and [sqlite_source_id()].
148
148
  */
149
- #define SQLITE_VERSION "3.45.0"
150
- #define SQLITE_VERSION_NUMBER 3045000
151
- #define SQLITE_SOURCE_ID "2024-01-15 17:01:13 1066602b2b1976fe58b5150777cced894af17c803e068f5918390d6915b46e1d"
149
+ #define SQLITE_VERSION "3.45.3"
150
+ #define SQLITE_VERSION_NUMBER 3045003
151
+ #define SQLITE_SOURCE_ID "2024-04-15 13:34:05 8653b758870e6ef0c98d46b3ace27849054af85da891eb121e9aaa537f1e8355"
152
152
 
153
153
  /*
154
154
  ** CAPI3REF: Run-Time Library Version Numbers
@@ -420,6 +420,8 @@ typedef int (*sqlite3_callback)(void*,int,char**, char**);
420
420
  ** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
421
421
  ** <li> The application must not modify the SQL statement text passed into
422
422
  ** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
423
+ ** <li> The application must not dereference the arrays or string pointers
424
+ ** passed as the 3rd and 4th callback parameters after it returns.
423
425
  ** </ul>
424
426
  */
425
427
  SQLITE_API int sqlite3_exec(
@@ -2141,6 +2143,22 @@ struct sqlite3_mem_methods {
2141
2143
  ** configuration setting is never used, then the default maximum is determined
2142
2144
  ** by the [SQLITE_MEMDB_DEFAULT_MAXSIZE] compile-time option. If that
2143
2145
  ** compile-time option is not set, then the default maximum is 1073741824.
2146
+ **
2147
+ ** [[SQLITE_CONFIG_ROWID_IN_VIEW]]
2148
+ ** <dt>SQLITE_CONFIG_ROWID_IN_VIEW
2149
+ ** <dd>The SQLITE_CONFIG_ROWID_IN_VIEW option enables or disables the ability
2150
+ ** for VIEWs to have a ROWID. The capability can only be enabled if SQLite is
2151
+ ** compiled with -DSQLITE_ALLOW_ROWID_IN_VIEW, in which case the capability
2152
+ ** defaults to on. This configuration option queries the current setting or
2153
+ ** changes the setting to off or on. The argument is a pointer to an integer.
2154
+ ** If that integer initially holds a value of 1, then the ability for VIEWs to
2155
+ ** have ROWIDs is activated. If the integer initially holds zero, then the
2156
+ ** ability is deactivated. Any other initial value for the integer leaves the
2157
+ ** setting unchanged. After changes, if any, the integer is written with
2158
+ ** a 1 or 0, if the ability for VIEWs to have ROWIDs is on or off. If SQLite
2159
+ ** is compiled without -DSQLITE_ALLOW_ROWID_IN_VIEW (which is the usual and
2160
+ ** recommended case) then the integer is always filled with zero, regardless
2161
+ ** if its initial value.
2144
2162
  ** </dl>
2145
2163
  */
2146
2164
  #define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */
@@ -2172,6 +2190,7 @@ struct sqlite3_mem_methods {
2172
2190
  #define SQLITE_CONFIG_SMALL_MALLOC 27 /* boolean */
2173
2191
  #define SQLITE_CONFIG_SORTERREF_SIZE 28 /* int nByte */
2174
2192
  #define SQLITE_CONFIG_MEMDB_MAXSIZE 29 /* sqlite3_int64 */
2193
+ #define SQLITE_CONFIG_ROWID_IN_VIEW 30 /* int* */
2175
2194
 
2176
2195
  /*
2177
2196
  ** CAPI3REF: Database Connection Configuration Options
@@ -1,4 +1,4 @@
1
1
  module Extralite
2
2
  # Extralite version
3
- VERSION = '2.8'
3
+ VERSION = '2.8.1'
4
4
  end
@@ -948,7 +948,7 @@ class DatabaseTest < Minitest::Test
948
948
 
949
949
  db.execute('insert into foo values (43)')
950
950
  assert_equal [42, 43], db.query_splat('select x from foo')
951
-
951
+
952
952
  db.savepoint(:b)
953
953
 
954
954
  db.execute('insert into foo values (44)')
@@ -1046,6 +1046,48 @@ class DatabaseTest < Minitest::Test
1046
1046
  assert File.size(wal_fn) == 0
1047
1047
  assert_equal [0, 0], r
1048
1048
  end
1049
+
1050
+ def test_execute_with_comments
1051
+ result = @db.execute(<<~SQL)
1052
+ -- this is a comment
1053
+ SQL
1054
+ assert_nil result
1055
+
1056
+ result = @db.execute(<<~SQL)
1057
+ DELETE FROM t;
1058
+ INSERT INTO t (x, y, z) VALUES (1, 1, 1);
1059
+ INSERT INTO t (x, y, z) VALUES (2, 2, 2);
1060
+ SQL
1061
+ assert_equal 1, result
1062
+ assert_equal [1, 2], @db.query_splat('SELECT x FROM t ORDER BY x')
1063
+
1064
+ result = @db.execute(<<~SQL)
1065
+ -- this is a comment at the beginning
1066
+ DELETE FROM t;
1067
+ INSERT INTO t (x, y, z) VALUES (3, 3, 3);
1068
+ INSERT INTO t (x, y, z) VALUES (4, 4, 4);
1069
+ SQL
1070
+ assert_equal 1, result
1071
+ assert_equal [3, 4], @db.query_splat('SELECT x FROM t ORDER BY x')
1072
+
1073
+ result = @db.execute(<<~SQL)
1074
+ DELETE FROM t;
1075
+ INSERT INTO t (x, y, z) VALUES (5, 5, 5);
1076
+ -- this is a comment in the middle
1077
+ INSERT INTO t (x, y, z) VALUES (6, 6, 6);
1078
+ SQL
1079
+ assert_equal 1, result
1080
+ assert_equal [5, 6], @db.query_splat('SELECT x FROM t ORDER BY x')
1081
+
1082
+ result = @db.execute(<<~SQL)
1083
+ DELETE FROM t;
1084
+ INSERT INTO t (x, y, z) VALUES (7, 7, 7);
1085
+ INSERT INTO t (x, y, z) VALUES (8, 8, 8);
1086
+ -- this is a comment at the end
1087
+ SQL
1088
+ assert_nil result
1089
+ assert_equal [7, 8], @db.query_splat('SELECT x FROM t ORDER BY x')
1090
+ end
1049
1091
  end
1050
1092
 
1051
1093
  class ScenarioTest < Minitest::Test
@@ -1438,7 +1480,7 @@ class ConcurrencyTest < Minitest::Test
1438
1480
 
1439
1481
  def test_progress_handler_invalid_arg
1440
1482
  db = Extralite::Database.new(':memory:')
1441
-
1483
+
1442
1484
  assert_raises(TypeError) { db.on_progress(period: :foo) }
1443
1485
  assert_raises(TypeError) { db.on_progress(tick: :foo) }
1444
1486
  assert_raises(ArgumentError) { db.on_progress(mode: :foo) }
@@ -1635,7 +1677,7 @@ end
1635
1677
  class RactorTest < Minitest::Test
1636
1678
  def test_ractor_simple
1637
1679
  skip if SKIP_RACTOR_TESTS
1638
-
1680
+
1639
1681
  fn = Tempfile.new('extralite_test_database_in_ractor').path
1640
1682
 
1641
1683
  r = Ractor.new do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: extralite-bundle
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.8'
4
+ version: 2.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sharon Rosner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-10 00:00:00.000000000 Z
11
+ date: 2024-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler