Commit Graph

12 Commits

Author SHA1 Message Date
Marco Bubke
7785a3a651 Sqlite: Move result count to class declaration
It move the magic number of column results to the sql statement
and improves the mock a little bit.

Change-Id: I101067444cf27ec5dea0c72de7fd484a7e8710f0
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-03-26 12:24:37 +00:00
Marco Bubke
cf441e8198 Sqlite: Add primary key table constraint to table builder
Change-Id: I60c158eb76db2217a2d045053bb8e47eef75ff7a
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-05 09:57:47 +00:00
Marco Bubke
c4bbc74e37 Sqlite: Improve constraint support
Now you can add more than one constraint. And we added some
new constraints too.

Change-Id: I849d2d2ef6e44c897a65ff2bdfe8d172a345c991
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-05-14 09:15:00 +00:00
Marco Bubke
f02934458e Sqlite: Add foreign key support
It is still only support references in columns but so far it is enough.

Change-Id: Iebb4866cf738d651270e54357b5e4a2837f05417
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-05-07 12:14:58 +00:00
Marco Bubke
c6f65e94c8 Sqlite: Add unique index to table
Some times we need the constraint for an index.

Change-Id: I81332238d36b88196ef03e26b4edcc1307de46e0
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 15:05:30 +00:00
Marco Bubke
382c9647e8 Sqlite: Remove the Sqlite Prefix
We use a name space now, so the prefix is not of much use.

Change-Id: I2b077576f94dab778add6ab2e54870f7ca18da78
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-18 13:37:11 +00:00
Marco Bubke
3adb71d45e Clang: Add Symbol Indexing
It is a first step and now a database is generated if you start QtCreator.
Some code is now shared with the PchManager which can be improved in the
future.

Change-Id: Ic267fe7960f6c455d91832859a673ce98f269aa2
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-14 13:39:55 +00:00
Marco Bubke
1a25b61576 Sqlite: Improve Sqlite wrapper
It is now possible to read values at once.

for (auto [name, value] : statement.tupleValues<String, int>(1000, "foo", 20))
   ....

Change-Id: I3d4bc5218810b4620e1df625126aa490f30bbc71
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-28 14:50:33 +00:00
Marco Bubke
52a911b972 Sqlite: Cleanup table and column handling
Using values instead of pointers makes the handling much easier. We can
remove ColumnDefinition too, and use SqliteColumn instead.

Change-Id: I224db9cc569c4dfb6e2746179b02096904bfbccb
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-02 11:50:18 +00:00
Marco Bubke
2fed425cd3 Clang: Cleanup string interface of sqlite
We only will need the utf8 optimized SmallString for the indexer database.
So we remove all other string bindings, QByteArray and QVariant.

Change-Id: I4a77901a80b26bf292fc85df535c2ccf3a8ab52f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-01 13:44:50 +00:00
Marco Bubke
3dcce060b2 Sqlite: Cleanup Sqlite
We don't need the threading anymore, so we removed it. The indexer
will be run in its thread anyway, so an extra thread makes the code
only more complicated. And we added namespaces.

Change-Id: Ibcba306324763285cf653c28bb08122345e5f8da
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-07-27 09:14:30 +00:00
Marco Bubke
47c01daeb2 UnitTest: Cleanup
Improve naming and introduce googletest.h.

Change-Id: I445c13db4c23d6dd5682ce0db3b83055cc6b8a89
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-09-19 15:17:54 +00:00