Skip to content

Commit

Permalink
Update docs to reflect rename of Expression to SQLExpression
Browse files Browse the repository at this point in the history
  • Loading branch information
marcprux committed Dec 1, 2024
1 parent ea08bd5 commit 7a25bac
Show file tree
Hide file tree
Showing 10 changed files with 95 additions and 323 deletions.
270 changes: 64 additions & 206 deletions Documentation/Index.md

Large diffs are not rendered by default.

29 changes: 0 additions & 29 deletions Documentation/Linux.md

This file was deleted.

33 changes: 0 additions & 33 deletions Documentation/Planning.md

This file was deleted.

13 changes: 0 additions & 13 deletions Documentation/Release.md

This file was deleted.

Binary file removed Documentation/Resources/[email protected]
Binary file not shown.
Binary file removed Documentation/Resources/[email protected]
Binary file not shown.
9 changes: 0 additions & 9 deletions Documentation/Upgrading.md

This file was deleted.

14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and works out-of-the-box on macOS, iOS, Linux, Android, and Windows.
- A pure-Swift interface
- A type-safe, optional-aware SQL expression builder
- A flexible, chainable, lazy-executing query layer
- Uses a built-in, modern sqlite version
- Automatically-typed data access
- A lightweight, uncomplicated query and parameter binding interface
- Developer-friendly error handling and debugging
Expand All @@ -18,7 +19,7 @@ and works out-of-the-box on macOS, iOS, Linux, Android, and Windows.
- Extensively tested
- [SQLCipher][] support
- [Schema query/migration][]
- Works on Android, Windows, and [Linux](Documentation/Linux.md) (with some limitations)
- Works on iOS, macOS, Android, Windows, and Linux

[SQLCipher]: https://www.zetetic.net/sqlcipher/
[Full-text search]: Documentation/Index.md#full-text-search
Expand All @@ -36,9 +37,9 @@ do {
let db = try Connection("path/to/db.sqlite3")

let users = Table("users")
let id = Expression<Int64>("id")
let name = Expression<String?>("name")
let email = Expression<String>("email")
let id = SQLExpression<Int64>("id")
let name = SQLExpression<String?>("name")
let email = SQLExpression<String>("email")

try db.run(users.create { t in
t.column(id, primaryKey: true)
Expand Down Expand Up @@ -77,7 +78,7 @@ do {
}
```

SQLite.swift also works as a lightweight, Swift-friendly wrapper over the C
SQLiteDB also works as a lightweight, Swift-friendly wrapper over the C
API.

```swift
Expand Down Expand Up @@ -143,7 +144,6 @@ Swift code.
- Found a **bug** or have a **feature request**? [Open an issue][].
- Want to **contribute**? [Submit a pull request][].

[See the planning document]: /Documentation/Planning.md
[Read the contributing guidelines]: ./CONTRIBUTING.md#contributing
[Ask on Stack Overflow]: https://stackoverflow.com/questions/tagged/sqlite.swift
[Open an issue]: https://github.com/skiptools/swift-sqlite/issues/new
Expand All @@ -167,8 +167,6 @@ Looking for something else? Try another Swift wrapper (or [FMDB][]):

- [SQLite.swift](https://github.com/stephencelis/SQLite.swift)
- [GRDB](https://github.com/groue/GRDB.swift)
- [SQLiteDB](https://github.com/FahimF/SQLiteDB)
- [Squeal](https://github.com/nerdyc/Squeal)

[Swift]: https://swift.org/
[SQLite3]: https://www.sqlite.org
Expand Down
4 changes: 2 additions & 2 deletions Sources/SQLiteDB/Typed/Query+with.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ extension QueryType {
/// Sets a `WITH` clause on the query.
///
/// let users = Table("users")
/// let id = Expression<String>("email")
/// let name = Expression<String?>("name")
/// let id = SQLExpression<String>("email")
/// let name = SQLExpression<String?>("name")
///
/// let userNames = Table("user_names")
/// userCategories.with(userNames, as: users.select(name))
Expand Down
46 changes: 23 additions & 23 deletions Sources/SQLiteDB/Typed/Query.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ extension SchemaType {
/// Builds a copy of the query with the `SELECT` clause applied.
///
/// let users = Table("users")
/// let id = Expression<Int64>("id")
/// let email = Expression<String>("email")
/// let id = SQLExpression<Int64>("id")
/// let email = SQLExpression<String>("email")
///
/// users.select(id, email)
/// // SELECT "id", "email" FROM "users"
Expand All @@ -58,7 +58,7 @@ extension SchemaType {
/// Builds a copy of the query with the `SELECT DISTINCT` clause applied.
///
/// let users = Table("users")
/// let email = Expression<String>("email")
/// let email = SQLExpression<String>("email")
///
/// users.select(distinct: email)
/// // SELECT DISTINCT "email" FROM "users"
Expand All @@ -73,8 +73,8 @@ extension SchemaType {
/// Builds a copy of the query with the `SELECT` clause applied.
///
/// let users = Table("users")
/// let id = Expression<Int64>("id")
/// let email = Expression<String>("email")
/// let id = SQLExpression<Int64>("id")
/// let email = SQLExpression<String>("email")
///
/// users.select([id, email])
/// // SELECT "id", "email" FROM "users"
Expand All @@ -89,7 +89,7 @@ extension SchemaType {
/// Builds a copy of the query with the `SELECT DISTINCT` clause applied.
///
/// let users = Table("users")
/// let email = Expression<String>("email")
/// let email = SQLExpression<String>("email")
///
/// users.select(distinct: [email])
/// // SELECT DISTINCT "email" FROM "users"
Expand Down Expand Up @@ -132,7 +132,7 @@ extension SchemaType {
/// Builds a scalar copy of the query with the `SELECT` clause applied.
///
/// let users = Table("users")
/// let id = Expression<Int64>("id")
/// let id = SQLExpression<Int64>("id")
///
/// users.select(id)
/// // SELECT "id" FROM "users"
Expand All @@ -151,7 +151,7 @@ extension SchemaType {
/// applied.
///
/// let users = Table("users")
/// let email = Expression<String>("email")
/// let email = SQLExpression<String>("email")
///
/// users.select(distinct: email)
/// // SELECT DISTINCT "email" FROM "users"
Expand Down Expand Up @@ -186,7 +186,7 @@ extension QueryType {
/// Adds a `UNION` clause to the query.
///
/// let users = Table("users")
/// let email = Expression<String>("email")
/// let email = SQLExpression<String>("email")
///
/// users.filter(email == "[email protected]").union(users.filter(email == "[email protected]"))
/// // SELECT * FROM "users" WHERE email = '[email protected]' UNION SELECT * FROM "users" WHERE email = '[email protected]'
Expand All @@ -209,9 +209,9 @@ extension QueryType {
/// Adds a `JOIN` clause to the query.
///
/// let users = Table("users")
/// let id = Expression<Int64>("id")
/// let id = SQLExpression<Int64>("id")
/// let posts = Table("posts")
/// let userId = Expression<Int64>("user_id")
/// let userId = SQLExpression<Int64>("user_id")
///
/// users.join(posts, on: posts[userId] == users[id])
/// // SELECT * FROM "users" INNER JOIN "posts" ON ("posts"."user_id" = "users"."id")
Expand All @@ -230,9 +230,9 @@ extension QueryType {
/// Adds a `JOIN` clause to the query.
///
/// let users = Table("users")
/// let id = Expression<Int64>("id")
/// let id = SQLExpression<Int64>("id")
/// let posts = Table("posts")
/// let userId = Expression<Int64?>("user_id")
/// let userId = SQLExpression<Int64?>("user_id")
///
/// users.join(posts, on: posts[userId] == users[id])
/// // SELECT * FROM "users" INNER JOIN "posts" ON ("posts"."user_id" = "users"."id")
Expand All @@ -251,9 +251,9 @@ extension QueryType {
/// Adds a `JOIN` clause to the query.
///
/// let users = Table("users")
/// let id = Expression<Int64>("id")
/// let id = SQLExpression<Int64>("id")
/// let posts = Table("posts")
/// let userId = Expression<Int64>("user_id")
/// let userId = SQLExpression<Int64>("user_id")
///
/// users.join(.LeftOuter, posts, on: posts[userId] == users[id])
/// // SELECT * FROM "users" LEFT OUTER JOIN "posts" ON ("posts"."user_id" = "users"."id")
Expand All @@ -274,9 +274,9 @@ extension QueryType {
/// Adds a `JOIN` clause to the query.
///
/// let users = Table("users")
/// let id = Expression<Int64>("id")
/// let id = SQLExpression<Int64>("id")
/// let posts = Table("posts")
/// let userId = Expression<Int64?>("user_id")
/// let userId = SQLExpression<Int64?>("user_id")
///
/// users.join(.LeftOuter, posts, on: posts[userId] == users[id])
/// // SELECT * FROM "users" LEFT OUTER JOIN "posts" ON ("posts"."user_id" = "users"."id")
Expand All @@ -302,7 +302,7 @@ extension QueryType {
/// Adds a condition to the query’s `WHERE` clause.
///
/// let users = Table("users")
/// let id = Expression<Int64>("id")
/// let id = SQLExpression<Int64>("id")
///
/// users.filter(id == 1)
/// // SELECT * FROM "users" WHERE ("id" = 1)
Expand All @@ -317,7 +317,7 @@ extension QueryType {
/// Adds a condition to the query’s `WHERE` clause.
///
/// let users = Table("users")
/// let age = Expression<Int?>("age")
/// let age = SQLExpression<Int?>("age")
///
/// users.filter(age >= 35)
/// // SELECT * FROM "users" WHERE ("age" >= 35)
Expand Down Expand Up @@ -426,8 +426,8 @@ extension QueryType {
/// Sets an `ORDER BY` clause on the query.
///
/// let users = Table("users")
/// let email = Expression<String>("email")
/// let name = Expression<String?>("name")
/// let email = SQLExpression<String>("email")
/// let name = SQLExpression<String?>("name")
///
/// users.order(email.desc, name.asc)
/// // SELECT * FROM "users" ORDER BY "email" DESC, "name" ASC
Expand All @@ -442,8 +442,8 @@ extension QueryType {
/// Sets an `ORDER BY` clause on the query.
///
/// let users = Table("users")
/// let email = Expression<String>("email")
/// let name = Expression<String?>("name")
/// let email = SQLExpression<String>("email")
/// let name = SQLExpression<String?>("name")
///
/// users.order([email.desc, name.asc])
/// // SELECT * FROM "users" ORDER BY "email" DESC, "name" ASC
Expand Down

0 comments on commit 7a25bac

Please sign in to comment.