| qsql.qdoc |
|
2263 |
- |
| qsqlcachedresult.cpp |
QSqlCachedResult is a convenience class for databases that only allow
forward only fetching. It will cache all the results so we can iterate
backwards over the results again.
All you need to do is to inherit from QSqlCachedResult and reimplement
gotoNext(). gotoNext() will have a reference to the internal cache and
will give you an index where you can start filling in your data. Special
case: If the user actually wants a forward-only query, idx will be -1
to indicate that we are not interested in the actual values.
|
5758 |
- |
| qsqlcachedresult_p.h |
|
2058 |
- |
| qsqldatabase.cpp |
|
41937 |
- |
| qsqldatabase.h |
|
4363 |
- |
| qsqldriver.cpp |
!
\class QSqlDriver
\brief The QSqlDriver class is an abstract base class for accessing
specific SQL databases.
\ingroup database
\inmodule QtSql
This class should not be used directly. Use QSqlDatabase instead.
If you want to create your own SQL drivers, you can subclass this
class and reimplement its pure virtual functions and those
virtual functions that you need. See \l{How to Write Your Own
Database Driver} for more information.
\sa QSqlDatabase, QSqlResult
|
25175 |
- |
| qsqldriver.h |
|
4182 |
- |
| qsqldriver_p.h |
|
1119 |
- |
| qsqldriverplugin.cpp |
!
\class QSqlDriverPlugin
\brief The QSqlDriverPlugin class provides an abstract base for custom QSqlDriver plugins.
\ingroup plugins
\inmodule QtSql
The SQL driver plugin is a simple plugin interface that makes it
easy to create your own SQL driver plugins that can be loaded
dynamically by Qt.
Writing a SQL plugin is achieved by subclassing this base class,
reimplementing the pure virtual function create(), and
exporting the class with the Q_PLUGIN_METADATA() macro. See the SQL
plugins that come with Qt for example implementations (in the
\c{plugins/src/sqldrivers} subdirectory of the source
distribution).
The json file containing the metadata for the plugin contains a list of
keys indicating the supported sql drivers
\code
{ "Keys": [ "mysqldriver" ] }
\endcode
\sa {How to Create Qt Plugins}
|
1911 |
- |
| qsqldriverplugin.h |
|
741 |
- |
| qsqlerror.cpp |
!
\class QSqlError
\brief The QSqlError class provides SQL database error information.
\ingroup database
\inmodule QtSql
A QSqlError object can provide database-specific error data,
including the driverText() and databaseText() messages (or both
concatenated together as text()), and the nativeErrorCode() and
type().
\sa QSqlDatabase::lastError(), QSqlQuery::lastError()
|
5400 |
- |
| qsqlerror.h |
|
1642 |
- |
| qsqlfield.cpp |
!
\class QSqlField
\brief The QSqlField class manipulates the fields in SQL database tables
and views.
\ingroup database
\ingroup shared
\inmodule QtSql
QSqlField represents the characteristics of a single column in a
database table or view, such as the data type and column name. A
field also contains the value of the database column, which can be
viewed or changed.
Field data values are stored as QVariants. Using an incompatible
type is not permitted. For example:
\snippet sqldatabase/sqldatabase.cpp 2
However, the field will attempt to cast certain data types to the
field data type where possible:
\snippet sqldatabase/sqldatabase.cpp 3
QSqlField objects are rarely created explicitly in application
code. They are usually accessed indirectly through \l{QSqlRecord}s
that already contain a list of fields. For example:
\snippet sqldatabase/sqldatabase.cpp 4
\dots
\snippet sqldatabase/sqldatabase.cpp 5
\snippet sqldatabase/sqldatabase.cpp 6
A QSqlField object can provide some meta-data about the field, for
example, its name(), variant metaType(), length(), precision(),
defaultValue(), typeID(), and its requiredStatus(),
isGenerated() and isReadOnly(). The field's data can be
checked to see if it isNull(), and its value() retrieved. When
editing the data can be set with setValue() or set to NULL with
clear().
\sa QSqlRecord
|
13668 |
- |
| qsqlfield.h |
|
4115 |
- |
| qsqlindex.cpp |
!
\class QSqlIndex
\brief The QSqlIndex class provides functions to manipulate and
describe database indexes.
\ingroup database
\inmodule QtSql
An \e index refers to a single table or view in a database.
Information about the fields that comprise the index can be used
to generate SQL statements.
|
3667 |
- |
| qsqlindex.h |
|
1681 |
- |
| qsqlnulldriver_p.h |
|
2835 |
- |
| qsqlquery.cpp |
!
\internal
|
43632 |
- |
| qsqlquery.h |
|
4005 |
- |
| qsqlrecord.cpp |
!
\class QSqlRecord
\brief The QSqlRecord class encapsulates a database record.
\ingroup database
\ingroup shared
\inmodule QtSql
The QSqlRecord class encapsulates the functionality and
characteristics of a database record (usually a row in a table or
view within the database). QSqlRecord supports adding and
removing fields as well as setting and retrieving field values.
The values of a record's fields can be set by name or position
with setValue(); if you want to set a field to null use
setNull(). To find the position of a field by name use indexOf(),
and to find the name of a field at a particular position use
fieldName(). Use field() to retrieve a QSqlField object for a
given field. Use contains() to see if the record contains a
particular field name.
When queries are generated to be executed on the database only
those fields for which isGenerated() is true are included in the
generated SQL.
A record can have fields added with append() or insert(), replaced
with replace(), and removed with remove(). All the fields can be
removed with clear(). The number of fields is given by count();
all their values can be cleared (to null) using clearValues().
\sa QSqlField, QSqlQuery::record()
|
12960 |
- |
| qsqlrecord.h |
|
3073 |
- |
| qsqlresult.cpp |
|
28303 |
- |
| qsqlresult.h |
|
3477 |
- |
| qsqlresult_p.h |
|
3195 |
- |
| qtsqlglobal.h |
|
1090 |
- |
| qtsqlglobal_p.h |
|
626 |
- |