From 54ef0de03b89176ca7987f1cb12394908b4f1784 Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Sat, 7 Jun 2025 13:15:52 +1000 Subject: [PATCH] Implement creating new database file --- schema.sql | 4 +- src-tauri/tauri.conf.json | 3 +- src/App.vue | 11 ++++-- src/db.ts | 39 ++++++++++++++++++- src/main.ts | 1 + src/pages/NewFileView.vue | 80 +++++++++++++++++++++++++++++++++++++++ src/pages/NoFileView.vue | 7 +++- 7 files changed, 136 insertions(+), 9 deletions(-) create mode 100644 src/pages/NewFileView.vue diff --git a/schema.sql b/schema.sql index 4de3748..0427ef4 100644 --- a/schema.sql +++ b/schema.sql @@ -14,6 +14,8 @@ -- You should have received a copy of the GNU Affero General Public License -- along with this program. If not, see . +-- Current version: 3 (see db.ts) + --------- -- Tables @@ -93,7 +95,7 @@ CREATE TABLE austax_cgt_cost_adjustments ( description VARCHAR, cost_adjustment INTEGER, PRIMARY KEY (id) -) +); -------- -- Views diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 591d634..92c55e9 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -28,7 +28,8 @@ "icons/icon.png" ], "resources": { - "../libdrcr/plugins/": "plugins/" + "../libdrcr/plugins/": "plugins/", + "../schema.sql": "schema.sql" } } } diff --git a/src/App.vue b/src/App.vue index cc10b66..d1e6953 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,6 +1,6 @@ + + + + diff --git a/src/pages/NoFileView.vue b/src/pages/NoFileView.vue index 6589b5c..3a98df4 100644 --- a/src/pages/NoFileView.vue +++ b/src/pages/NoFileView.vue @@ -1,6 +1,6 @@ +
  • New file
  • Open file
  • @@ -33,6 +33,9 @@ const file = await open({ multiple: false, directory: false, + filters: [ + { name: 'DrCr database (SQLite)', extensions: ['db'] } + ], }); if (file !== null) {