Skip to content
This repository has been archived by the owner on Aug 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #18 from 0xLeif/develop
Browse files Browse the repository at this point in the history
Version 0.2.0
  • Loading branch information
0xLeif authored Jul 15, 2020
2 parents c1a85bb + fc8ac4e commit cb77116
Show file tree
Hide file tree
Showing 8 changed files with 322 additions and 258 deletions.
88 changes: 35 additions & 53 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -2,93 +2,75 @@
"object": {
"pins": [
{
"package": "Console",
"repositoryURL": "https://github.com/vapor/console.git",
"package": "async-kit",
"repositoryURL": "https://github.com/0xLeif/async-kit.git",
"state": {
"branch": null,
"revision": "74cfbea629d4aac34a97cead2447a6870af1950b",
"version": "3.1.1"
"branch": "master",
"revision": "01ae20f158bdc11711774467716ee552527a1fff",
"version": null
}
},
{
"package": "Core",
"repositoryURL": "https://github.com/vapor/core.git",
"package": "fluent-kit",
"repositoryURL": "https://github.com/0xLeif/fluent-kit.git",
"state": {
"branch": null,
"revision": "10d33362a47fab03a067e78fb0791341d9c634fa",
"version": "3.9.3"
"branch": "master",
"revision": "8f2b1f7c9298b6952423dc16d1bfb77c9f295699",
"version": null
}
},
{
"package": "DatabaseKit",
"repositoryURL": "https://github.com/vapor/database-kit.git",
"package": "fluent-sqlite-driver",
"repositoryURL": "https://github.com/0xLeif/fluent-sqlite-driver.git",
"state": {
"branch": null,
"revision": "8f352c8e66dab301ab9bfef912a01ce1361ba1e4",
"version": "1.3.3"
"branch": "master",
"revision": "59b058c305aca604b66b5e95bb32f6bde1205554",
"version": null
}
},
{
"package": "Fluent",
"repositoryURL": "https://github.com/vapor/fluent.git",
"package": "sql-kit",
"repositoryURL": "https://github.com/vapor/sql-kit.git",
"state": {
"branch": null,
"revision": "783819d8838d15e1a05b459aa0fd1bde1e37ac26",
"version": "3.2.1"
"revision": "8b82edd5d918068f204e3ac4206d5d15f6740395",
"version": "3.5.0"
}
},
{
"package": "FluentSQLite",
"repositoryURL": "https://github.com/vapor/fluent-sqlite-driver.git",
"package": "sqlite-kit",
"repositoryURL": "https://github.com/0xLeif/sqlite-kit.git",
"state": {
"branch": null,
"revision": "c32f5bda84bf4ea691d19afe183d40044f579e11",
"version": "3.0.0"
"branch": "master",
"revision": "46bdd64c73925c6e0d5d30dbf621243442ee0b3e",
"version": null
}
},
{
"package": "Service",
"repositoryURL": "https://github.com/vapor/service.git",
"package": "sqlite-nio",
"repositoryURL": "https://github.com/vapor/sqlite-nio.git",
"state": {
"branch": null,
"revision": "fa5b5de62bd68bcde9a69933f31319e46c7275fb",
"version": "1.0.2"
"branch": "master",
"revision": "af884d7f01f4dd93b2844c1f0dd2bf0fd24f04d3",
"version": null
}
},
{
"package": "SQL",
"repositoryURL": "https://github.com/vapor/sql.git",
"package": "swift-log",
"repositoryURL": "https://github.com/apple/swift-log.git",
"state": {
"branch": null,
"revision": "50eaeb8f52a1ce63f1ff3880e1114dd8757a78a6",
"version": "2.3.2"
}
},
{
"package": "SQLite",
"repositoryURL": "https://github.com/vapor/sqlite.git",
"state": {
"branch": null,
"revision": "314d9cd21165bcf14215e336a23ff8214f40e411",
"version": "3.2.1"
"revision": "57c6bd04256ba47590ee2285e208f731210c5c10",
"version": "1.3.0"
}
},
{
"package": "swift-nio",
"repositoryURL": "https://github.com/apple/swift-nio.git",
"state": {
"branch": null,
"revision": "8da5c5a4e6c5084c296b9f39dc54f00be146e0fa",
"version": "1.14.2"
}
},
{
"package": "swift-nio-zlib-support",
"repositoryURL": "https://github.com/apple/swift-nio-zlib-support.git",
"state": {
"branch": null,
"revision": "37760e9a52030bb9011972c5213c3350fa9d41fd",
"version": "1.0.0"
"revision": "8a865bd15e69526cbdfcfd7c47698eb20b2ba951",
"version": "2.19.0"
}
}
]
Expand Down
17 changes: 14 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import PackageDescription
let package = Package(
name: "FLite",
platforms: [
.iOS("11.0")
.iOS("13.0"),
.macOS("10.15")
],
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
Expand All @@ -17,14 +18,24 @@ let package = Package(
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(url: "https://github.com/vapor/fluent-sqlite-driver.git", from: "3.0.0")
.package(url: "https://github.com/0xLeif/fluent-sqlite-driver.git", .branch("master")),
.package(url: "https://github.com/vapor/sqlite-nio.git", .branch("master")),
.package(url: "https://github.com/0xLeif/sqlite-kit.git", .branch("master")),
.package(url: "https://github.com/0xLeif/fluent-kit.git", .branch("master")),
.package(url: "https://github.com/0xLeif/async-kit.git", .branch("master"))
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "FLite",
dependencies: ["FluentSQLite"]),
dependencies: [
.product(name: "FluentSQLiteDriver", package: "fluent-sqlite-driver"),
.product(name: "SQLiteNIO", package: "sqlite-nio"),
.product(name: "SQLiteKit", package: "sqlite-kit"),
.product(name: "FluentKit", package: "fluent-kit"),
.product(name: "AsyncKit", package: "async-kit")
]),
.testTarget(
name: "FLiteTests",
dependencies: ["FLite"]),
Expand Down
38 changes: 30 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,40 @@
# FLite

FluentSQLite --> F + Lite -- > FLite
## FluentSQLiteDriver --> F + Lite -- > FLite

Example Use:
### Example Uses:

#### FLite.main
```
FLite.storage = .memory
// Use FLite.main
// Default Storage Type: Memory
FLite.prepare(model: Todo.self)
FLite.create(model: Todo(title: "Hello World"))
try? FLite.prepare(migration: Todo.self).wait()
FLite.fetch(model: Todo.self) { values in
print(values)
try! FLite.add(model: Todo(title: "Hello World", strings: ["hello", "world"])).wait()
FLite.fetch(model: Todo.self)
.whenSuccess { (values) in
print(values)
}
```

#### FLite.init(...)
```
// Create your own FLite
let flite = FLite(threads: 30,
configuration: .sqlite(.memory, maxConnectionsPerEventLoop: 30),
id: .sqlite,
logger: Logger(label: "Custom.FLITE"))
try? flite.prepare(migration: Todo.self).wait()
try! flite.add(model: Todo(title: "Hello World", strings: ["hello", "world"])).wait()
flite.fetch(model: Todo.self)
.whenSuccess { (values) in
print(values)
}
```

Expand Down
Loading

0 comments on commit cb77116

Please sign in to comment.