Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise in-memory database handling for modern SQLite #105

Merged
merged 8 commits into from
Sep 15, 2023

Conversation

gwynne
Copy link
Member

@gwynne gwynne commented Sep 14, 2023

SQLiteKit has for a long time depended on the use of SQLite's shared cache with in-memory databases to support opening multiple connections to such databases. However, SQLite has also for a long time specifically recommended the total omission of the shared cache, a recommendation which SQLiteNIO now follows as of vapor/sqlite-nio#51. Therefore, SQLiteKit now uses uniquely-named temporary files to emulate the feature when in-memory databases are requested.

Additional changes in this release:

  • To match Vapor and SQLiteNIO, Swift 5.7 is now required.
  • Updated the README and the API documentation.

…time, but since Fluent requires the ability to open multiple connections to the same database even when it's memory-only, emulate it by using temporary files on disk when a memory database is requested.
@gwynne gwynne added the semver-minor Contains new APIs label Sep 14, 2023
@gwynne gwynne requested review from 0xTim, MahdiBM and ptoffy September 14, 2023 17:05
@codecov-commenter
Copy link

codecov-commenter commented Sep 14, 2023

Codecov Report

Attention: Patch coverage is 70.00000% with 24 lines in your changes missing coverage. Please review.

Project coverage is 83.33%. Comparing base (25b05d7) to head (d098b5c).
Report is 12 commits behind head on main.

Files Patch % Lines
Sources/SQLiteKit/SQLiteDataEncoder.swift 40.74% 16 Missing ⚠️
Sources/SQLiteKit/SQLiteConnection+SQLKit.swift 50.00% 3 Missing ⚠️
Sources/SQLiteKit/SQLiteDataDecoder.swift 88.23% 2 Missing ⚠️
Sources/SQLiteKit/SQLiteDialect.swift 75.00% 2 Missing ⚠️
Sources/SQLiteKit/SQLiteConnectionSource.swift 95.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #105       +/-   ##
===========================================
+ Coverage   68.37%   83.33%   +14.95%     
===========================================
  Files           7        7               
  Lines         234      222       -12     
===========================================
+ Hits          160      185       +25     
+ Misses         74       37       -37     
Files Coverage Δ
Sources/SQLiteKit/SQLiteRow+SQLRow.swift 100.00% <100.00%> (+58.33%) ⬆️
Sources/SQLiteKit/SQLiteConnectionSource.swift 97.22% <95.00%> (+5.91%) ⬆️
Sources/SQLiteKit/SQLiteDataDecoder.swift 90.90% <88.23%> (+39.79%) ⬆️
Sources/SQLiteKit/SQLiteDialect.swift 86.66% <75.00%> (ø)
Sources/SQLiteKit/SQLiteConnection+SQLKit.swift 85.71% <50.00%> (ø)
Sources/SQLiteKit/SQLiteDataEncoder.swift 58.00% <40.74%> (+7.20%) ⬆️

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@gwynne gwynne merged commit 8a2f3df into main Sep 15, 2023
@gwynne gwynne deleted the revise-in-memory-database-handling branch September 15, 2023 14:05
@penny-for-vapor
Copy link

These changes are now available in 4.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-minor Contains new APIs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants