Examples for the Lighter SQLite environment, SwiftUI and server side.
Note: The examples require Swift 5.7 / Xcode 14b for proper plugin support.
When embedding a package using Enlighter (like NorthwindSQLite.swift), a local package seems to be required w/ the Xcode 14 beta (3...5). Otherwise the Swift package plugins do not seem to run. In the example project this is the "AppLogic" package. If Xcode gets stuck or doesn't run the plugin, a package update sometimes help.
The Northwind database is a common database example that has been ported to SQLite. Lighter provides a Swift version of that in the NorthwindSQLite.swift repository.
Note: The particular SQLite version of the Northwind database is quite lacking. For example booleans are stored as TEXTs, many columns are inappropriately marked as
NULL
able.
That actually makes it a good example on how to deal with such databases in Lighter.
The Swift Northwind API: Documentation.
- Northwind Database:
- NorthwindWebAPI (A server side Swift example exposing the DB as a JSON API endpoint, and providing a few pretty HTML pages showing data contained.)
- NorthwindSwiftUI (A SwiftUI example that lets one browse the Northwind database. Uses the Lighter API in combination with its async/await supports.)
- Custom database:
This example pulls in a lot of bigger dependencies. A real Lighter project can actually work w/ no external dependencies at all.
Lighter is brought to you by Helge Heß / ZeeZide. We like feedback, GitHub stars, cool contract work, presumably any form of praise you can think of.
Want to support my work? Buy an app: Code for SQLite3, Past for iChat, SVG Shaper, Shrugs, HMScriptEditor. You don't have to use it! 😀