Restructure
Restructure is a rewrite of my previous SQLite Swift library, Structure. The framework works on Swift 5 for iOS, macOS, and tvOS. It’s highly opinionated, because it does exactly what I wanted it to do, while also staying true to how SQLite behaves.
Restructure has the following features:
- Easy type conversion for common Swift data types.
- Simple handling of more complex data types, like arrays and dates.
- Statements are Sequences, making data iteration a part of the language.
- Statements are Encodable, making data structure transformation to SQLite statement simple.
- Rows are Decodable, making SQLite results easily transformable to data structures.
Check out the code on GitHub. There you will find examples, tests, and installation instructions.
Version History
2.1.2 - 2023-09-07
Fixed
- Closing a file-backed database no longer deletes the underlying file.
- In WAL journal mode, closing the database causes a WAL checkpoint.
2.1.1 - 2023-09-07
Fixed
- Storing a
Statementno longer causes a crash when cleaning up. - The
UPPERfunction properly handles memory management of strings.
2.1.0 – 2020-08-16
Added
sqliteVersionfetches the underlying SQLite version string.- Dynamic member lookup is enabled for
Row, allowing for direct access to values via property notation.
Removed
JournalMode.offhas been removed because of defensive configs.
2.0.0 – 2019-09-12
Added
AutoVacuumdictates the automatic vacuuming mode.JournalModedictates the journaling mode used by the database.SecureDeletedictates the data deletion mode.incrementalVacuumcan be used withAutoVacuum.incrementalto affect vacuuming.vacuumcauses a full database vacuum to occur.
Changed
- Restructure is now a SwiftPM project. All legacy build tools have been removed.
- The
Restructureconstructor takes a defaulted parameter for a journal mode.
1.0.0 – 2019-06-20
Added
- Created the primary
Restructureobject for maintaining SQLite databases. - Created the
Statementobject for working with prepared SQLite statements. - Created the
Rowobject for working with resultant rows from a Statement. - Created the
RowDecoderandStatementEncoderfor using Swift’s Decodable protocols.