Skip to content

Commit

Permalink
v1.0.27 - Improve query (#27)
Browse files Browse the repository at this point in the history
* v1.0.27 - Version

* v1.0.27 - Improve query

* v1.0.27 - Update deps
  • Loading branch information
Donnie authored Feb 1, 2024
1 parent 071e715 commit e8b1832
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 19 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<a href="https://flutter.dev/" style="text-decoration:none" area-label="flutter">
<img src="https://img.shields.io/badge/Platform-Flutter%203.16.5-blue">
</a>
<a href="https://github.com/Donnie/Finease/releases/tag/v1.0.26" style="text-decoration:none" area-label="flutter">
<img src="https://img.shields.io/badge/Version-1.0.26-orange">
<a href="https://github.com/Donnie/Finease/releases/tag/v1.0.27" style="text-decoration:none" area-label="flutter">
<img src="https://img.shields.io/badge/Version-1.0.27-orange">
</a>
<a href="https://github.com/Donnie/Finease/actions/workflows/android_release.yml" style="text-decoration:none" area-label="flutter">
<img src="https://github.com/Donnie/Finease/actions/workflows/android_release.yml/badge.svg">
Expand Down
15 changes: 8 additions & 7 deletions lib/db/months.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ class MonthService {

final dbClient = await _databaseHelper.db;
String query = '''
WITH RECURSIVE MonthDates(monthDate) AS (
SELECT DATETIME((SELECT MIN(date) FROM entries), 'start of month')
WITH RECURSIVE MonthDates AS (
SELECT DATE(MIN(date), 'start of month') AS monthStart
FROM entries
UNION ALL
SELECT DATETIME(monthDate, '+1 month')
SELECT DATE(monthStart, '+1 month')
FROM MonthDates
WHERE DATETIME(monthDate, '+1 month') < CURRENT_DATE
WHERE monthStart < DATE('now', 'start of month')
),
ForexPairs AS (
SELECT
Expand Down Expand Up @@ -107,9 +108,9 @@ class MonthService {
), 0) AS expense,
? AS currency
FROM (
SELECT
REPLACE(DATETIME(monthDate, 'start of month'), ' ', 'T') || 'Z' as startDate,
REPLACE(DATETIME(monthDate, 'start of month', '+1 month', '-1 second'), ' ', 'T') || 'Z' as endDate
SELECT
monthStart || 'T00:00:00Z' AS startDate,
DATE(monthStart, '+1 month', '-1 second') || 'T23:59:59Z' AS endDate
FROM MonthDates
) AS months
LEFT JOIN ConsolidatedEntries e ON e.date BETWEEN months.startDate AND months.endDate
Expand Down
12 changes: 6 additions & 6 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,10 @@ packages:
dependency: "direct main"
description:
name: go_router
sha256: "3b40e751eaaa855179b416974d59d29669e750d2e50fcdb2b37f1cb0ca8c803a"
sha256: "07ee2436909f749d606f53521dc1725dd738dc5196e5ff815bc254253c594075"
url: "https://pub.dev"
source: hosted
version: "13.0.1"
version: "13.1.0"
google_fonts:
dependency: "direct main"
description:
Expand All @@ -244,10 +244,10 @@ packages:
dependency: "direct main"
description:
name: http
sha256: d4872660c46d929f6b8a9ef4e7a7eff7e49bbf0c4ec3f385ee32df5119175139
sha256: a2bbf9d017fcced29139daa8ed2bba4ece450ab222871df93ca9eec6f80c34ba
url: "https://pub.dev"
source: hosted
version: "1.1.2"
version: "1.2.0"
http_multi_server:
dependency: transitive
description:
Expand Down Expand Up @@ -641,10 +641,10 @@ packages:
dependency: "direct main"
description:
name: sqflite
sha256: "591f1602816e9c31377d5f008c2d9ef7b8aca8941c3f89cc5fd9d84da0c38a9a"
sha256: a9016f495c927cb90557c909ff26a6d92d9bd54fc42ba92e19d4e79d61e798c6
url: "https://pub.dev"
source: hosted
version: "2.3.0"
version: "2.3.2"
sqflite_common:
dependency: transitive
description:
Expand Down
8 changes: 4 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: finease
description: "A full stack mobile app to keep track of financial transactions"
publish_to: 'none'
version: 1.0.26
version: 1.0.27

environment:
sdk: '>=3.2.3 <4.0.0'
Expand All @@ -13,10 +13,10 @@ dependencies:
fl_chart: 0.66.0
flutter:
sdk: flutter
go_router: 13.0.1
go_router: 13.1.0
google_fonts: 6.1.0
hive: 2.2.3
http: 1.1.2
http: 1.2.0
intl: 0.17.0
local_auth: 2.1.8
material_design_icons_flutter: 7.0.7296
Expand All @@ -27,7 +27,7 @@ dependencies:
pointycastle: 3.7.4
responsive_builder: 0.7.0
share_plus: 7.0.2
sqflite: 2.3.0
sqflite: 2.3.2
url_launcher: 6.2.3
xml: 6.5.0

Expand Down

0 comments on commit e8b1832

Please sign in to comment.