Commit db08ec8f authored by Nico Vertriest's avatar Nico Vertriest Committed by Jerome Pasion
Browse files

Added content to Qt SQL


- more info on using SQLite
- how to access MySQL
- main classes of Qt SQL
- Added link to Qt SQL
- 2 punctuation issues (inserted commas)
- replaced "SQL module module" by "SQL module".
- one space after period instead of two
- limited lines to 80 positions
- added further explanations on QtSqlTableModel
  and QtSqlRelationalTableModel
- fixed problem with trailing whitespace

Edits in SQL section according to remarks by reviewers

Restored original format in License section (2 spaces after period).
Change-Id: I138ef32146b343b1fc745da3c5c85f8e056be025
Reviewed-by: default avatarJerome Pasion <jerome.pasion@digia.com>
parent d647f418
dev 5.10 5.11 5.12 5.12.1 5.12.10 5.12.11 5.12.12 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.12.7 5.12.8 5.12.9 5.13 5.13.0 5.13.1 5.13.2 5.14 5.14.0 5.14.1 5.14.2 5.15 5.15.0 5.15.1 5.15.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 5.9.8 6.0 6.0.0 6.1 6.1.0 6.1.1 6.1.2 6.1.3 6.2 6.2.0 6.2.1 6.2.2 old/5.0 old/5.1 old/5.2 tqtc/vxworks-5.5 wip/android v5.15.0-alpha1 v5.14.1 v5.14.0 v5.14.0-rc2 v5.14.0-rc1 v5.14.0-beta3 v5.14.0-beta2 v5.14.0-beta1 v5.14.0-alpha1 v5.13.2 v5.13.1 v5.13.0 v5.13.0-rc3 v5.13.0-rc2 v5.13.0-rc1 v5.13.0-beta4 v5.13.0-beta3 v5.13.0-beta2 v5.13.0-beta1 v5.13.0-alpha1 v5.12.7 v5.12.6 v5.12.5 v5.12.4 v5.12.3 v5.12.2 v5.12.1 v5.12.0 v5.12.0-rc2 v5.12.0-rc1 v5.12.0-beta4 v5.12.0-beta3 v5.12.0-beta2 v5.12.0-beta1 v5.12.0-alpha1 v5.11.3 v5.11.2 v5.11.1 v5.11.0 v5.11.0-rc2 v5.11.0-rc1 v5.11.0-beta4 v5.11.0-beta3 v5.11.0-beta2 v5.11.0-beta1 v5.11.0-alpha1 v5.10.1 v5.10.0 v5.10.0-rc3 v5.10.0-rc2 v5.10.0-rc1 v5.10.0-beta4 v5.10.0-beta3 v5.10.0-beta2 v5.10.0-beta1 v5.10.0-alpha1 v5.9.9 v5.9.8 v5.9.7 v5.9.6 v5.9.5 v5.9.4 v5.9.3 v5.9.2 v5.9.1 v5.9.0 v5.9.0-rc2 v5.9.0-rc1 v5.9.0-beta4 v5.9.0-beta3 v5.9.0-beta2 v5.9.0-beta1 v5.9.0-alpha1 v5.8.0 v5.8.0-rc1 v5.8.0-beta1 v5.8.0-alpha1 v5.7.1 v5.7.0 v5.7.0-rc1 v5.7.0-beta1 v5.7.0-alpha1 v5.6.3 v5.6.2 v5.6.1 v5.6.1-1 v5.6.0 v5.6.0-rc1 v5.6.0-beta1 v5.6.0-alpha1 v5.5.1 v5.5.0 v5.5.0-rc1 v5.5.0-beta1 v5.5.0-alpha1 v5.4.2 v5.4.1 v5.4.0 v5.4.0-rc1 v5.4.0-beta1 v5.4.0-alpha1 v5.3.2 v5.3.1 v5.3.0 v5.3.0-rc1 v5.3.0-beta1 v5.3.0-alpha1 v5.2.1 v5.2.0 v5.2.0-rc1 v5.2.0-beta1 v5.2.0-alpha1 v5.1.1 v5.1.0 v5.1.0-rc2 v5.1.0-rc1 v5.1.0-beta1 v5.1.0-alpha1 v5.0.2 v5.0.1 v5.0.0 v5.0.0-rc2 v5.0.0-rc1
No related merge requests found
Showing with 57 additions and 5 deletions
...@@ -53,11 +53,63 @@ In addition, make sure the following pages are reachable via links from this sec ...@@ -53,11 +53,63 @@ In addition, make sure the following pages are reachable via links from this sec
\section1 SQL support in Qt \section1 SQL support in Qt
### Talk about databases and SQL support in Qt, with backend drivers such as MySQL for The \l {Qt SQL} module uses driver plugins to communicate with several database
full database support or SQLite for local storage. Mention that this integrates with Model/View APIs. Qt has drivers for SQLite, MYSQL, DB2, Borland InterBase, Oracle, ODBC,
classes, QWidgets and can also be used in QML. and PostgreSQL. It is also possible to develop your own driver if Qt is not
providing the driver needed.
Make sure the following pages are linked from this section, either indirectly or directly:
Qt's SQL classes can be divided in 3 layers:
\table
\header
\li Layer
\li Purpose
\li Example class
\row
\li
\list
\li Driver layer
\li SQL API layer
\li User Interface layer
\endlist
\li
\list
\li Low-level communication between database and the SQL API layer
\li Provide access to databases
\li Link data from a database to data-aware widgets
\endlist
\li
\list
\li QSqlDriver, QSqlDriverCreator
\li QSqlDatabase, QSqlQuery
\li QSqlQueryModel (read-only), QSqlTableModel (read-write), QSqlRelationalTableModel (read-write with foreign-key support)
\endlist
\endtable
QSqlQueryModel, QSqlTableModel and QSqlRelationalTableModel can be used as a
datasource for Qt's classes for viewing data. QSqlTableModel and QtSqlRelational-
TableModel provide editable models for use with Qt's item views. QSqlTableModel
has read/write access to a single table. QSqlRelationalTableModel has read/write
access to the main table, not to the table where the foreign key comes from.
With the MYSQL driver, it is possible to connect to a MYSQL server. In order to
build the QMYSQL Plugin for Unix or Mac OS X, you need the MYSQL header files
and as well as the shared library libmysqlclient.so. To compile the plugin
for Windows, you need to get the MYSQL installation files and to run SETUP.EXE.
If you use the embedded MYSQL Server, you do not need a MYSQL server in order
to use that database system. In order to do so, you need to link the Qt plugin
to libmysqld instead of libmysqlclient.
The Qt SQLite plugin is very suitable for local storage. SQLite is a relational
database management system contained in a small (~350 KiB) C library.
In contrast to other database management systems, SQLite is not a separate process
that is accessed from the client application, but an integral part of it. SQLite
operates on a single file, which must be set as the database name when opening
a connection. If the file does not exist, SQLite will try to create it.
SQLite has some restrictions regarding multiple users and multiple transactions.
If you are reading or writing on a file from different transactions, your appli-
cation might freeze until one transaction commits or rolls back.
\list \list
\li \l {SQL in Qt} \li \l {SQL in Qt}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment