Skip to content
Back

Is it possible to run client-side transactions?

  • 0
  • Databases
  • REST API
Shendy
15 Mar, 2025, 09:39

I am working with Supabase (building a Compose Multiplatform application), and currently the only way to run transaction is by doing rpc calls.

I have a use case where the sql queries to run inside a transaction is dynamically built at runtime time.

So, I am writing here to see if this is possible in Turso so I migrate to it.

Example: imagine you have an app where it creates a folder that can hold different types of files:

  • Folder: name
    • ImageFile: name, data
    • TextFile: name, text
    • etc..

The type of files to store in folder is dynamic, meaning you can support different types later, and we shouldn't touch the process of creating a file. So for this use case, how to make the process of creating new folder with its nested files run all at once inside a transaction?

TL;DR
- Developer using Supabase for a Compose Multiplatform app - Needs to run client-side transactions with dynamically built SQL queries - Asks if Turso supports this to migrate - Use case: creating folders with dynamic nested file types in one transaction Solution: Turso does not natively support client-side transactions. One workaround could be to handle transactions on the server-side and make RPC calls from clients. Another option is to rethink the application's architecture to handle transactions more effectively.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more