Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
tags:
- 'v*'
- '[0-9]*'
workflow_dispatch:

jobs:

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
format_check_enabled : true
broken_symlink_check_enabled : true
unacceptable_language_check_enabled : true
shell_check_enabled : true
shell_check_enabled : false
docs_check_enabled : false
api_breakage_check_enabled : false
license_header_check_enabled : false
Expand All @@ -28,7 +28,7 @@ jobs:
uses: BinaryBirds/github-workflows/.github/workflows/extra_soundness.yml@main
with:
local_swift_dependencies_check_enabled : true
headers_check_enabled : true
headers_check_enabled : false
docc_warnings_check_enabled : true

swiftlang_tests:
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ SHELL=/bin/bash

baseUrl = https://raw.githubusercontent.com/BinaryBirds/github-workflows/refs/heads/main/scripts

check: symlinks language deps lint headers
check: symlinks language deps lint headers docc-warnings package

package:
curl -s $(baseUrl)/check-swift-package.sh | bash

symlinks:
curl -s $(baseUrl)/check-broken-symlinks.sh | bash
Expand Down
6 changes: 3 additions & 3 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 16 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,30 @@ let package = Package(
dependencies: [
.package(url: "https://github.com/apple/swift-log", from: "1.6.0"),
.package(url: "https://github.com/vapor/sqlite-nio", from: "1.12.0"),
.package(url: "https://github.com/feather-framework/feather-database", exact: "1.0.0-beta.2"),
.package(url: "https://github.com/feather-framework/feather-database", exact: "1.0.0-beta.3"),
// [docc-plugin-placeholder]
],
targets: [
.target(
name: "FeatherSQLiteDatabase",
name: "SQLiteNIOExtras",
dependencies: [
.product(name: "Logging", package: "swift-log"),
.product(name: "SQLiteNIO", package: "sqlite-nio"),
],
swiftSettings: defaultSwiftSettings
),
.target(
name: "FeatherSQLiteDatabase",
dependencies: [
.product(name: "FeatherDatabase", package: "feather-database"),
.target(name: "SQLiteNIOExtras"),
],
swiftSettings: defaultSwiftSettings
),
.testTarget(
name: "SQLiteNIOExtrasTests",
dependencies: [
.target(name: "SQLiteNIOExtras"),
],
swiftSettings: defaultSwiftSettings
),
Expand Down
86 changes: 40 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,37 @@

SQLite driver implementation for the abstract [Feather Database](https://github.com/feather-framework/feather-database) Swift API package.

[
![Release: 1.0.0-beta.2](https://img.shields.io/badge/Release-1%2E0%2E0--beta%2E2-F05138)
](
https://github.com/feather-framework/feather-sqlite-database/releases/tag/1.0.0-beta.2
)
[![Release: 1.0.0-beta.3](https://img.shields.io/badge/Release-1%2E0%2E0--beta%2E3-F05138)](https://github.com/feather-framework/feather-sqlite-database/releases/tag/1.0.0-beta.3)

## Features

- 🤝 SQLite driver for Feather Database
- 😱 Automatic query parameter escaping via Swift string interpolation.
- 🔄 Async sequence query results with `Decodable` row support.
- 🧵 Designed for modern Swift concurrency
- 📚 DocC-based API Documentation
- Unit tests and code coverage
- SQLite driver for Feather Database
- Automatic query parameter escaping via Swift string interpolation.
- Async sequence query results with `Decodable` row support.
- Designed for modern Swift concurrency
- DocC-based API Documentation
- Unit tests and code coverage

## Requirements

![Swift 6.1+](https://img.shields.io/badge/Swift-6%2E1%2B-F05138)
![Platforms: Linux, macOS, iOS, tvOS, watchOS, visionOS](https://img.shields.io/badge/Platforms-Linux_%7C_macOS_%7C_iOS_%7C_tvOS_%7C_watchOS_%7C_visionOS-F05138)

- Swift 6.1+

- Platforms:
- Linux
- macOS 15+
- iOS 18+
- tvOS 18+
- watchOS 11+
- visionOS 2+
- Swift 6.1+
- Platforms:
- Linux
- macOS 15+
- iOS 18+
- tvOS 18+
- watchOS 11+
- visionOS 2+

## Installation

Add the dependency to your `Package.swift`:

```swift
.package(url: "https://github.com/feather-framework/feather-sqlite-database", exact: "1.0.0-beta.2"),
.package(url: "https://github.com/feather-framework/feather-sqlite-database", exact: "1.0.0-beta.3"),
```

Then add `FeatherSQLiteDatabase` to your target dependencies:
Expand All @@ -46,19 +41,13 @@ Then add `FeatherSQLiteDatabase` to your target dependencies:
.product(name: "FeatherSQLiteDatabase", package: "feather-sqlite-database"),
```


## Usage

[
![DocC API documentation](https://img.shields.io/badge/DocC-API_documentation-F05138)
](
https://feather-framework.github.io/feather-sqlite-database/documentation/feathersqlitedatabase/
)

API documentation is available at the following link.
API documentation is available at the link below:

[![DocC API documentation](https://img.shields.io/badge/DocC-API_documentation-F05138)](https://feather-framework.github.io/feather-sqlite-database/)

> [!TIP]
> Avoid calling `database.execute` while in a transaction; use the transaction `connection` instead.
Here is a brief example:

```swift
import Logging
Expand All @@ -75,19 +64,25 @@ let configuration = SQLiteClient.Configuration(
)

let client = SQLiteClient(configuration: configuration)
try await client.run()

let database = SQLiteDatabaseClient(client: client)

let result = try await database.execute(
query: #"""
SELECT
sqlite_version() AS "version"
WHERE
1=\#(1);
"""#
let database = SQLiteDatabaseClient(
client: client,
logger: logger
)

try await client.run()

try await database.withConnection { connection in
try await connection.run(
query: #"""
SELECT
sqlite_version() AS "version"
WHERE
1=\#(1);
"""#
)
}

for try await item in result {
let version = try item.decode(column: "version", as: String.self)
print(version)
Expand All @@ -99,7 +94,6 @@ await client.shutdown()
> [!WARNING]
> This repository is a work in progress, things can break until it reaches v1.0.0.


## Other database drivers

The following database driver implementations are available for use:
Expand All @@ -110,12 +104,12 @@ The following database driver implementations are available for use:
## Development

- Build: `swift build`
- Test:
- local: `swift test`
- using Docker: `make docker-test`
- Test:
- local: `swift test`
- using Docker: `make docker-test`
- Format: `make format`
- Check: `make check`

## Contributing

[Pull requests](https://github.com/feather-framework/feather-sqlite-database/pulls) are welcome. Please keep changes focused and include tests for new logic. 🙏
[Pull requests](https://github.com/feather-framework/feather-sqlite-database/pulls) are welcome. Please keep changes focused and include tests for new logic.
48 changes: 0 additions & 48 deletions Sources/FeatherSQLiteDatabase/SQLiteConnection.swift

This file was deleted.

Loading