LibreOffice Module connectivity (master) 1
Namespaces | Macros | Typedefs | Functions
pq_databasemetadata.cxx File Reference
#include <algorithm>
#include <string_view>
#include <sal/log.hxx>
#include "pq_databasemetadata.hxx"
#include "pq_driver.hxx"
#include "pq_sequenceresultset.hxx"
#include "pq_statics.hxx"
#include "pq_tools.hxx"
#include <o3tl/string_view.hxx>
#include <rtl/ustrbuf.hxx>
#include <sal/macros.h>
#include <com/sun/star/sdbc/TransactionIsolation.hpp>
#include <com/sun/star/sdbc/ResultSetType.hpp>
#include <com/sun/star/sdbc/XParameters.hpp>
#include <com/sun/star/sdbc/DataType.hpp>
#include <com/sun/star/sdbc/IndexType.hpp>
#include <com/sun/star/sdbc/ColumnValue.hpp>
#include <com/sun/star/sdbc/ColumnSearch.hpp>
#include <utility>
Include dependency graph for pq_databasemetadata.cxx:

Go to the source code of this file.

Namespaces

namespace  pq_sdbc_driver
 

Macros

#define KEYRULE_CASCADE   0
 
#define KEYRULE_RESTRICT   1
 
#define KEYRULE_SET_NULL   2
 
#define KEYRULE_NO_ACTION   4
 
#define KEYRULE_SET_DEFAULT   4
 
#define DEFERRABILITY_INITIALLY_DEFERRED   5
 
#define DEFERRABILITY_INITIALLY_IMMEDIATE   6
 
#define DEFERRABILITY_NONE   7
 
#define SQL_CASE_KEYRULE
 
#define SQL_GET_REFERENCES
 
#define SQL_GET_REFERENCES_PSCHEMA   " AND pkn.nspname = ? "
 
#define SQL_GET_REFERENCES_PTABLE   " AND pkc.relname = ? "
 
#define SQL_GET_REFERENCES_FSCHEMA   " AND fkn.nspname = ? "
 
#define SQL_GET_REFERENCES_FTABLE   " AND fkc.relname = ? "
 
#define SQL_GET_REFERENCES_ORDER_SOME_PTABLE   "ORDER BY fkn.nspname, fkc.relname, conkeyseq"
 
#define SQL_GET_REFERENCES_ORDER_NO_PTABLE   "ORDER BY pkn.nspname, pkc.relname, conkeyseq"
 
#define SQL_GET_REFERENCES_NONE_NONE_NONE_NONE
 
#define SQL_GET_REFERENCES_SOME_NONE_NONE_NONE
 
#define SQL_GET_REFERENCES_NONE_SOME_NONE_NONE
 
#define SQL_GET_REFERENCES_SOME_SOME_NONE_NONE
 
#define SQL_GET_REFERENCES_NONE_NONE_SOME_NONE
 
#define SQL_GET_REFERENCES_NONE_NONE_NONE_SOME
 
#define SQL_GET_REFERENCES_NONE_NONE_SOME_SOME
 
#define SQL_GET_REFERENCES_SOME_NONE_SOME_NONE
 
#define SQL_GET_REFERENCES_SOME_NONE_NONE_SOME
 
#define SQL_GET_REFERENCES_SOME_NONE_SOME_SOME
 
#define SQL_GET_REFERENCES_NONE_SOME_SOME_NONE
 
#define SQL_GET_REFERENCES_NONE_SOME_NONE_SOME
 
#define SQL_GET_REFERENCES_NONE_SOME_SOME_SOME
 
#define SQL_GET_REFERENCES_SOME_SOME_SOME_NONE
 
#define SQL_GET_REFERENCES_SOME_SOME_NONE_SOME
 
#define SQL_GET_REFERENCES_SOME_SOME_SOME_SOME
 

Typedefs

typedef std::unordered_map< sal_Int32, DatabaseTypeDescription > pq_sdbc_driver::Oid2DatabaseTypeDescriptionMap
 

Functions

sal_Int32 pq_sdbc_driver::typeNameToDataType (const OUString &typeName, std::u16string_view typtype)
 returns the constant from sdbc.DataType More...
 
static void pq_sdbc_driver::columnMetaData2DatabaseTypeDescription (Oid2DatabaseTypeDescriptionMap &oidMap, const Reference< XResultSet > &rs, const Reference< XStatement > &stmt)
 

Macro Definition Documentation

◆ DEFERRABILITY_INITIALLY_DEFERRED

#define DEFERRABILITY_INITIALLY_DEFERRED   5

Definition at line 113 of file pq_databasemetadata.cxx.

◆ DEFERRABILITY_INITIALLY_IMMEDIATE

#define DEFERRABILITY_INITIALLY_IMMEDIATE   6

Definition at line 114 of file pq_databasemetadata.cxx.

◆ DEFERRABILITY_NONE

#define DEFERRABILITY_NONE   7

Definition at line 115 of file pq_databasemetadata.cxx.

◆ KEYRULE_CASCADE

#define KEYRULE_CASCADE   0

Definition at line 107 of file pq_databasemetadata.cxx.

◆ KEYRULE_NO_ACTION

#define KEYRULE_NO_ACTION   4

Definition at line 110 of file pq_databasemetadata.cxx.

◆ KEYRULE_RESTRICT

#define KEYRULE_RESTRICT   1

Definition at line 108 of file pq_databasemetadata.cxx.

◆ KEYRULE_SET_DEFAULT

#define KEYRULE_SET_DEFAULT   4

Definition at line 111 of file pq_databasemetadata.cxx.

◆ KEYRULE_SET_NULL

#define KEYRULE_SET_NULL   2

Definition at line 109 of file pq_databasemetadata.cxx.

◆ SQL_CASE_KEYRULE

#define SQL_CASE_KEYRULE
Value:
" WHEN 'c' THEN " SAL_STRINGIFY(KEYRULE_CASCADE) \
" WHEN 'n' THEN " SAL_STRINGIFY(KEYRULE_SET_NULL) \
" WHEN 'd' THEN " SAL_STRINGIFY(KEYRULE_SET_DEFAULT) \
" WHEN 'r' THEN " SAL_STRINGIFY(KEYRULE_RESTRICT) \
" WHEN 'a' THEN " SAL_STRINGIFY(KEYRULE_NO_ACTION) \
" ELSE NULL "
#define SAL_STRINGIFY(x)
#define KEYRULE_RESTRICT
#define KEYRULE_SET_DEFAULT
#define KEYRULE_SET_NULL
#define KEYRULE_CASCADE
#define KEYRULE_NO_ACTION

Definition at line 1789 of file pq_databasemetadata.cxx.

◆ SQL_GET_REFERENCES

#define SQL_GET_REFERENCES
Value:
"WITH con AS (SELECT oid, conname, contype, condeferrable, condeferred, conrelid, confrelid, confupdtype, confdeltype, generate_subscripts(conkey,1) AS conkeyseq, unnest(conkey) AS conkey , unnest(confkey) AS confkey FROM pg_catalog.pg_constraint) " \
"SELECT NULL::text AS PKTABLE_CAT, pkn.nspname AS PKTABLE_SCHEM, pkc.relname AS PKTABLE_NAME, pka.attname AS PKCOLUMN_NAME, " \
" NULL::text AS FKTABLE_CAT, fkn.nspname AS FKTABLE_SCHEM, fkc.relname AS FKTABLE_NAME, fka.attname AS FKCOLUMN_NAME, " \
" con.conkeyseq AS KEY_SEQ, " \
" CASE con.confupdtype " \
SQL_CASE_KEYRULE \
" END AS UPDATE_RULE, " \
" CASE con.confdeltype " \
SQL_CASE_KEYRULE \
" END AS DELETE_RULE, " \
" con.conname AS FK_NAME, pkic.relname AS PK_NAME, " \
" CASE " \
" WHEN con.condeferrable AND con.condeferred THEN " SAL_STRINGIFY(DEFERRABILITY_INITIALLY_DEFERRED) \
" WHEN con.condeferrable THEN " SAL_STRINGIFY(DEFERRABILITY_INITIALLY_IMMEDIATE) \
" END AS DEFERRABILITY " \
"FROM " \
" pg_catalog.pg_namespace pkn, pg_catalog.pg_class pkc, pg_catalog.pg_attribute pka, " \
" pg_catalog.pg_namespace fkn, pg_catalog.pg_class fkc, pg_catalog.pg_attribute fka, " \
" con, pg_catalog.pg_depend dep, pg_catalog.pg_class pkic " \
"WHERE pkn.oid = pkc.relnamespace AND pkc.oid = pka.attrelid AND pka.attnum = con.confkey AND con.confrelid = pkc.oid " \
" AND fkn.oid = fkc.relnamespace AND fkc.oid = fka.attrelid AND fka.attnum = con.conkey AND con.conrelid = fkc.oid " \
" AND con.contype = 'f' AND con.oid = dep.objid AND pkic.oid = dep.refobjid AND pkic.relkind = 'i' AND dep.classid = 'pg_constraint'::regclass::oid AND dep.refclassid = 'pg_class'::regclass::oid "
#define DEFERRABILITY_INITIALLY_IMMEDIATE
#define DEFERRABILITY_NONE
#define DEFERRABILITY_INITIALLY_DEFERRED

Definition at line 1796 of file pq_databasemetadata.cxx.

◆ SQL_GET_REFERENCES_FSCHEMA

#define SQL_GET_REFERENCES_FSCHEMA   " AND fkn.nspname = ? "

Definition at line 1823 of file pq_databasemetadata.cxx.

◆ SQL_GET_REFERENCES_FTABLE

#define SQL_GET_REFERENCES_FTABLE   " AND fkc.relname = ? "

Definition at line 1824 of file pq_databasemetadata.cxx.

◆ SQL_GET_REFERENCES_NONE_NONE_NONE_NONE

#define SQL_GET_REFERENCES_NONE_NONE_NONE_NONE
Value:
SQL_GET_REFERENCES \
SQL_GET_REFERENCES_ORDER_NO_PTABLE

Definition at line 1828 of file pq_databasemetadata.cxx.

◆ SQL_GET_REFERENCES_NONE_NONE_NONE_SOME

#define SQL_GET_REFERENCES_NONE_NONE_NONE_SOME
Value:
SQL_GET_REFERENCES \
SQL_GET_REFERENCES_FTABLE \
SQL_GET_REFERENCES_ORDER_NO_PTABLE

Definition at line 1853 of file pq_databasemetadata.cxx.

◆ SQL_GET_REFERENCES_NONE_NONE_SOME_NONE

#define SQL_GET_REFERENCES_NONE_NONE_SOME_NONE
Value:
SQL_GET_REFERENCES \
SQL_GET_REFERENCES_FSCHEMA \
SQL_GET_REFERENCES_ORDER_NO_PTABLE

Definition at line 1848 of file pq_databasemetadata.cxx.

◆ SQL_GET_REFERENCES_NONE_NONE_SOME_SOME

#define SQL_GET_REFERENCES_NONE_NONE_SOME_SOME
Value:
SQL_GET_REFERENCES \
SQL_GET_REFERENCES_FSCHEMA \
SQL_GET_REFERENCES_FTABLE \
SQL_GET_REFERENCES_ORDER_NO_PTABLE

Definition at line 1858 of file pq_databasemetadata.cxx.

◆ SQL_GET_REFERENCES_NONE_SOME_NONE_NONE

#define SQL_GET_REFERENCES_NONE_SOME_NONE_NONE
Value:
SQL_GET_REFERENCES \
SQL_GET_REFERENCES_PTABLE \
SQL_GET_REFERENCES_ORDER_SOME_PTABLE

Definition at line 1837 of file pq_databasemetadata.cxx.

◆ SQL_GET_REFERENCES_NONE_SOME_NONE_SOME

#define SQL_GET_REFERENCES_NONE_SOME_NONE_SOME
Value:
SQL_GET_REFERENCES \
SQL_GET_REFERENCES_PTABLE \
SQL_GET_REFERENCES_FTABLE \
SQL_GET_REFERENCES_ORDER_SOME_PTABLE

Definition at line 1889 of file pq_databasemetadata.cxx.

◆ SQL_GET_REFERENCES_NONE_SOME_SOME_NONE

#define SQL_GET_REFERENCES_NONE_SOME_SOME_NONE
Value:
SQL_GET_REFERENCES \
SQL_GET_REFERENCES_PTABLE \
SQL_GET_REFERENCES_FSCHEMA \
SQL_GET_REFERENCES_ORDER_SOME_PTABLE

Definition at line 1883 of file pq_databasemetadata.cxx.

◆ SQL_GET_REFERENCES_NONE_SOME_SOME_SOME

#define SQL_GET_REFERENCES_NONE_SOME_SOME_SOME
Value:
SQL_GET_REFERENCES \
SQL_GET_REFERENCES_PTABLE \
SQL_GET_REFERENCES_FSCHEMA \
SQL_GET_REFERENCES_FTABLE \
SQL_GET_REFERENCES_ORDER_SOME_PTABLE

Definition at line 1895 of file pq_databasemetadata.cxx.

◆ SQL_GET_REFERENCES_ORDER_NO_PTABLE

#define SQL_GET_REFERENCES_ORDER_NO_PTABLE   "ORDER BY pkn.nspname, pkc.relname, conkeyseq"

Definition at line 1826 of file pq_databasemetadata.cxx.

◆ SQL_GET_REFERENCES_ORDER_SOME_PTABLE

#define SQL_GET_REFERENCES_ORDER_SOME_PTABLE   "ORDER BY fkn.nspname, fkc.relname, conkeyseq"

Definition at line 1825 of file pq_databasemetadata.cxx.

◆ SQL_GET_REFERENCES_PSCHEMA

#define SQL_GET_REFERENCES_PSCHEMA   " AND pkn.nspname = ? "

Definition at line 1821 of file pq_databasemetadata.cxx.

◆ SQL_GET_REFERENCES_PTABLE

#define SQL_GET_REFERENCES_PTABLE   " AND pkc.relname = ? "

Definition at line 1822 of file pq_databasemetadata.cxx.

◆ SQL_GET_REFERENCES_SOME_NONE_NONE_NONE

#define SQL_GET_REFERENCES_SOME_NONE_NONE_NONE
Value:
SQL_GET_REFERENCES \
SQL_GET_REFERENCES_PSCHEMA \
SQL_GET_REFERENCES_ORDER_NO_PTABLE

Definition at line 1832 of file pq_databasemetadata.cxx.

◆ SQL_GET_REFERENCES_SOME_NONE_NONE_SOME

#define SQL_GET_REFERENCES_SOME_NONE_NONE_SOME
Value:
SQL_GET_REFERENCES \
SQL_GET_REFERENCES_PSCHEMA \
SQL_GET_REFERENCES_FTABLE \
SQL_GET_REFERENCES_ORDER_NO_PTABLE

Definition at line 1870 of file pq_databasemetadata.cxx.

◆ SQL_GET_REFERENCES_SOME_NONE_SOME_NONE

#define SQL_GET_REFERENCES_SOME_NONE_SOME_NONE
Value:
SQL_GET_REFERENCES \
SQL_GET_REFERENCES_PSCHEMA \
SQL_GET_REFERENCES_FSCHEMA \
SQL_GET_REFERENCES_ORDER_NO_PTABLE

Definition at line 1864 of file pq_databasemetadata.cxx.

◆ SQL_GET_REFERENCES_SOME_NONE_SOME_SOME

#define SQL_GET_REFERENCES_SOME_NONE_SOME_SOME
Value:
SQL_GET_REFERENCES \
SQL_GET_REFERENCES_PSCHEMA \
SQL_GET_REFERENCES_FSCHEMA \
SQL_GET_REFERENCES_FTABLE \
SQL_GET_REFERENCES_ORDER_NO_PTABLE

Definition at line 1876 of file pq_databasemetadata.cxx.

◆ SQL_GET_REFERENCES_SOME_SOME_NONE_NONE

#define SQL_GET_REFERENCES_SOME_SOME_NONE_NONE
Value:
SQL_GET_REFERENCES \
SQL_GET_REFERENCES_PSCHEMA \
SQL_GET_REFERENCES_PTABLE \
SQL_GET_REFERENCES_ORDER_SOME_PTABLE

Definition at line 1842 of file pq_databasemetadata.cxx.

◆ SQL_GET_REFERENCES_SOME_SOME_NONE_SOME

#define SQL_GET_REFERENCES_SOME_SOME_NONE_SOME
Value:
SQL_GET_REFERENCES \
SQL_GET_REFERENCES_PSCHEMA \
SQL_GET_REFERENCES_PTABLE \
SQL_GET_REFERENCES_FTABLE \
SQL_GET_REFERENCES_ORDER_SOME_PTABLE

Definition at line 1909 of file pq_databasemetadata.cxx.

◆ SQL_GET_REFERENCES_SOME_SOME_SOME_NONE

#define SQL_GET_REFERENCES_SOME_SOME_SOME_NONE
Value:
SQL_GET_REFERENCES \
SQL_GET_REFERENCES_PSCHEMA \
SQL_GET_REFERENCES_PTABLE \
SQL_GET_REFERENCES_FSCHEMA \
SQL_GET_REFERENCES_ORDER_SOME_PTABLE

Definition at line 1902 of file pq_databasemetadata.cxx.

◆ SQL_GET_REFERENCES_SOME_SOME_SOME_SOME

#define SQL_GET_REFERENCES_SOME_SOME_SOME_SOME
Value:
SQL_GET_REFERENCES \
SQL_GET_REFERENCES_PSCHEMA \
SQL_GET_REFERENCES_PTABLE \
SQL_GET_REFERENCES_FSCHEMA \
SQL_GET_REFERENCES_FTABLE \
SQL_GET_REFERENCES_ORDER_SOME_PTABLE

Definition at line 1916 of file pq_databasemetadata.cxx.

Variable Documentation

◆ typeName

OUString typeName

◆ typeType

OUString typeType

Definition at line 1383 of file pq_databasemetadata.cxx.