Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
sqlitebrowser/src/sqlitetablemodel.h at master · blockChainB/sqlitebrowser · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
See all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
blockChainB
sqlitebrowser
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
sqlitebrowser
/
src
/
sqlitetablemodel.h
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
97 lines (74 loc) · 3.29 KB
master
Breadcrumbs
sqlitebrowser
/
src
/
sqlitetablemodel.h
Copy path
Top
File metadata and controls
Code
Blame
97 lines (74 loc) · 3.29 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#
ifndef
SQLITETABLEMODEL_H
#
define
SQLITETABLEMODEL_H
#
include
<
QAbstractTableModel
>
#
include
<
QStringList
>
#
include
<
QVector
>
class
DBBrowserDB
;
namespace
sqlb
{
class
ForeignKeyClause
; }
class
SqliteTableModel
:
public
QAbstractTableModel
{
Q_OBJECT
public:
explicit
SqliteTableModel
(QObject *parent =
0
, DBBrowserDB* db =
0
,
size_t
chunkSize =
50000
,
const
QString& encoding = QString());
void
reset
();
int
rowCount
(
const
QModelIndex &parent = QModelIndex())
const
;
int
totalRowCount
()
const
;
int
columnCount
(
const
QModelIndex &parent = QModelIndex())
const
;
QVariant
headerData
(
int
section, Qt::Orientation orientation,
int
role = Qt::DisplayRole)
const
;
QVariant
data
(
const
QModelIndex &index,
int
role = Qt::DisplayRole)
const
;
bool
setData
(
const
QModelIndex& index,
const
QVariant& value,
int
role = Qt::EditRole);
bool
canFetchMore
(
const
QModelIndex &parent = QModelIndex())
const
;
void
fetchMore
(
const
QModelIndex &parent = QModelIndex());
size_t
queryMore
(
size_t
offset);
bool
insertRows
(
int
row,
int
count,
const
QModelIndex& parent = QModelIndex());
bool
removeRows
(
int
row,
int
count,
const
QModelIndex& parent = QModelIndex());
void
setQuery
(
const
QString&
sQuery
,
bool
dontClearHeaders =
false
);
QString
query
()
const
{
return
m_sQuery; }
void
setTable
(
const
QString& table,
const
QVector<QString> &display_format = QVector<QString>());
void
setChunkSize
(
size_t
chunksize);
void
sort
(
int
column, Qt::SortOrder order = Qt::AscendingOrder);
Qt::ItemFlags
flags
(
const
QModelIndex& index)
const
;
bool
valid
()
const
{
return
m_valid; }
bool
isBinary
(
const
QModelIndex& index)
const
;
void
setEncoding
(QString encoding) { m_encoding = encoding; }
QString
encoding
()
const
{
return
m_encoding; }
typedef
QList<QByteArray> QByteArrayList;
sqlb::ForeignKeyClause
getForeignKeyClause
(
int
column)
const
;
public slots:
void
updateFilter
(
int
column,
const
QString& value);
protected:
virtual
Qt::DropActions
supportedDropActions
()
const
;
virtual
bool
dropMimeData
(
const
QMimeData* data, Qt::DropAction action,
int
row,
int
column,
const
QModelIndex& parent);
private:
void
fetchData
(
unsigned
int
from,
unsigned
to);
void
clearCache
();
void
buildQuery
();
QStringList
getColumns
(
const
QString&
sQuery
, QVector<
int
>& fieldsTypes);
int
getQueryRowCount
();
QByteArray
encode
(
const
QByteArray& str)
const
;
QByteArray
decode
(
const
QByteArray& str)
const
;
DBBrowserDB* m_db;
int
m_rowCount;
QStringList m_headers;
typedef
QList<QByteArrayList> DataType;
DataType m_data;
QString m_sQuery;
QString m_sTable;
int
m_iSortColumn;
QString m_sSortOrder;
QMap<
int
, QString> m_mWhere;
QVector<QString> m_vDisplayFormat;
QVector<
int
> m_vDataTypes;
/*
*
* @brief m_chunkSize Size of the next chunk fetch more will try to fetch.
* This value should be rather high, because our query
* uses LIMIT and sqlite3 will still execute the whole query and
* just skip the not wanted rows, but the execution will
* still take nearly the same time as doing the query at all up
* to that row count.
*/
size_t
m_chunkSize;
bool
m_valid;
//
! tells if the current query is valid.
QString m_encoding;
};
#
endif
//
SQLITETABLEMODEL_H
You can’t perform that action at this time.