Merge branch 'development'

This commit is contained in:
Gwendal Roué committed 2024-09-07 14:20:48 +02:00
commit 2cf6c756e1
11 files changed
+31 -8

No files matched your search

+7 -1
View File
@@ -7,7 +7,7 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception:
#### 6.x Releases
- `6.29.x` Releases - [6.29.0](#6290) - [6.29.1](#6291) - [6.29.2](#6292)
- `6.29.x` Releases - [6.29.0](#6290) - [6.29.1](#6291) - [6.29.2](#6292) - [6.29.3](#6293)
- `6.28.x` Releases - [6.28.0](#6280)
- `6.27.x` Releases - [6.27.0](#6270)
- `6.26.x` Releases - [6.26.0](#6260)
@@ -127,6 +127,12 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception:
---
## 6.29.3
Released September 7, 2024
- **Fixed**: [#1613](https://github.com/groue/GRDB.swift/pull/1613) by [@groue](https://github.com/groue): Avoid SQLite misuse when releasing memory on a closed database connection
## 6.29.2
Released August 24, 2024
+1 -1
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'GRDB.swift'
s.version = '6.29.2'
s.version = '6.29.3'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.summary = 'A toolkit for SQLite databases, with a focus on application development.'
+3 -1
View File
@@ -1575,7 +1575,9 @@ public final class Database: CustomStringConvertible, CustomDebugStringConvertib
/// Frees as much memory as possible.
public func releaseMemory() {
SchedulingWatchdog.preconditionValidQueue(self)
sqlite3_db_release_memory(sqliteConnection)
if let sqliteConnection {
sqlite3_db_release_memory(sqliteConnection)
}
schemaCache.clear()
internalStatementCache.clear()
publicStatementCache.clear()
@@ -4,7 +4,6 @@ import Foundation
@usableFromInline
struct SQLiteDateParser {
// swiftlint:disable:next unneeded_synthesized_initializer
@usableFromInline
init() { }
+1 -1
View File
@@ -171,7 +171,7 @@ struct SQLRelation {
var source: SQLSource
var selectionPromise: DatabasePromise<[SQLSelection]>
var filterPromise: DatabasePromise<SQLExpression>?
var ordering: SQLRelation.Ordering = SQLRelation.Ordering()
var ordering = SQLRelation.Ordering()
var ctes: OrderedDictionary<String, SQLCTE> = [:] // See also `allCTEs`
var children: OrderedDictionary<String, Child> = [:]
+1 -1
View File
@@ -223,7 +223,7 @@ extension RecordEncoder: SingleValueEncodingContainer {
unsupportedSingleValueEncoding()
}
func encode<T>(_ value: T) throws where T : Encodable {
func encode<T>(_ value: T) throws where T: Encodable {
if let record = value as? EncodableRecord {
try record.encode(to: &_persistenceContainer)
} else {
+1 -1
View File
@@ -15,7 +15,7 @@
<a href="https://github.com/groue/GRDB.swift/actions/workflows/CI.yml"><img alt="CI Status" src="https://github.com/groue/GRDB.swift/actions/workflows/CI.yml/badge.svg?branch=master"></a>
</p>
**Latest release**: August 24, 2024 • [version 6.29.2](https://github.com/groue/GRDB.swift/tree/v6.29.2) • [CHANGELOG](CHANGELOG.md) • [Migrating From GRDB 5 to GRDB 6](Documentation/GRDB6MigrationGuide.md)
**Latest release**: September 7, 2024 • [version 6.29.3](https://github.com/groue/GRDB.swift/tree/v6.29.3) • [CHANGELOG](CHANGELOG.md) • [Migrating From GRDB 5 to GRDB 6](Documentation/GRDB6MigrationGuide.md)
**Requirements**: iOS 11.0+ / macOS 10.13+ / tvOS 11.0+ / watchOS 4.0+ &bull; SQLite 3.19.3+ &bull; Swift 5.7+ / Xcode 14+
+1
View File
@@ -15,6 +15,7 @@ disabled_rules:
- is_disjoint
- large_tuple
- nesting
- non_optional_string_data_conversion
- opening_brace
- redundant_optional_initialization
- syntactic_sugar
+1 -1
View File
@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>6.29.2</string>
<string>6.29.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
+8
View File
@@ -439,4 +439,12 @@ class DatabasePoolTests: GRDBTestCase {
// In the zombie state, closing is a noop
try dbPool.close()
}
// Regression test for <https://github.com/groue/GRDB.swift/issues/1612>
func test_releaseMemory_after_close() throws {
let dbPool = try makeDatabasePool()
try dbPool.read { _ in } // Create a reader
try dbPool.close()
dbPool.releaseMemory()
}
}
+7
View File
@@ -467,4 +467,11 @@ class DatabaseQueueTests: GRDBTestCase {
try db.execute(sql: "SELECT * FROM sqlite_master")
}
}
// Regression test for <https://github.com/groue/GRDB.swift/issues/1612>
func test_releaseMemory_after_close() throws {
let dbQueue = try makeDatabaseQueue()
try dbQueue.close()
dbQueue.releaseMemory()
}
}