Skip to content

feat(sql): add autoCreate option to Database.load - #3702

Merged
lucasfernog merged 8 commits into
tauri-apps:v2from
kxrn-gupta:feat/sql-auto-create-option
Oct 12, 2026
Merged

lucasfernog merged 8 commits into
tauri-apps:v2from
kxrn-gupta:feat/sql-auto-create-option

Conversation

@kxrn-gupta

Copy link
Copy Markdown
Contributor

Description

Resolves #299 by adding an \�utoCreate\ configuration option to \Database.load.

Summary of Changes

  • Rust:
    • Added \LoadOptions\ struct in \plugins/sql/src/commands.rs\ with \�uto_create\ defaulting to \ rue\ for 100% backward compatibility.
    • Added \Error::DatabaseDoesNotExist(String)\ in \plugins/sql/src/error.rs.
    • Updated \DbPool::connect\ in \plugins/sql/src/wrapper.rs\ to error with \DatabaseDoesNotExist\ when \�uto_create\ is \ alse\ and the database does not exist on disk/server (supporting SQLite, MySQL, and PostgreSQL).
  • JavaScript / TypeScript:
    • Added \LoadOptions\ interface in \guest-js/index.ts.
    • Added \options?: LoadOptions\ parameter to \Database.load(path, options).
  • Covector:
    • Added .changes/sql-auto-create-option.md\ declaring \minor\ bump for \sql\ and \sql-js.

Fixes #299

Add �utoCreate option to Database.load allowing users to disable implicit database creation when loading a database.

Closes tauri-apps#299
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Package Changes Through f33bfbe

There are 13 changes which include biometric with minor, biometric-js with minor, deep-link with patch, deep-link-js with patch, fs with patch, fs-js with patch, notification with minor, notification-js with minor, single-instance with patch, sql with minor, sql-js with minor, updater with minor, updater-js with minor

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
api-example 2.0.55 2.0.56
api-example-js 2.0.51 2.0.52
deep-link-example-js 2.2.16 2.2.17
biometric 2.4.2 2.5.0
biometric-js 2.4.2 2.5.0
deep-link 2.6.1 2.6.2
deep-link-js 2.6.1 2.6.2
fs 2.7.0 2.7.1
fs-js 2.7.0 2.7.1
dialog 2.8.2 2.8.3
dialog-js 2.8.2 2.8.3
http 2.8.2 2.8.3
http-js 2.8.2 2.8.3
notification 2.6.0 2.7.0
notification-js 2.6.0 2.7.0
persisted-scope 2.4.1 2.4.2
single-instance 2.5.3 2.5.4
sql 2.5.0 2.6.0
sql-js 2.5.0 2.6.0
updater 2.13.3 2.14.0
updater-js 2.13.3 2.14.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@lucasfernog
lucasfernog merged commit c91a9e6 into tauri-apps:v2 Oct 12, 2026
23 of 24 checks passed
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.

[sql] Creates database automatically if not exists

2 participants