Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ test:
swift test --parallel

docker-test:
docker build -t feather-sqlite-database-tests . -f ./docker/tests/Dockerfile && docker run --rm feather-sqlite-database-tests
docker build -t feather-database-sqlite-tests . -f ./docker/tests/Dockerfile && docker run --rm feather-database-sqlite-tests
18 changes: 18 additions & 0 deletions Package.resolved

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

12 changes: 6 additions & 6 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var defaultSwiftSettings: [SwiftSetting] =
// https://forums.swift.org/t/experimental-support-for-lifetime-dependencies-in-swift-6-2-and-beyond/78638
.enableExperimentalFeature("Lifetimes"),
// https://github.com/swiftlang/swift/pull/65218
.enableExperimentalFeature("AvailabilityMacro=featherSQLiteDatabase 1.0:macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0, visionOS 2.0"),
.enableExperimentalFeature("AvailabilityMacro=FeatherDatabaseSQLite 1.0:macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0, visionOS 2.0"),
]

#if compiler(>=6.2)
Expand All @@ -23,7 +23,7 @@ defaultSwiftSettings.append(


let package = Package(
name: "feather-sqlite-database",
name: "feather-database-sqlite",
platforms: [
.macOS(.v15),
.iOS(.v18),
Expand All @@ -32,7 +32,7 @@ let package = Package(
.visionOS(.v2),
],
products: [
.library(name: "FeatherSQLiteDatabase", targets: ["FeatherSQLiteDatabase"]),
.library(name: "FeatherDatabaseSQLite", targets: ["FeatherDatabaseSQLite"]),
],
traits: [
"ServiceLifecycleSupport",
Expand All @@ -59,7 +59,7 @@ let package = Package(
swiftSettings: defaultSwiftSettings
),
.target(
name: "FeatherSQLiteDatabase",
name: "FeatherDatabaseSQLite",
dependencies: [
.target(name: "SQLiteNIOExtras"),
.product(name: "FeatherDatabase", package: "feather-database"),
Expand All @@ -79,9 +79,9 @@ let package = Package(
swiftSettings: defaultSwiftSettings
),
.testTarget(
name: "FeatherSQLiteDatabaseTests",
name: "FeatherDatabaseSQLiteTests",
dependencies: [
.target(name: "FeatherSQLiteDatabase"),
.target(name: "FeatherDatabaseSQLite"),
.product(
name: "ServiceLifecycleTestKit",
package: "swift-service-lifecycle",
Expand Down
29 changes: 15 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
SQLite driver implementation for the abstract [Feather Database](https://github.com/feather-framework/feather-database) Swift API package.

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

## Features
Expand Down Expand Up @@ -36,13 +36,13 @@ SQLite driver implementation for the abstract [Feather Database](https://github.
Add the dependency to your `Package.swift`:

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

Then add `FeatherSQLiteDatabase` to your target dependencies:
Then add `FeatherDatabaseSQLite` to your target dependencies:

```swift
.product(name: "FeatherSQLiteDatabase", package: "feather-sqlite-database"),
.product(name: "FeatherDatabaseSQLite", package: "feather-database-sqlite"),
```

### Package traits
Expand All @@ -52,8 +52,8 @@ To enable an additional trait on the package, update the package dependency:

```diff
.package(
url: "https://github.com/feather-framework/feather-sqlite-database",
exact: "1.0.0-beta.4",
url: "https://github.com/feather-framework/feather-database-sqlite",
exact: "1.0.0-beta.8",
+ traits: [
+ .defaults,
+ "ServiceLifecycleSupport",
Expand All @@ -63,7 +63,7 @@ To enable an additional trait on the package, update the package dependency:

Available traits:

- `ServiceLifecycleSupport` (default): Adds support for `SQLiteClientService`, a `ServiceLifecycle.Service` implementation for managing SQLite clients.
- `ServiceLifecycleSupport` (default): Adds support for `DatabaseServiceSQLite`, a `ServiceLifecycle.Service` implementation for managing SQLite clients.


## Usage
Expand All @@ -73,16 +73,17 @@ 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/
https://feather-framework.github.io/feather-database-sqlite/
)

Here is a brief example:

```swift
import Logging
import SQLiteNIO
import SQLiteNIOExtras
import FeatherDatabase
import FeatherSQLiteDatabase
import FeatherDatabaseSQLite

var logger = Logger(label: "example")
logger.logLevel = .info
Expand All @@ -94,7 +95,7 @@ let configuration = SQLiteClient.Configuration(

let client = SQLiteClient(configuration: configuration)

let database = SQLiteDatabaseClient(
let database = DatabaseClientSQLite(
client: client,
logger: logger
)
Expand Down Expand Up @@ -127,8 +128,8 @@ await client.shutdown()

The following database driver implementations are available for use:

- [Postgres](https://github.com/feather-framework/feather-postgres-database)
- [MySQL](https://github.com/feather-framework/feather-mysql-database)
- [Postgres](https://github.com/feather-framework/feather-database-postgres)
- [MySQL](https://github.com/feather-framework/feather-database-mysql)

## Development

Expand All @@ -141,4 +142,4 @@ The following database driver implementations are available for use:

## 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-database-sqlite/pulls) are welcome. Please keep changes focused and include tests for new logic.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SQLiteDatabaseClient.swift
// feather-sqlite-database
// DatabaseClientSQLite.swift
// feather-database-sqlite
//
// Created by Tibor Bödecs on 2026. 01. 10..
//
Expand All @@ -12,9 +12,9 @@ import SQLiteNIOExtras
/// A SQLite-backed database client.
///
/// Use this client to execute queries and manage transactions on SQLite.
public struct SQLiteDatabaseClient: DatabaseClient {
public struct DatabaseClientSQLite: DatabaseClient {

public typealias Connection = SQLiteDatabaseConnection
public typealias Connection = DatabaseConnectionSQLite

let client: SQLiteClient
var logger: Logger
Expand Down Expand Up @@ -47,7 +47,7 @@ public struct SQLiteDatabaseClient: DatabaseClient {
do {
return try await client.withConnection { connection in
try await closure(
SQLiteDatabaseConnection(
DatabaseConnectionSQLite(
connection: connection,
logger: logger
)
Expand All @@ -72,7 +72,7 @@ public struct SQLiteDatabaseClient: DatabaseClient {
do {
return try await client.withTransaction { connection in
try await closure(
SQLiteDatabaseConnection(
DatabaseConnectionSQLite(
connection: connection,
logger: logger
)
Expand All @@ -81,7 +81,7 @@ public struct SQLiteDatabaseClient: DatabaseClient {
}
catch let error as SQLiteTransactionError {
throw .transaction(
SQLiteDatabaseTransactionError(
DatabaseTransactionErrorSQLite(
underlyingError: error
)
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SQLiteDatabaseConnection.swift
// feather-sqlite-database
// DatabaseConnectionSQLite.swift
// feather-database-sqlite
//
// Created by Tibor Bödecs on 2026. 01. 10.
//
Expand Down Expand Up @@ -45,9 +45,9 @@ extension DatabaseQuery {
}
}

public struct SQLiteDatabaseConnection: DatabaseConnection {
public struct DatabaseConnectionSQLite: DatabaseConnection {

public typealias RowSequence = SQLiteDatabaseRowSequence
public typealias RowSequence = DatabaseRowSequenceSQLite

var connection: SQLiteConnection
public var logger: Logger
Expand All @@ -72,7 +72,7 @@ public struct SQLiteDatabaseConnection: DatabaseConnection {
sqliteQuery.bindings
)
return try await handler(
SQLiteDatabaseRowSequence(
DatabaseRowSequenceSQLite(
elements: result.map {
.init(row: $0)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
//
// SQLiteDatabaseRow.swift
// feather-sqlite-database
// DatabaseRowSQLite.swift
// feather-database-sqlite
//
// Created by Tibor Bödecs on 2026. 01. 10.
//

import FeatherDatabase
import SQLiteNIO

public struct SQLiteDatabaseRow: DatabaseRow {
public struct DatabaseRowSQLite: DatabaseRow {
var row: SQLiteRow

struct SingleValueDecoder: Decoder, SingleValueDecodingContainer {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SQLiteDatabaseRowSequence.swift
// feather-sqlite-database
// DatabaseRowSequenceSQLite.swift
// feather-database-sqlite
//
// Created by Tibor Bödecs on 2026. 01. 10.
//
Expand All @@ -11,8 +11,8 @@ import SQLiteNIO
/// A query result backed by SQLite rows.
///
/// Use this type to iterate or collect SQLite query results.
public struct SQLiteDatabaseRowSequence: DatabaseRowSequence {
public typealias Row = SQLiteDatabaseRow
public struct DatabaseRowSequenceSQLite: DatabaseRowSequence {
public typealias Row = DatabaseRowSQLite

let elements: [Row]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SQLiteDatabaseService.swift
// feather-sqlite-database
// DatabaseServiceSQLite.swift
// feather-database-sqlite
//
// Created by Tibor Bödecs on 2026. 01. 29..
//
Expand All @@ -11,7 +11,7 @@ import SQLiteNIOExtras
import ServiceLifecycle

/// A `Service` wrapper around an `SQLiteClient`.
public struct SQLiteDatabaseService: Service {
public struct DatabaseServiceSQLite: Service {

/// The underlying SQLite client instance.
public var client: SQLiteClient
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SQLiteDatabaseTransactionError.swift
// feather-sqlite-database
// DatabaseTransactionErrorSQLite.swift
// feather-database-sqlite
//
// Created by Tibor Bödecs on 2026. 01. 10.
//
Expand All @@ -11,7 +11,7 @@ import SQLiteNIOExtras
/// Transaction error details for SQLite operations.
///
/// Use this to capture errors from transaction phases.
public struct SQLiteDatabaseTransactionError: DatabaseTransactionError {
public struct DatabaseTransactionErrorSQLite: DatabaseTransactionError {

var underlyingError: SQLiteTransactionError

Expand Down
2 changes: 1 addition & 1 deletion Sources/SQLiteNIOExtras/SQLiteClient.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SQLiteClient.swift
// feather-sqlite-database
// feather-database-sqlite
//
// Created by Tibor Bödecs on 2026. 01. 26..
//
Expand Down
2 changes: 1 addition & 1 deletion Sources/SQLiteNIOExtras/SQLiteConnectionPool.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SQLiteConnectionPool.swift
// feather-sqlite-database
// feather-database-sqlite
//
// Created by Tibor Bödecs on 2026. 01. 26..
//
Expand Down
2 changes: 1 addition & 1 deletion Sources/SQLiteNIOExtras/SQLiteConnectionPoolError.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SQLiteConnectionPoolError.swift
// feather-sqlite-database
// feather-database-sqlite
//
// Created by Tibor Bödecs on 2026. 02. 02..
//
Expand Down
2 changes: 1 addition & 1 deletion Sources/SQLiteNIOExtras/SQLiteTransactionError.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SQLiteTransactionError.swift
// feather-sqlite-database
// feather-database-sqlite
//
// Created by Tibor Bödecs on 2026. 02. 03..
//
Expand Down
Loading
Loading