Skip to content

feat: add libSQL / Turso database driver plugin#827

Merged
datlechin merged 7 commits into
mainfrom
feat/libsql-turso-driver
Apr 22, 2026
Merged

feat: add libSQL / Turso database driver plugin#827
datlechin merged 7 commits into
mainfrom
feat/libsql-turso-driver

Conversation

@datlechin
Copy link
Copy Markdown
Member

Summary

  • Add libSQL / Turso driver plugin via Hrana HTTP protocol (POST /v2/pipeline)
  • Works with both Turso cloud databases and self-hosted sqld instances
  • Pure URLSession transport, zero native dependencies, registry-distributed
  • Fix apiOnly connection form validation to allow empty password when requiresAuthentication = false

What's included

Plugin files (Plugins/LibSQLDriverPlugin/):

  • LibSQLPlugin.swift — registration class with SQLite-compatible dialect
  • HranaHttpClient.swift — HTTP client with typed Hrana value decoding, cancellation, error handling
  • LibSQLPluginDriver.swift — full driver: connect, query, schema introspection, DDL generation, streaming
  • Info.plist — PluginKit version 5

Integration:

  • Registry metadata snapshot in PluginMetadataRegistry+RegistryDefaults.swift
  • TursolibSQL type alias in PluginMetadataRegistry.swift
  • CI case in build-plugin.yml (tag: plugin-libsql-v*)
  • Turso SVG icon in all asset catalogs

Bug fix:

  • ConnectionFormView+Helpers.swift: isValid now skips password requirement for apiOnly plugins with requiresAuthentication = false

Docs:

  • New docs/databases/libsql.mdx with setup, credentials, features, troubleshooting
  • Added to docs.json nav, index.mdx table, overview.mdx card grid

Closes #205

Test plan

  • Build LibSQLDriverPlugin scheme — verify it compiles
  • Build TablePro scheme — verify full app compiles
  • Launch app, verify libSQL / Turso appears in connection type picker
  • Select libSQL / Turso, verify form shows Database URL + optional token
  • Verify save works with empty token (self-hosted sqld)
  • Connect to Turso cloud database with URL + token
  • Connect to local sqld (http://localhost:8080, no token)
  • Browse tables, view structure, indexes, foreign keys, DDL
  • Execute queries, verify column types are populated
  • Test EXPLAIN query plan
  • Test libsql:// URL auto-rewrite to https://
  • Verify lint passes: swiftlint lint Plugins/LibSQLDriverPlugin/

@datlechin datlechin merged commit 81bcc6a into main Apr 22, 2026
2 checks passed
@datlechin datlechin deleted the feat/libsql-turso-driver branch April 22, 2026 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: libSQL(Turso) support

1 participant