aboutsummaryrefslogtreecommitdiff
path: root/core/src/Model/TransactionsModel.cpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2021-05-09 01:32:56 -0700
committerrtk0c <[email protected]>2021-05-09 01:36:36 -0700
commite637e165ebc5bf14e7a9b12d6b518203eb02759e (patch)
tree9443f2d6e9d543acd5312f228ba92ebef007afa7 /core/src/Model/TransactionsModel.cpp
parent850067a6db2443c1ff1ced793135796ef7ac490f (diff)
Fix rowid 1 vs 0 indexing offset problem (by using a custom Id column with 0 indexing), switch child-class-providing-entry-specific-impls to a if constexpr() based template approach
Diffstat (limited to 'core/src/Model/TransactionsModel.cpp')
-rw-r--r--core/src/Model/TransactionsModel.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/src/Model/TransactionsModel.cpp b/core/src/Model/TransactionsModel.cpp
index 3df7990..7d53f89 100644
--- a/core/src/Model/TransactionsModel.cpp
+++ b/core/src/Model/TransactionsModel.cpp
@@ -11,7 +11,7 @@ SalesTable::SalesTable(TransactionModel& db)
// language=SQLite
: GetRowCount(db.GetSQLite(), "SELECT Count(*) FROM Sales")
// language=SQLite
- , GetRows(db.GetSQLite(), "SELECT * FROM Sales WHERE Id >= ? AND Id < ?")
+ , GetRows(db.GetSQLite(), "SELECT * FROM Sales LIMIT ? OFFSET ?")
// language=SQLite
, GetItems(db.GetSQLite(), "SELECT * FROM SalesItems WHERE SaleId == ?")
{
@@ -21,7 +21,7 @@ PurchasesTable::PurchasesTable(TransactionModel& db)
// language=SQLite
: GetRowCount(db.GetSQLite(), "SELECT Count(*) FROM Purchases")
// language=SQLite
- , GetRows(db.GetSQLite(), "SELECT * FROM Purchases WHERE Id >= ? AND Id < ?")
+ , GetRows(db.GetSQLite(), "SELECT * FROM Purchases LIMIT ? OFFSET ?")
// language=SQLite
, GetItems(db.GetSQLite(), "SELECT * FROM PurchasesItems WHERE PurchaseId == ?")
{