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
4#include <qsqldriverplugin.h>
5#include <qstringlist.h>
6#include "qsql_psql_p.h"
7
8QT_BEGIN_NAMESPACE
9
10using namespace Qt::StringLiterals;
11
12class QPSQLDriverPlugin : public QSqlDriverPlugin
13{
14 Q_OBJECT
15 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QSqlDriverFactoryInterface" FILE "psql.json")
16
17public:
18 QPSQLDriverPlugin();
19
20 QSqlDriver* create(const QString &) override;
21};
22
23QPSQLDriverPlugin::QPSQLDriverPlugin()
24 : QSqlDriverPlugin()
25{
26}
27
28QSqlDriver* QPSQLDriverPlugin::create(const QString &name)
29{
30 if (name == "QPSQL"_L1)
31 return new QPSQLDriver;
32 return nullptr;
33}
34
35QT_END_NAMESPACE
36
37#include "main.moc"
38

source code of qtbase/src/plugins/sqldrivers/psql/main.cpp