Get started with Turso and Swift using the libSQL client in a few simple steps.
Retrieve database credentials
.env
.Install
libsql
as a package dependency in XCode using this repo:Connect
Database
object and then open a Connection
to it:Embedded Replicas
Local only
Remote only
Execute
query()
,
or execute()
when you expect the query to not yield any rows:Sync (Embedded Replicas only)
sync()
on the database type to
sync your local database with the primary database, unless you are using
sync_interval
(though there is no issue with calling sync
with
sync_interval
enabled):