sqlite3 1.6.8-aarch64-linux → 1.6.9-aarch64-linux

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87a57fb75374a1539a7364563605b6fe681c6b5d1f3c3a02a910960754c5ad4a
4
- data.tar.gz: ce581ca7e704cbd49831154a3ab4e60748bc074913730af9e90a5b2f831ddaef
3
+ metadata.gz: 2fe9431f2cbd2e20f715b47e8c7148107a470eea7fb8de6d04b5264d0d44eab7
4
+ data.tar.gz: 255c27ae768bca70ec8b80a0eaab4fb50404d8518b37d4503b72661bd4620c13
5
5
  SHA512:
6
- metadata.gz: 9f7476c89db55d43740adb077a66434cb7edb8d22c3d9979cdb1d02929870d62941020615613ecc99da556641d2606bc465c107ed9fb8379f3803fbb437114b6
7
- data.tar.gz: d1479998e93349c9d63c389ae071d69dacb83ed31c1c9207e0be4a2ffcb2d185e2e1f089b5cfc9aedde033ac272cb3fe98a23101fceef926889cb0d0f660d2ee
6
+ metadata.gz: 8eccaedab3e0d476a6d429c372a68af001695c39f1976a75bf7f6b88c0038961db1ea53433fdcd3c6e437ef8da210a6a934472e580e08804d863892842c5f7e0
7
+ data.tar.gz: '068d189dab03ba99062958d8e58e64ac5a05f057df2cc9338a90186cce9fba2d30069bc2cfeb316d97ba4f66ae1b5f92ca9ea4fd7ee9ebc1f1c969fb40fc4420'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # sqlite3-ruby Changelog
2
2
 
3
+ ## 1.6.9 / 2023-11-26
4
+
5
+ ### Dependencies
6
+
7
+ - Vendored sqlite is update to [v3.44.2](https://sqlite.org/releaselog/3_44_2.html). @flavorjones
8
+
9
+ ### Added
10
+
11
+ - `Database.new` now accepts a `:default_transaction_mode` option (defaulting to `:deferred`), and `Database#transaction` no longer requires a transaction mode to be specified. This should allow higher-level adapters to more easily choose a transaction mode for a database connection. [#426] @masamitsu-murase
12
+
13
+
3
14
  ## 1.6.8 / 2023-11-01
4
15
 
5
16
  ### Dependencies
data/Gemfile CHANGED
@@ -5,6 +5,6 @@ gemspec
5
5
  gem("minitest", "5.20.0")
6
6
  gem("rake-compiler", "1.2.5")
7
7
  gem("rake-compiler-dock", "1.3.1")
8
- gem("rdoc", "6.5.0")
8
+ gem("rdoc", "6.6.0")
9
9
 
10
- gem("ruby_memcheck", "2.2.0") if Gem::Platform.local.os == "linux"
10
+ gem("ruby_memcheck", "2.2.1") if Gem::Platform.local.os == "linux"
data/dependencies.yml CHANGED
@@ -1,14 +1,14 @@
1
1
  # TODO: stop using symbols here once we no longer support Ruby 2.7 and can rely on symbolize_names
2
2
  :sqlite3:
3
3
  # checksum verified by first checking the published sha3(256) checksum against https://sqlite.org/download.html:
4
- # 6869046465eae886f1a9f2c8debeeba44d34328693aa77a5bd4a3cfed93d6556
4
+ # 6c427f0547e2f7babe636b748dd5d5a1f2f31601adadef7e2805e7d1f7171861
5
5
  #
6
- # $ sha3sum -a 256 ports/archives/sqlite-autoconf-3440000.tar.gz
7
- # 6869046465eae886f1a9f2c8debeeba44d34328693aa77a5bd4a3cfed93d6556 ports/archives/sqlite-autoconf-3440000.tar.gz
6
+ # $ sha3sum -a 256 ports/archives/sqlite-autoconf-3440200.tar.gz
7
+ # 6c427f0547e2f7babe636b748dd5d5a1f2f31601adadef7e2805e7d1f7171861 ports/archives/sqlite-autoconf-3440200.tar.gz
8
8
  #
9
- # $ sha256sum ports/archives/sqlite-autoconf-3440000.tar.gz
10
- # b9cd386e7cd22af6e0d2a0f06d0404951e1bef109e42ea06cc0450e10cd15550 ports/archives/sqlite-autoconf-3440000.tar.gz
11
- :version: "3.44.0"
9
+ # $ sha256sum ports/archives/sqlite-autoconf-3440200.tar.gz
10
+ # 1c6719a148bc41cf0f2bbbe3926d7ce3f5ca09d878f1246fcc20767b175bb407 ports/archives/sqlite-autoconf-3440200.tar.gz
11
+ :version: "3.44.2"
12
12
  :files:
13
- - :url: "https://sqlite.org/2023/sqlite-autoconf-3440000.tar.gz"
14
- :sha256: "b9cd386e7cd22af6e0d2a0f06d0404951e1bef109e42ea06cc0450e10cd15550"
13
+ - :url: "https://sqlite.org/2023/sqlite-autoconf-3440200.tar.gz"
14
+ :sha256: "1c6719a148bc41cf0f2bbbe3926d7ce3f5ca09d878f1246fcc20767b175bb407"
Binary file
Binary file
Binary file
Binary file
@@ -71,12 +71,23 @@ module SQLite3
71
71
 
72
72
  # call-seq: SQLite3::Database.new(file, options = {})
73
73
  #
74
- # Create a new Database object that opens the given file. If utf16
75
- # is +true+, the filename is interpreted as a UTF-16 encoded string.
74
+ # Create a new Database object that opens the given file.
75
+ #
76
+ # Supported permissions +options+:
77
+ # - the default mode is <tt>READWRITE | CREATE</tt>
78
+ # - +:readonly+: boolean (default false), true to set the mode to +READONLY+
79
+ # - +:readwrite+: boolean (default false), true to set the mode to +READWRITE+
80
+ # - +:flags+: set the mode to a combination of SQLite3::Constants::Open flags.
81
+ #
82
+ # Supported encoding +options+:
83
+ # - +:utf16+: boolean (default false), is the filename's encoding UTF-16 (only needed if the filename encoding is not UTF_16LE or BE)
84
+ #
85
+ # Other supported +options+:
86
+ # - +:strict+: boolean (default false), disallow the use of double-quoted string literals (see https://www.sqlite.org/quirks.html#double_quoted_string_literals_are_accepted)
87
+ # - +:results_as_hash+: boolean (default false), return rows as hashes instead of arrays
88
+ # - +:type_translation+: boolean (default false), enable type translation
89
+ # - +:default_transaction_mode+: one of +:deferred+ (default), +:immediate+, or +:exclusive+. If a mode is not specified in a call to #transaction, this will be the default transaction mode.
76
90
  #
77
- # By default, the new database will return result rows as arrays
78
- # (#results_as_hash) and has type translation disabled (#type_translation=).
79
-
80
91
  def initialize file, options = {}, zvfs = nil
81
92
  mode = Constants::Open::READWRITE | Constants::Open::CREATE
82
93
 
@@ -119,6 +130,7 @@ module SQLite3
119
130
  @type_translation = options[:type_translation]
120
131
  @type_translator = make_type_translator @type_translation
121
132
  @readonly = mode & Constants::Open::READONLY != 0
133
+ @default_transaction_mode = options[:default_transaction_mode] || :deferred
122
134
 
123
135
  if block_given?
124
136
  begin
@@ -622,8 +634,10 @@ module SQLite3
622
634
  # by SQLite, so attempting to nest a transaction will result in a runtime
623
635
  # exception.
624
636
  #
625
- # The +mode+ parameter may be either <tt>:deferred</tt> (the default),
637
+ # The +mode+ parameter may be either <tt>:deferred</tt>,
626
638
  # <tt>:immediate</tt>, or <tt>:exclusive</tt>.
639
+ # If `nil` is specified, the default transaction mode, which was
640
+ # passed to #initialize, is used.
627
641
  #
628
642
  # If a block is given, the database instance is yielded to it, and the
629
643
  # transaction is committed when the block terminates. If the block
@@ -634,7 +648,8 @@ module SQLite3
634
648
  # If a block is not given, it is the caller's responsibility to end the
635
649
  # transaction explicitly, either by calling #commit, or by calling
636
650
  # #rollback.
637
- def transaction( mode = :deferred )
651
+ def transaction( mode = nil )
652
+ mode = @default_transaction_mode if mode.nil?
638
653
  execute "begin #{mode.to_s} transaction"
639
654
 
640
655
  if block_given?
@@ -1,11 +1,11 @@
1
1
  module SQLite3
2
2
 
3
- VERSION = "1.6.8"
3
+ VERSION = "1.6.9"
4
4
 
5
5
  module VersionProxy
6
6
  MAJOR = 1
7
7
  MINOR = 6
8
- TINY = 8
8
+ TINY = 9
9
9
  BUILD = nil
10
10
 
11
11
  STRING = [ MAJOR, MINOR, TINY, BUILD ].compact.join( "." )
@@ -624,5 +624,45 @@ module SQLite3
624
624
  db.execute("insert into foo values (?)", Float::INFINITY)
625
625
  assert_equal Float::INFINITY, db.execute("select avg(temperature) from foo").first.first
626
626
  end
627
+
628
+ def test_default_transaction_mode
629
+ tf = Tempfile.new 'database_default_transaction_mode'
630
+ SQLite3::Database.new(tf.path) do |db|
631
+ db.execute("create table foo (score int)")
632
+ db.execute("insert into foo values (?)", 1)
633
+ end
634
+
635
+ test_cases = [
636
+ {mode: nil, read: true, write: true},
637
+ {mode: :deferred, read: true, write: true},
638
+ {mode: :immediate, read: true, write: false},
639
+ {mode: :exclusive, read: false, write: false},
640
+ ]
641
+
642
+ test_cases.each do |item|
643
+ db = SQLite3::Database.new tf.path, default_transaction_mode: item[:mode]
644
+ db2 = SQLite3::Database.new tf.path
645
+ db.transaction do
646
+ sql_for_read_test = "select * from foo"
647
+ if item[:read]
648
+ assert_nothing_raised{ db2.execute(sql_for_read_test) }
649
+ else
650
+ assert_raises(SQLite3::BusyException){ db2.execute(sql_for_read_test) }
651
+ end
652
+
653
+ sql_for_write_test = "insert into foo values (2)"
654
+ if item[:write]
655
+ assert_nothing_raised{ db2.execute(sql_for_write_test) }
656
+ else
657
+ assert_raises(SQLite3::BusyException){ db2.execute(sql_for_write_test) }
658
+ end
659
+ end
660
+ ensure
661
+ db.close if db && !db.closed?
662
+ db2.close if db2 && !db2.closed?
663
+ end
664
+ ensure
665
+ tf.unlink if tf
666
+ end
627
667
  end
628
668
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sqlite3
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.8
4
+ version: 1.6.9
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Jamis Buck
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2023-11-01 00:00:00.000000000 Z
14
+ date: 2023-11-26 00:00:00.000000000 Z
15
15
  dependencies: []
16
16
  description: |
17
17
  Ruby library to interface with the SQLite3 database engine (http://www.sqlite.org). Precompiled