Skip to content

Commit b9569fe

Browse files
committed
Merge branch 'release-2.1.0'
2 parents af5a782 + 65f0a2a commit b9569fe

28 files changed

+168
-47
lines changed

.travis.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: objective-c
22

33
os: osx
4-
osx_image: xcode11
4+
osx_image: xcode11.6
55

66
xcode_project: Restructure.xcodeproj
77

@@ -11,22 +11,22 @@ xcode_scheme:
1111
- Restructure tvOS
1212

1313
xcode_sdk:
14-
- iphonesimulator13.0
14+
- iphonesimulator13.6
1515
- macosx10.15
16-
- appletvsimulator13.0
16+
- appletvsimulator13.4
1717

1818
matrix:
1919
exclude:
2020
- xcode_scheme: Restructure iOS
2121
xcode_sdk: macosx10.15
2222
- xcode_scheme: Restructure iOS
23-
xcode_sdk: appletvsimulator13.0
23+
xcode_sdk: appletvsimulator13.4
2424
- xcode_scheme: Restructure macOS
25-
xcode_sdk: iphonesimulator13.0
25+
xcode_sdk: iphonesimulator13.6
2626
- xcode_scheme: Restructure macOS
27-
xcode_sdk: appletvsimulator13.0
27+
xcode_sdk: appletvsimulator13.4
2828
- xcode_scheme: Restructure tvOS
29-
xcode_sdk: iphonesimulator13.0
29+
xcode_sdk: iphonesimulator13.6
3030
- xcode_scheme: Restructure tvOS
3131
xcode_sdk: macosx10.15
3232

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## 2.1.0 2020-08-16
9+
### Added
10+
- `sqliteVersion` fetches the underlying SQLite version string.
11+
- Dynamic member lookup is enabled for `Row`, allowing for direct access to values via property notation.
12+
13+
### Removed
14+
- `JournalMode.off` has been removed because of defensive configs.
15+
816
## 2.0.0 - 2019-09-12
917
### Added
1018
- `AutoVacuum` dictates the automatic vacuuming mode.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2019 Stephen H. Gerstacker
1+
Copyright (c) 2020 Stephen H. Gerstacker
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Restructure
22

3-
[![Build Status](https://travis-ci.org/stack/Restructure.svg?branch=swift-5.1)](https://travis-ci.org/stack/Restructure)
4-
![Swift 5.1](https://img.shields.io/badge/Swift-5.0-orange.svg)
3+
[![Build Status](https://travis-ci.org/stack/Restructure.svg)](https://travis-ci.org/stack/Restructure)
4+
![Swift 5.1](https://img.shields.io/badge/Swift-5.1-orange.svg)
55

66
Restructure is a wrapper library for [SQLite](https://sqlite.org/index.html) for
77
iOS, macOS, and tvOS. It's fairly opinionated, as in, it does exactly what I
@@ -185,6 +185,23 @@ for row in statement }
185185
}
186186
```
187187

188+
189+
### Rows support Dynamic Member Lookup
190+
191+
You can extract data from a row with direct property access using Dynamic Member Lookup.
192+
193+
```swift
194+
let statement = try! restructure.prepare(query: "SELECT a, b, c, d, e FROM foo LIMIT 1")
195+
196+
guard case let .row(row) = statement.step() else {
197+
/// Handle error
198+
}
199+
200+
let a: Int = row.a
201+
let b: String = row.b
202+
let c: Double = row.c
203+
```
204+
188205
### Migrations
189206

190207
The Restructure object has a `userVersion` property to track the version of a

Sources/Restructure/ArrayStrategy.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Restructure
44
//
55
// Created by Stephen H. Gerstacker on 11/10/18.
6-
// Copyright @ 2019 Stephen H. Gerstacker. All rights reserved.
6+
// Copyright @ 2020 Stephen H. Gerstacker. All rights reserved.
77
//
88

99
import Foundation

Sources/Restructure/AutoVacuum.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Restructure
44
//
55
// Created by Stephen H. Gerstacker on 8/12/19.
6-
// Copyright @ 2019 Stephen H. Gerstacker. All rights reserved.
6+
// Copyright @ 2020 Stephen H. Gerstacker. All rights reserved.
77
//
88

99
import Foundation

Sources/Restructure/Date+Julian.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Restructure
44
//
55
// Created by Stephen H. Gerstacker on 11/4/18.
6-
// Copyright @ 2019 Stephen H. Gerstacker. All rights reserved.
6+
// Copyright @ 2020 Stephen H. Gerstacker. All rights reserved.
77
//
88

99
import Foundation

Sources/Restructure/DateStrategy.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Restructure
44
//
55
// Created by Stephen H. Gerstacker on 11/4/18.
6-
// Copyright @ 2019 Stephen H. Gerstacker. All rights reserved.
6+
// Copyright @ 2020 Stephen H. Gerstacker. All rights reserved.
77
//
88

99
import Foundation

Sources/Restructure/JournalMode.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Restructure
44
//
55
// Created by Stephen H. Gerstacker on 8/12/19.
6-
// Copyright @ 2019 Stephen H. Gerstacker. All rights reserved.
6+
// Copyright @ 2020 Stephen H. Gerstacker. All rights reserved.
77
//
88

99
import Foundation
@@ -20,8 +20,6 @@ public enum JournalMode: CaseIterable, PragmaRepresentable {
2020
case memory
2121
/// A write-ahead log is used as opposed to a rollback journal. This is the default for a file-backed database.
2222
case wal
23-
/// No rollback journal is used.
24-
case off
2523

2624
/// Create a `JournalMode` from a SQlite representation
2725
static func from(value: String) -> JournalMode {
@@ -36,8 +34,6 @@ public enum JournalMode: CaseIterable, PragmaRepresentable {
3634
return .memory
3735
case "WAL":
3836
return .wal
39-
case "OFF":
40-
return .off
4137
default:
4238
fatalError("Unsupported JournalMode string: \(value)")
4339
}
@@ -56,8 +52,6 @@ public enum JournalMode: CaseIterable, PragmaRepresentable {
5652
return "MEMORY"
5753
case .wal:
5854
return "WAL"
59-
case .off:
60-
return "OFF"
6155
}
6256
}
6357
}

Sources/Restructure/PragmaRepresentable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Restructure
44
//
55
// Created by Stephen H. Gerstacker on 8/12/19.
6-
// Copyright @ 2019 Stephen H. Gerstacker. All rights reserved.
6+
// Copyright @ 2020 Stephen H. Gerstacker. All rights reserved.
77
//
88

99
import Foundation

0 commit comments

Comments
 (0)