You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-39Lines changed: 4 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -295,7 +295,7 @@ Documentation
295
295
#### Records and the Query Interface
296
296
297
297
- [Records](#records): Fetching and persistence methods for your custom structs and class hierarchies
298
-
- [Query Interface](#the-query-interface): A swift way to generate SQL • [create tables](https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/databaseschema) • [requests](#requests) • [associations between record types](Documentation/AssociationsBasics.md)
298
+
- [Query Interface](#the-query-interface): A swift way to generate SQL • [create tables, indexes, etc](https://swiftpackageindex.com/groue/grdb.swift/v7.0.0-beta.5/documentation/grdb/databaseschema) • [requests](#requests) • [associations between record types](Documentation/AssociationsBasics.md)
299
299
300
300
#### Application Tools
301
301
@@ -441,7 +441,7 @@ Advanced topics:
441
441
442
442
- [Prepared Statements]
443
443
- [Custom SQL Functions and Aggregates](#custom-sql-functions-and-aggregates)
GRDB comes with a set of schema introspection methods:
1602
-
1603
-
```swift
1604
-
try dbQueue.read { db in
1605
-
// Bool, true if the table exists
1606
-
try db.tableExists("player")
1607
-
1608
-
// [ColumnInfo], the columns in the table
1609
-
try db.columns(in: "player")
1610
-
1611
-
// PrimaryKeyInfo
1612
-
try db.primaryKey("player")
1613
-
1614
-
// [ForeignKeyInfo], the foreign keys defined on the table
1615
-
try db.foreignKeys(on: "player")
1616
-
1617
-
// [IndexInfo], the indexes defined on the table
1618
-
try db.indexes(on: "player")
1619
-
1620
-
// Bool, true if column(s) is a unique key (primary key or unique index)
1621
-
try db.table("player", hasUniqueKey: ["email"])
1622
-
}
1623
-
1624
-
// Bool, true if argument is the name of an internal SQLite table
1625
-
Database.isSQLiteInternalTable(...)
1626
-
1627
-
// Bool, true if argument is the name of an internal GRDB table
1628
-
Database.isGRDBInternalTable(...)
1629
-
```
1630
-
1631
-
For more information, see [`tableExists(_:)`](https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/database/tableexists(_:)) and related methods.
1632
-
1633
-
1634
1599
## Raw SQLite Pointers
1635
1600
1636
1601
**If not all SQLite APIs are exposed in GRDB, you can still use the [SQLite C Interface](https://www.sqlite.org/c3ref/intro.html) and call [SQLite C functions](https://www.sqlite.org/c3ref/funclist.html).**
@@ -1678,7 +1643,7 @@ try dbQueue.write { db in
1678
1643
}
1679
1644
```
1680
1645
1681
-
Of course, you need to open a [database connection], and [create database tables](https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/databaseschema) first.
1646
+
Of course, you need to open a [database connection], and [create database tables](https://swiftpackageindex.com/groue/grdb.swift/v7.0.0-beta.5/documentation/grdb/databaseschema) first.
1682
1647
1683
1648
To define a record type, define a type and extend it with protocols that come with focused sets of features.
1684
1649
@@ -3285,7 +3250,7 @@ So don't miss the [SQL API](#sqlite-api).
3285
3250
3286
3251
> **Note**: the generated SQL may change between GRDB releases, without notice: don't have your application rely on any specific SQL output.
0 commit comments