KDb

Todo List
Member KDb::getFieldProperties (const KDbField &field, QMap< QByteArray, QVariant > *values)
IMPORTANT: values->insert("defaultWidth", field.defaultWidth());
Member KDb::isKDbSqlKeyword (const QByteArray &word)
add function returning list of keywords.
Member KDb::loadPropertyValueFromDom (const QDomNode &node, bool *ok)
add more QVariant types
Member KDb::setFieldProperties (KDbField *field, const QMap< QByteArray, QVariant > &values)
IMPORTANT: defaultWidth
Member KDb::setFieldProperty (KDbField *field, const QByteArray &propertyName, const QVariant &value)
IMPORTANT: defaultWidth
Member KDb::simplifiedFieldTypeName (KDbField::Type type)
support names of other BLOB subtypes
Member KDb::supportsVisibleDecimalPlacesProperty (KDbField::Type type)
add check for decimal type as well
Member KDbAlterTableHandler::ActionBase::debug (const DebugOptions &debugOptions=DebugOptions())
add QDebug operator <<
Member KDbAlterTableHandler::ChangeFieldPropertyAction::execute (KDbConnection *conn, KDbTableSchema *table) override

errmsg

Member KDbAlterTableHandler::execute (const QString &tableName, ExecutionArguments *args)

err msg?

err msg?

err msg?

err msg?

transaction!

better errmsg?

delete newTable...

support expressions (eg. TODAY()) as a default value

this field can be notNull or notEmpty - check whether the default is ok (or do this checking also in the Table Designer?)

support unique, validatationRule, unsigned flags...

check for foreignKey values...

delete newTable...

delete newTable...

delete newTable...

For some cases, table schema can completely change, so it will be needed to refresh all objects depending on it. Implement this!

Member KDbAlterTableHandler::InsertFieldAction::execute (KDbConnection *conn, KDbTableSchema *table) override
Member KDbAlterTableHandler::InsertFieldAction::simplifyActions (ActionDictDict *fieldActions) override
not checked
Member KDbAlterTableHandler::InsertFieldAction::updateAlteringRequirements () override

sometimes add DataConversionRequired (e.g. when relationships require removing orphaned records) ?

Member KDbAlterTableHandler::InsertFieldAction::updateTableSchema (KDbTableSchema *table, KDbField *field, QHash< QString, QString > *fieldHash) override
add it only when there should be fixed value (e.g. default) set for this new field...
Member KDbAlterTableHandler::MoveFieldPositionAction::execute (KDbConnection *conn, KDbTableSchema *table) override
Member KDbAlterTableHandler::MoveFieldPositionAction::simplifyActions (ActionDictDict *fieldActions) override
Member KDbAlterTableHandler::MoveFieldPositionAction::updateAlteringRequirements () override
Member KDbAlterTableHandler::RemoveFieldAction::execute (KDbConnection *conn, KDbTableSchema *table) override
Member KDbAlterTableHandler::RemoveFieldAction::simplifyActions (ActionDictDict *fieldActions) override
not checked
Member KDbAlterTableHandler::RemoveFieldAction::updateAlteringRequirements () override

sometimes add DataConversionRequired (e.g. when relationships require removing orphaned records) ?

Member KDbBinaryExpressionData::typeInternal (KDb::ExpressionCallStack *callStack) const override

add general support, e.g. for "NULL AND (1 == 1)"; for now we only support constants because there's no evaluation and operations with NULL depend on whether we have TRUE or FALSE See https://www.postgresql.org/docs/9.4/static/functions-logical.html https://dev.mysql.com/doc/refman/5.0/en/logical-operators.html

Any OR NULL may be also TRUE – but this needs support of fuzzy/multivalue types

NULL OR Any may be also TRUE – but this needs support of fuzzy/multivalue types

Any AND NULL may be also FALSE – but this needs support of fuzzy/multivalue types

NULL AND Any may be also FALSE – but this needs support of fuzzy/multivalue types

can be other Integer too

can be other Integer too

Member KDbBinaryExpressionData::validateInternal (KDbParseInfo *parseInfo, KDb::ExpressionCallStack *callStack) override
IMPORTANT: update type for query parameters
Member KDbConnection::alterTable (KDbTableSchema *tableSchema, KDbTableSchema *newTableSchema)

(js) implement real altering

(js) update any structure (e.g. query) that depend on this table!

uncomment:

(js): implement real altering

(js): update any structure (e.g. query) that depend on this table!

Member KDbConnection::alterTableName (KDbTableSchema *tableSchema, const QString &newName, AlterTableNameOptions options=AlterTableNameOption::Default)

alter table name for server DB backends!

what about objects (queries/forms) that use old name?

what about caption?

Member KDbConnection::closeDatabase ()
(js) add CLEVER algorithm here for nested transactions
Member KDbConnection::createTable (KDbTableSchema *tableSchema, CreateTableOptions options=CreateTableOption::Default)
(js) update any structure (e.g. queries) that depend on this table!
Member KDbConnection::deleteRecord (KDbQuerySchema *query, KDbRecordData *data, bool useRecordId=false)
allow to delete from a table without pkey
Member KDbConnection::dropQuery (KDbQuerySchema *querySchema)
update any structure that depend on this table!
Member KDbConnection::dropTable (KDbTableSchema *tableSchema)

Check that a database is currently in use? (c.f. createTable)

Update any structure (e.g. query) that depends on this table

Member KDbConnection::dropTableInternal (KDbTableSchema *tableSchema, bool alsoRemoveSchema)
js: update any structure (e.g. queries) that depend on this table!
Member KDbConnection::drv_beginTransaction ()
Add support for nested transactions, e.g. KDbTransactionData* beginTransaction(KDbTransactionData *parent)
Member KDbConnection::insertRecord (KDbQuerySchema *query, KDbRecordData *data, KDbRecordEditBuffer *buf, bool getRecordId=false)

now only if PKEY is present, this should also work when there's no PKEY

safe to cast it?

show error

remove just inserted record. How? Using ROLLBACK?

show error

Member KDbConnection::kdbSystemTableNames ()
this will depend on KDb lib version
Member KDbConnection::loadExtendedTableSchemaData (KDbTableSchema *tableSchema)

look at the current format version (KDB_EXTENDED_TABLE_SCHEMA_VERSION)

more properties

more properties...

Member KDbConnection::prepareStatement (KDbPreparedStatement::Type type, KDbFieldList *fields, const QStringList &whereFieldNames=QStringList())
move to ConnectionInterface just like we moved execute() and prepare() to KDbPreparedStatementInterface...
Member KDbConnection::querySingleRecordInternal (KDbRecordData *data, const KDbEscapedString *sql, KDbQuerySchema *query, const QList< QVariant > *params, QueryRecordOptions options)
does not work with non-SQL data sources
Member KDbConnection::querySingleStringInternal (const KDbEscapedString *sql, QString *value, KDbQuerySchema *query, const QList< QVariant > *params, int column, QueryRecordOptions options)
does not work with non-SQL data sources
Member KDbConnection::recordCount (const KDbTableSchema &tableSchema)
does not work with non-SQL data sources
Member KDbConnection::recordCount (KDbQuerySchema *querySchema, const QList< QVariant > &params=QList< QVariant >())
does not work with non-SQL data sources
Member KDbConnection::recordCount (const KDbEscapedString &sql)
perhaps use quint64 here?
Member KDbConnection::recordCount (const KDbTableSchema &tableSchema)

perhaps use quint64 here?

does not work with non-SQL data sources

Member KDbConnection::recordCount (KDbQuerySchema *querySchema, const QList< QVariant > &params=QList< QVariant >())
perhaps use quint64 here?
Member KDbConnection::recordCount (KDbTableOrQuerySchema *tableOrQuery, const QList< QVariant > &params=QList< QVariant >())
perhaps use quint64 here?
Member KDbConnection::setupField (const KDbRecordData &data)
load maxLengthStrategy info to see if the maxLength is the default
Member KDbConnection::setupObjectData (const KDbRecordData &data, KDbObject *object)
IMPORTANT: fix KDbConnection::setupObjectData() after refactoring
Member KDbConnection::storeExtendedTableSchemaData (KDbTableSchema *tableSchema)
future: save in older versions if neeed
Member KDbConnection::updateRecord (KDbQuerySchema *query, KDbRecordData *data, KDbRecordEditBuffer *buf, bool useRecordId=false)
perhaps we can try to update without using PKEY?
Member KDbConnectionData::isPasswordNeeded () const
temp.: change this if there are file-based drivers requiring a password
Member KDbConstExpressionData::toStringInternal (const KDbDriver *driver, KDbQuerySchemaParameterValueListIterator *params, KDb::ExpressionCallStack *callStack) const override
better escaping!
Member KDbConstExpressionData::typeInternal (KDb::ExpressionCallStack *callStack) const override

ok?

add sign info?

Member KDbCursor::deleteAllRecords ()
doesn't update cursor's buffer YET!
Member KDbCursor::deleteRecord (KDbRecordData *data, bool useRecordId=false)
doesn't update cursor's buffer YET!
Member KDbCursor::insertRecord (KDbRecordData *data, KDbRecordEditBuffer *buf, bool getRecrordId=false)
doesn't update cursor's buffer YET!
Member KDbCursor::setOrderByColumnList (const QStringList &columnNames)

implement this: all field names should be found, exit otherwise

if (!d->orderByColumnList)

Member KDbCursor::setOrderByColumnList (const QString &column1, const QString &column2=QString(), const QString &column3=QString(), const QString &column4=QString(), const QString &column5=QString())

implement this, like above

add ORDER BY info to debugString()

Member KDbCursor::setOrderByColumnList (const QStringList &columnNames)
implement this
Member KDbCursor::setOrderByColumnList (const QString &column1, const QString &column2=QString(), const QString &column3=QString(), const QString &column4=QString(), const QString &column5=QString())
implement this
Member KDbCursor::updateRecord (KDbRecordData *data, KDbRecordEditBuffer *buf, bool useRecordId=false)
doesn't update cursor's buffer YET!
Member KDbDriver::concatenateFunctionToString (const KDbBinaryExpression &args, KDbQuerySchemaParameterValueListIterator *params, KDb::ExpressionCallStack *callStack) const
API supporting KDbNArgExpression would be useful so instead of a||b||c can be expressed as CONCAT(a,b,c) instead of CONCAT(CONCAT(a,b),c). This requires changes to the KDbSQL parser.
Member KDbDriver::createConnection (const KDbConnectionData &connData, const KDbConnectionOptions &options)
needed? connData->setDriverId(id());
Member KDbDriver::features () const
change int to Features
Member KDbDriverManager::possibleProblemsMessage () const
make it just QStringList
Member KDbExpression::classForToken (KDbToken token)
support more tokens
Member KDbField::convertToType (const QVariant &value, Type type)
use an array of functions?
Member KDbField::setDefaultValue (const QByteArray &def)

if (!ok || (!(d->options & Unsigned) && (-v > 0x080000000 || v > (0x080000000-1))) || ((d->options & Unsigned) && (v < 0 || v > 0x100000000)))

BigInteger support

Member KDbField::setPrimaryKey (bool p)
is this ok for all engines?
Member KDbField::visibleDecimalPlaces () const
should we keep extended properties here or move them to a QVariant dictionary?
Member KDbFieldList::KDbFieldList (const KDbFieldList &fl, bool deepCopyFields=true)
IMPORTANT: (API) improve deepCopyFields
Class KDbFieldValidator

date/time support for types

add validation of the maximum length and other field's properties

Member KDbFieldValidator::KDbFieldValidator (const KDbField &field, QWidget *parent=nullptr)

merge this code with KexiTableEdit code!

set maximum length validator

handle input mask (via QLineEdit::setInputMask()

handle unsigned (using ULongLongValidator)

add validator

add validator

add BooleanValidator

Member KDbFunctionExpressionData::typeInternal (KDb::ExpressionCallStack *callStack) const override
Member KDbIndexSchema::KDbIndexSchema (const KDbIndexSchema &index, KDbTableSchema *parentTable)
copy relationships!
Member KDbLookupFieldSchema::boundColumn () const
in later implementation there can be more columns
Member KDbLookupFieldSchema::loadFromDom (const QDomElement &lookupEl)
handle fieldlist (retrieve from external table or so?), use KDbLookupFieldSchemaRecordSource::setValues()
Member KDbNativeStatementBuilder::generateCreateTableStatement (KDbEscapedString *target, const KDbTableSchema &tableSchema) const

warning: ^^^^^ this allows only one autonumber per table when AUTO_INCREMENT_REQUIRES_PK==true!

here is automatically a single-field key created

IS this ok for all engines?: if (!autoinc && !field->isPrimaryKey() && field->isNotNull())

Member KDbObjectNameValidator::KDbObjectNameValidator (const KDbDriver *drv, QObject *parent=nullptr)
IMPORTANT: replace QPointer<KDbDriver> m_drv;
Class KDbParser

Add examples

Support more types than the SELECT

Member KDbParser::table ()
Implement this
Class KDbParserError

Make it explicitly shared using SDC

change type to enum

Member KDbPreparedStatement::execute (const KDbPreparedStatementParameters &parameters)
error message?
Class KDbProperties
implement KConfigBase interface here?
Member KDbProperties::KDbProperties (KDbConnection *conn)
IMPORTANT: replace QPointer<KDbConnection> m_conn;
Member KDbQuerySchema::addToWhereExpression (KDbField *field, const QVariant &value, KDbToken relation='=', QString *errorMessage=nullptr, QString *errorDescription=nullptr)
date, time
Member KDbQuerySchema::computeFieldsExpanded (KDbConnection *conn) const

(js): perhaps not all fields should be appended here

KDbQuerySchema itself will also support lookup fields...

Member KDbQuerySchema::fieldsExpanded (KDbConnection *conn, FieldsExpandedMode mode=FieldsExpandedMode::Default) const
js: UPDATE CACHE!
Member KDbQuerySchema::pkeyFieldsOrder (KDbConnection *conn) const
js: UPDATE CACHE!
Member KDbQuerySchema::removeField (KDbField *field) override
should we also remove table for this field or asterisk?
Member KDbQuerySchema::removeTable (KDbTableSchema *table)
remove fields!
Member KDbQuerySchema::table (const QString &tableName) const
maybe use tables_byname?
Member KDbQuerySchema::validate (QString *errorMessage=nullptr, QString *errorDescription=nullptr)
add tests
Class KDbRecordData

consider forking QVariant to a non-shared Variant class, with type information stored elsewhere.

Variant should have toQVariant() method

look if we can have zero-copy strategy for SQLite and other backends

look if we can use memory allocator for strings, etc.

Member KDbResult::init (int code, const QString &message)
Member KDbResult::prependMessage (int code, const QString &message)
IMPORTANT: ERRMSG(this);
Member KDbServerVersionInfo::isNull () const
add this to SDC: bool operator==(const Data& other) const { return false; }
Member KDbSimpleCommandLineApp::KDbSimpleCommandLineApp (int argc, char **argv, const KCmdLineOptions &options, const char *programName, const char *version, const char *shortDescription=0, KAboutData::LicenseKey licenseType=KAboutData::License_Unknown, const char *copyrightStatement=0, const char *text=0, const char *homePageAddress=0, const char *bugsEmailAddress="submit@@bugs.kde.org")
make use of pty/tty here! (and care about portability)
Member KDbTableSchema::copyIndexFrom (const KDbIndexSchema &index)
All relationships should be also copied
Member KDbTableSchema::setPrimaryKey (KDbIndexSchema *pkey)
Class KDbTableViewColumn
improve API
Member KDbTableViewColumn::KDbTableViewColumn (const KDbQuerySchema &query, KDbQueryColumnInfo *aColumnInfo, KDbQueryColumnInfo *aVisibleLookupColumnInfo=nullptr)

compute other auto-name?

remove this when queries become editable ^^^^^^^^^^^^^^

Member KDbTableViewColumn::setReadOnly (bool ro)
synchronize this with table view:
Member KDbTableViewColumn::setVisible (bool v)
react on changes of KDbQueryColumnInfo::visible too
Class KDbTableViewData
improve API
Member KDbTableViewData::autoIncrementedColumn () const

add this as well? void insertRecord(KDbRecordData *record, KDbRecordData *aboveRecord)

what about multiple autoinc columns?

what about changing column order?

Member KDbTableViewData::clearInternal (bool processEvents=true)
this is time consuming: find better data model
Member KDbTableViewData::deleteRecord (KDbRecordData *record, bool repaint=false)
use KDberrorMessage() for description as in KDbTableViewData::saveRecord() *‍/
Member KDbTableViewData::isDBAware () const
virtual?
Member KDbTableViewData::KDbTableViewData (const QList< QVariant > &keys, const QList< QVariant > &values, KDbField::Type keyType=KDbField::Text, KDbField::Type valueType=KDbField::Text)
make this more generic: allow to add more columns!
Member KDbToken::KDbToken ()
add KDbToken(const QByteArray &name)
Member KDbUnaryExpressionData::typeInternal (KDb::ExpressionCallStack *callStack) const override
queryParameterExpressionData->m_type still is Text but can be any type
Member KDbUnaryExpressionData::validateInternal (KDbParseInfo *parseInfo, KDb::ExpressionCallStack *callStack) override

compare types... e.g. NOT applied to Text makes no sense...

IMPORTANT: update type

Member KDbVariableExpressionData::validateInternal (KDbParseInfo *parseInfo, KDb::ExpressionCallStack *callStack) override
shall we also support db name?
Member MysqlConnection::drv_closeDatabase () override
free resources, as far as I know, mysql doesn't support that
Member MysqlConnection::drv_containsTable (const QString &tableName) override
move this somewhere to low level class (MIGRATION?)
Member MysqlConnection::drv_dropDatabase (const QString &dbName=QString()) override
is here escaping needed?
Member MysqlConnection::drv_getServerVersion (KDbServerVersionInfo *version) override
this is hardcoded for now; define api for retrieving variables and use this API...
Member MysqlConnection::drv_prepareSql (const KDbEscapedString &sql) override
use mysql_error()
Member MysqlConnection::drv_useDatabase (const QString &dbName=QString(), bool *cancelled=nullptr, KDbMessageHandler *msgHandler=nullptr) override
is here escaping needed?
Member MysqlDriver::escapeString (const QString &str) const override

support more characters, like %, _

move new_string to KDbDriver::m_new_string or so...

Member MysqlDriver::escapeString (const QByteArray &str) const override
optimize using mysql_real_escape_string()? see https://dev.mysql.com/doc/refman/5.0/en/string-syntax.html
Member MysqlDriver::MysqlDriver (QObject *parent, const QVariantList &args)

Implement buffered/unbuffered cursor, rather than buffer everything. Each MYSQL connection can only handle at most one unbuffered cursor, so MysqlConnection should keep count?

add configuration option

Class MysqlPreparedStatement
3.1 - unfinished: #define KDB_USE_MYSQL_STMT; for 3.0 we're using unoptimized version
Member PostgresqlDriver::isSystemObjectName (const QString &name) const override
implement
Member PostgresqlDriver::PostgresqlDriver (QObject *parent, const QVariantList &args)

enable this when KDb supports multiple: beh->features = MultipleTransactions | CursorForward | CursorBackward;

use QLibrary to resolve PQlibVersion

pgsql default_server_encoding: should be a property of connection

Member PostgresqlDriver::typeForSize (KDbField::Type t, int pqfmod, int *maxTextLength)

using pqfmod not tested

more types such as decimal

Member SqliteConnection::drv_changeFieldProperty (KDbTableSchema *table, KDbField *field, const QString &propertyName, const QVariant &value) override
msg
Member SqliteConnection::drv_containsTable (const QString &tableName) override
move this somewhere to low level class (MIGRATION?)
Member SqlitePreparedStatement::bindValue (KDbField *field, const QVariant &value, int arg)

optimize: make a static copy so SQLITE_STATIC can be used

what about unsigned > INT_MAX ?

what about unsigned > LLONG_MAX ?

Member SqlitePreparedStatement::execute (KDbPreparedStatement::Type type, const KDbField::List &selectFieldList, KDbFieldList *insertFieldList, const KDbPreparedStatementParameters &parameters) override
fetch result
Member SqliteVacuum::readFromStdErr ()
IMPORTANT: m_dlg->setAllowCancel(false);
Member SybaseConnection::drv_containsTable (const QString &tableName)
move this somewhere to low level class (MIGRATION?)
Member SybaseConnection::drv_getTablesList (QStringList *list)
move this somewhere to low level class (MIGRATION?)
Member SybaseConnection::drv_useDatabase (const QString &dbName=QString(), bool *cancelled=0, KDbMessageHandler *msgHandler=0)
is here escaping needed?
Member SybaseDriver::drv_escapeIdentifier (const QString &str) const
verify
Member SybaseDriver::escapeString (const QByteArray &str) const
needs any modification ?
Member SybaseDriver::SybaseDriver (QObject *parent, const QVariantList &args)

Member xBaseConnection::drv_connect (KDbServerVersionInfo *version)
xBase version here
Member xBaseConnection::drv_containsTable (const QString &tableName)
move this somewhere to low level class (MIGRATION?)
Member xBaseConnection::drv_createDatabase (const QString &dbName=QString())
Check whether this function has any use.
Member xBaseConnection::drv_dropDatabase (const QString &dbName=QString())
is here escaping needed
Member xBaseConnection::drv_getDatabasesList (QStringList *list)
Check whether this is the right thing to do
Member xBaseConnection::drv_getTablesList (QStringList *list)
move this somewhere to low level class (MIGRATION?)
Member xBaseConnection::drv_lastInsertRecordId ()
Member xBaseConnection::drv_useDatabase (const QString &dbName=QString(), bool *cancelled=0, KDbMessageHandler *msgHandler=0)
is here escaping needed?
Member xBaseConnection::prepareStatementInternal () override

return new XBasePreparedStatement(*d);

returns nullptr for now

This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:19:08 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.