Merge branch 'develop'

This commit is contained in:
Helge Heß 2022-08-10 17:31:10 +02:00
commit 07c0cde980
No known key found for this signature in database
GPG Key ID: 0A3825768D88C07D
9 changed files with 112 additions and 4 deletions

7
.gitignore vendored
View File

@ -1 +1,6 @@
.DS_Store
.DS_Store
.build
update.sql
Package.resolved
.swiftpm

45
Lighter.json Normal file
View File

@ -0,0 +1,45 @@
{
"__doc__": "Configuration used for the manual, builtin codegen.",
"databaseExtensions" : [ "sqlite3", "db", "sqlite" ],
"sqlExtensions" : [ "sql" ],
"CodeStyle": {
"functionCommentStyle" : "**",
"indent" : " ",
"lineLength" : 80
},
"SwiftMapping": {
"databaseTypeName": "Northwind",
"recordTypeNames": {
"singularize" : true,
"capitalize" : true,
"camelCase" : true
}
},
"CodeGeneration": {
"readOnly" : false,
"generateAsyncFunctions" : true,
"inlinable" : true,
"public" : true,
"allowFoundation" : true,
"swiftFilters" : true,
"showViewHintComment" : false,
"commentsWithSQL" : true,
"extraRecordTypeConformances" : [ "Codable" ],
"embedRecordTypesInDatabaseType" : false,
"optionalHelpersInDatabase" : true,
"Raw": {
"prefix" : "sqlite3_",
"hashable" : true,
"relationships" : true,
},
"Lighter": {
"import" : "reexport",
"relationships" : true,
"useSQLiteValueTypeBinds" : false
}
}
}

26
Package.swift Normal file
View File

@ -0,0 +1,26 @@
// swift-tools-version:5.6
import PackageDescription
var package = Package(
name: "Northwind",
platforms: [ .macOS(.v10_15), .iOS(.v13) ],
products: [
.library(name: "Northwind", targets: [ "Northwind" ])
],
dependencies: [
.package(url: "git@github.com:55DB091A-8471-447B-8F50-5DFF4C1B14AC/Lighter.git",
from: "1.0.0"),
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0")
],
targets: [
.target(name : "Northwind",
dependencies : [ "Lighter" ],
path : "dist",
resources : [ .copy("northwind.db") ],
plugins : [ .plugin(name: "Enlighter", package: "Lighter") ])
]
)

26
Package@swift-5.7.swift Normal file
View File

@ -0,0 +1,26 @@
// swift-tools-version:5.7
import PackageDescription
var package = Package(
name: "Northwind",
platforms: [ .macOS(.v10_15), .iOS(.v13) ],
products: [
.library(name: "Northwind", targets: [ "Northwind" ])
],
dependencies: [
.package(url: "git@github.com:55DB091A-8471-447B-8F50-5DFF4C1B14AC/Lighter.git",
from: "1.0.0"),
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0")
],
targets: [
.target(name : "Northwind",
dependencies : [ "Lighter" ],
path : "dist",
resources : [ .copy("northwind.db") ],
plugins : [ .plugin(name: "Enlighter", package: "Lighter") ])
]
)

View File

@ -1,4 +1,9 @@
# Northwind-SQLite3
# Northwind-SQLite3.swift
2022-08-04: A fork of Northwind-SQLite3 which packages Northwind as a Swift
module.
<hr />
This is a version of the Microsoft Access 2000 Northwind sample database, re-engineered for SQLite3.

0
dist/MarkAsSwift.swift vendored Normal file
View File

BIN
dist/northwind.db vendored

Binary file not shown.

View File

@ -11,6 +11,7 @@ clean:
mkdir ./dist
build: clean
touch dist/MarkAsSwift.swift
sqlite3 dist/northwind.db < src/create.sql > /dev/null
sqlite3 dist/northwind.db < src/update.sql > /dev/null
sqlite3 dist/northwind.db < src/report.sql

View File

@ -83,6 +83,6 @@ p.*,
c.CategoryName, c.Description as [CategoryDescription],
s.CompanyName as [SupplierName], s.Region as [SupplierRegion]
from [Products] p
join [Categories] c on p.CategoryId = c.id
join [Suppliers] s on s.id = p.SupplierId;
join [Categories] c on p.CategoryId = c.CategoryId
join [Suppliers] s on s.SupplierId = p.SupplierId;