Use same data type as SQLite for primary keys · Processoriented/sqlitebrowser@408fbcf · GitHub
Skip to content

Commit 408fbcf

Browse files
committed
Use same data type as SQLite for primary keys
This improves commit c20c585 to definitely make sure the primary key values are stored and handled correctly by simply using the same data type as SQLite itself does.
1 parent 4fa0576 commit 408fbcf

3 files changed

Lines changed: 11 additions & 12 deletions

File tree

‎src/sqlitedb.cpp‎

Lines changed: 4 additions & 5 deletions

‎src/sqlitedb.h‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
#define SQLITEDB_H
33

44
#include "sqlitetypes.h"
5+
#include "sqlite.h"
56

67
#include <QStringList>
78
#include <QMultiMap>
89
#include <QByteArray>
910

1011
class CipherDialog;
11-
class sqlite3;
1212

1313
enum
1414
{
@@ -66,7 +66,7 @@ class DBBrowserDB : public QObject
6666
* @param rowdata A list of QByteArray containing the row data.
6767
* @return true if statement execution was ok, else false.
6868
*/
69-
bool getRow(const QString& sTableName, long rowid, QList<QByteArray>& rowdata);
69+
bool getRow(const QString& sTableName, sqlite3_int64 rowid, QList<QByteArray>& rowdata);
7070

7171
/**
7272
* @brief max Queries the table t for the max value of field.
@@ -84,9 +84,9 @@ class DBBrowserDB : public QObject
8484
* @param pk_value This optional parameter can be used to manually set a specific value for the primary key column
8585
* @return An sqlite conform INSERT INTO statement with empty values. (NULL,'',0)
8686
*/
87-
QString emptyInsertStmt(const sqlb::Table& t, long pk_value = -1) const;
88-
bool deleteRecord(const QString& table, long rowid);
89-
bool updateRecord(const QString& table, const QString& column, long row, const QByteArray& value);
87+
QString emptyInsertStmt(const sqlb::Table& t, sqlite3_int64 pk_value = -1) const;
88+
bool deleteRecord(const QString& table, sqlite3_int64 rowid);
89+
bool updateRecord(const QString& table, const QString& column, sqlite3_int64 row, const QByteArray& value);
9090

9191
bool createTable(const QString& name, const sqlb::FieldVector& structure);
9292
bool renameTable(const QString& from_table, const QString& to_table);

‎src/sqlitetablemodel.cpp‎

Lines changed: 2 additions & 2 deletions

0 commit comments

Comments
 (0)