Skip to main content

Swift Quick Start

Generate the Swift workspace from the same TeaQL model used by the other runtimes, then open its Package.swift with Swift Package Manager. The current runtime tag is 0.1.3; use the dependency version emitted by the generator.

At the application composition root, create the SQLite data service and UserContext, install the generated passive module, and reconcile schema explicitly:

let context = UserContext(queryExecutor: service, mutationExecutor: service)
var runtime = TeaQLRuntime()
try runtime.install(GeneratedRuntimeModule.module)
try await service.ensureSchema(GeneratedRuntimeModule.module.entities)

let people = try await Q.people()
.comment("first Swift verification")
.purpose("read people")
.executeForList(context)

Use the exact initializer generated for your workspace if it includes actor, tenant, policy, audit, or telemetry arguments. Never accept those governance dependencies from an untrusted request.