summaryrefslogtreecommitdiffstats
path: root/src/sql/doc/snippets/code/src_sql_kernel_qsqlresult_snippet.cpp
blob: e17977bf5479d49685f711f9e679e8c71e3b32dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

//! [2]
if (qstrcmp(v.typeName(), "PGresult*") == 0) {
    PGresult *handle = *static_cast<PGresult **>(v.data());
    if (handle) {
        // ...
        }
}

if (qstrcmp(v.typeName(), "MYSQL_STMT*") == 0) {
    MYSQL_STMT *handle = *static_cast<MYSQL_STMT **>(v.data());
    if (handle) {
        // ...
        }
    }
//! [2]