This template should help get you started developing completely local, cross-platform desktop apps.
bun ibunx tauri dev
By default, tauri-template comes with an embedded SQLite database named tauri-template.db.
You can override this with the following steps:
-
Choose between
SQLiteorPostgreSQL -
Set
DATABASE_URLinsrc-tauri/.env:sqlite:<name>.dbfor SQLitepostgres://postgres@localhost/<name>for Postgres (or cloud-hosted URL) -
sqlx migrate add <name>creates a migration file inmigrations/<timestamp>-<name>.sql. Run this command insrc-tauri/Add your database schema changes here. -
Next time you restart your app, your migrations will be applied.
sqlx migrate runapplies your migrations manually.
Go here for information on migration reverts.
Rust does not support cetain database types. You must create serializers for those data types. Read here for Sqlite and here for Postgres.
You can look here for an example on how to serialize Postgres Numeric and Date types in Rust using the time and rust_decimal crates.
bun run tauri build
Rust Rover - this is the default recommendation. It is free for non-commercial use.
VS Code - install all the recommendations from .vscode/extensions.json. This should be an automatic popup.
Easiest way to use Postgres on Mac is Postgres.app
This template was manually created. For future project creations, you can use the new (and excellent!) create-tsrouter-app@latest with your favorite package manager!