sqlite3 1.6.8-arm-linux → 1.6.9-arm-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: c22407ea3180e2b62c85e597c0af0938d122fa8ebe976dddeb3bc64aa151f34c
4
- data.tar.gz: '099b975f8bfe1b8225bba9caa2e4a830a2d8bc811f3f5a34d48d92291348c824'
3
+ metadata.gz: 39a6a6c00caa153acfd43114008b76128f4e0980eee45e5a61271aa7d6f6041d
4
+ data.tar.gz: 320cfc6ae52648c569697841c9aa5a7dc6514e0d8aabbe725a21282ad8fa86ab
5
5
  SHA512:
6
- metadata.gz: b14c63774d2e6076e8ecd093ea16893416e9d454ce28f16a1343460be7064504f115b4c0046e926bf0083b964598de6f61900a4eb6e0e78d7ff8f30c97352662
7
- data.tar.gz: 63504d9607b4df17f940252cf9d0589fdca8a761272b91495e49733b0b05fa7a4ffc2b39264e51a69121907bb398415930f5a2795207351f284218ae1c20eae9
6
+ metadata.gz: d8249f705b306af67b66ab3701888693b02635102b711f2be952ed4be33ccabc661767f296af6ac855ffe57bdf474d1c147737bcb101ff8ee92e679591bebd51
7
+ data.tar.gz: 4ff2e02ea7f5d8accfc3c6320905543925e09cd635e1bc76a2b3703ea28ba27a0986ca8c53ddda32dfcd6a29ac4c2e45d38277bbe2430a978ea0e1af11ff29c6
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: arm-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