Skip to content

Commit 0df644b

Browse files
committed
Update README.md
1 parent a64561f commit 0df644b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,19 @@ Copy folder `SQLiteAdapter` into your project.
4040
Usage
4141
-----
4242

43-
**Opening the database:**
43+
**Opening the database**
4444

4545
```swift
4646
import SQLiteAdapter
4747

48-
// The sqlite file will be created in the specified path if it has not yet been created
49-
let dbPath = try! (FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: false).appendingPathComponent("db.sqlite")).path
48+
let dbPath = try! (FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: false)
49+
.appendingPathComponent("db.sqlite")).path // the sqlite file will be created if it does not already exist
5050
let sqlite = try? SQLite(path: dbPath) // with 'recreate: true', the sqlite file will be deleted and recreated
5151

52-
print(sqlite.dbPath) // -> the path of the sqlite file
52+
print(sqlite.dbPath) // -> path of the sqlite file
5353
```
5454

55-
**Modeling and creating an SQL table:**
55+
**Modeling and creating a table**
5656

5757
```swift
5858
let sqlTable = SQLTable(
@@ -63,7 +63,7 @@ let sqlTable = SQLTable(
6363
("isDeleted", .BOOL),
6464
("updated", .DATE)
6565
],
66-
primaryKey: "id" // optionally ("id" by default)
66+
primaryKey: "id" // "id" by default
6767
)
6868

6969
let statementCreateTable = """
@@ -79,7 +79,7 @@ let statementCreateTable = """
7979
try? sqlite?.createTable(sql: statementCreateTable)
8080
```
8181

82-
**SQL operations:**
82+
**SQL operations**
8383

8484
```swift
8585
do {
@@ -124,15 +124,15 @@ let row = try sqlite.getByID(from: sqlTable, id: 10) // -> nil
124124
let changes = try sqlite.deleteAllRows(in: sqlTable) // -> 1
125125
```
126126

127-
**Optional settings:**
127+
**Optional settings**
128128

129129
```swift
130130
sqlite.dateFormatter.locale = Locale(identifier: "en_US_POSIX")
131131
sqlite.dateFormatter.timeZone = TimeZone(secondsFromGMT: 0)
132132
sqlite.dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
133133
```
134134

135-
More usage examples can be found in [SQLiteAdapterTests.swift](https://github.com/denissimon/SQLiteAdapter/blob/main/Tests/SQLiteAdapterTests/SQLiteAdapterTests.swift) and [iOS-MVVM-Clean-Architecture](https://github.com/denissimon/iOS-MVVM-Clean-Architecture) where this adapter was used.
135+
More usage examples can be found in [tests](https://github.com/denissimon/SQLiteAdapter/blob/main/Tests/SQLiteAdapterTests/SQLiteAdapterTests.swift) and [iOS-MVVM-Clean-Architecture](https://github.com/denissimon/iOS-MVVM-Clean-Architecture) where this adapter was used.
136136

137137
### Supported SQLite types
138138

0 commit comments

Comments
 (0)