Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qv4sqlerrors.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant
4
6#include "private/qv4engine_p.h"
7#include "private/qv4object_p.h"
8
10
11using namespace QV4;
12
13void qt_add_sqlexceptions(QV4::ExecutionEngine *engine)
14{
15 Scope scope(engine);
16 ScopedObject sqlexception(scope, engine->newObject());
17 sqlexception->defineReadonlyProperty(QStringLiteral("UNKNOWN_ERR"), Value::fromInt32(SQLEXCEPTION_UNKNOWN_ERR));
18 sqlexception->defineReadonlyProperty(QStringLiteral("DATABASE_ERR"), Value::fromInt32(SQLEXCEPTION_DATABASE_ERR));
19 sqlexception->defineReadonlyProperty(QStringLiteral("VERSION_ERR"), Value::fromInt32(SQLEXCEPTION_VERSION_ERR));
20 sqlexception->defineReadonlyProperty(QStringLiteral("TOO_LARGE_ERR"), Value::fromInt32(SQLEXCEPTION_TOO_LARGE_ERR));
21 sqlexception->defineReadonlyProperty(QStringLiteral("QUOTA_ERR"), Value::fromInt32(SQLEXCEPTION_QUOTA_ERR));
22 sqlexception->defineReadonlyProperty(QStringLiteral("SYNTAX_ERR"), Value::fromInt32(SQLEXCEPTION_SYNTAX_ERR));
23 sqlexception->defineReadonlyProperty(QStringLiteral("CONSTRAINT_ERR"), Value::fromInt32(SQLEXCEPTION_CONSTRAINT_ERR));
24 sqlexception->defineReadonlyProperty(QStringLiteral("TIMEOUT_ERR"), Value::fromInt32(SQLEXCEPTION_TIMEOUT_ERR));
25 engine->globalObject->defineDefaultProperty(QStringLiteral("SQLException"), sqlexception);
26}
27
28QT_END_NAMESPACE
Definition qjsvalue.h:23
void qt_add_sqlexceptions(QV4::ExecutionEngine *engine)
#define SQLEXCEPTION_TIMEOUT_ERR
#define SQLEXCEPTION_UNKNOWN_ERR
#define SQLEXCEPTION_DATABASE_ERR
#define SQLEXCEPTION_QUOTA_ERR
#define SQLEXCEPTION_VERSION_ERR
#define SQLEXCEPTION_SYNTAX_ERR
#define SQLEXCEPTION_TOO_LARGE_ERR
#define SQLEXCEPTION_CONSTRAINT_ERR