From e637e165ebc5bf14e7a9b12d6b518203eb02759e Mon Sep 17 00:00:00 2001 From: rtk0c Date: Sun, 9 May 2021 01:32:56 -0700 Subject: 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 --- core/src/Model/TransactionsModel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/src/Model') 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 == ?") { -- cgit v1.2.3-70-g09d2