38#include <com/sun/star/sdbc/DataType.hpp>
39#include <com/sun/star/beans/PropertyAttribute.hpp>
43using com::sun::star::uno::Any;
44using com::sun::star::uno::Type;
46using com::sun::star::beans::PropertyAttribute::READONLY;
47using com::sun::star::beans::Property;
54struct DefColumnMetaData
72 PropertyDef( OUString str,
const Type &t )
78struct PropertyDefEx :
public PropertyDef
80 PropertyDefEx(
const OUString & str,
const Type &
t , sal_Int32
a )
89 PropertyDef
const *props,
int count , sal_Int16 attr )
92 auto seqRange = asNonConstRange(seq);
101 PropertyDefEx
const *props,
int count )
104 auto seqRange = asNonConstRange(seq);
117 statics.
TABLE =
"TABLE";
118 statics.
VIEW =
"VIEW";
126 statics.
TYPE =
"Type";
128 statics.
NAME =
"Name";
140 statics.
SCALE =
"Scale";
143 statics.
BEGIN =
"BEGIN";
144 statics.
COMMIT =
"COMMIT";
157 statics.
USER =
"User";
188 ist.
implName =
"org.openoffice.comp.pq.sdbcx.Table";
190 PropertyDef tableDef[] =
194 PropertyDef( statics.
NAME , tString ),
197 PropertyDef( statics.
TYPE , tString )
200 tableDef, std::size(tableDef),
READONLY );
203 "org.openoffice.comp.pq.sdbcx.TableDescriptor";
205 PropertyDef tableDescDef[] =
209 PropertyDef( statics.
NAME , tString ),
214 tableDescDef, std::size(tableDescDef), 0 );
219 PropertyDefEx columnDef[] =
236 columnDef, std::size(columnDef) );
239 "org.openoffice.comp.pq.sdbcx.ColumnDescriptor";
241 PropertyDef columnDescDef[] =
251 PropertyDef( statics.
NAME , tString ),
253 PropertyDef( statics.
SCALE , tInt ),
254 PropertyDef( statics.
TYPE , tInt ),
255 PropertyDef( statics.
TYPE_NAME , tString )
259 columnDescDef, std::size(columnDescDef), 0 );
264 PropertyDef keyDef[] =
267 PropertyDef( statics.
NAME, tString ),
271 PropertyDef( statics.
TYPE, tInt ),
275 keyDef, std::size(keyDef),
READONLY );
280 "org.openoffice.comp.pq.sdbcx.KeyDescriptor";
282 PropertyDef keyDescDef[] =
285 PropertyDef( statics.
NAME, tString ),
287 PropertyDef( statics.
TYPE, tInt ),
291 keyDescDef, std::size(keyDescDef), 0 );
297 PropertyDef keycolumnDef[] =
306 PropertyDef( statics.
NAME , tString ),
309 PropertyDef( statics.
SCALE , tInt ),
310 PropertyDef( statics.
TYPE , tInt ),
311 PropertyDef( statics.
TYPE_NAME , tString )
314 keycolumnDef, std::size(keycolumnDef),
READONLY );
318 "org.openoffice.comp.pq.sdbcx.KeyColumnDescriptor";
320 {
"com.sun.star.sdbcx.KeyColumnDescriptor" };
321 PropertyDef keycolumnDescDef[] =
323 PropertyDef( statics.
NAME , tString ),
327 keycolumnDescDef, std::size(keycolumnDescDef), 0 );
332 PropertyDef viewDef[] =
336 PropertyDef( statics.
COMMAND , tString ),
337 PropertyDef( statics.
NAME , tString ),
341 viewDef, std::size(viewDef),
READONLY );
347 viewDef, std::size(viewDef), 0 );
351 PropertyDef userDefRO[] =
353 PropertyDef( statics.
NAME , tString )
356 userDefRO, std::size(userDefRO),
READONLY );
360 "org.openoffice.comp.pq.sdbcx.UserDescriptor";
362 PropertyDef userDefWR[] =
364 PropertyDef( statics.
NAME , tString ),
365 PropertyDef( statics.
PASSWORD , tString )
368 userDefWR, std::size(userDefWR), 0 );
373 PropertyDef indexDef[] =
375 PropertyDef( statics.
CATALOG , tString ),
379 PropertyDef( statics.
NAME , tString ),
383 indexDef, std::size(indexDef),
READONLY );
387 "org.openoffice.comp.pq.sdbcx.IndexDescriptor";
390 indexDef, std::size(indexDef), 0 );
395 PropertyDef indexColumnDef[] =
405 PropertyDef( statics.
NAME , tString ),
407 PropertyDef( statics.
SCALE , tInt ),
408 PropertyDef( statics.
TYPE , tInt ),
409 PropertyDef( statics.
TYPE_NAME , tString )
412 indexColumnDef, std::size(indexColumnDef),
READONLY );
416 "org.openoffice.comp.pq.sdbcx.IndexColumnDescriptor";
418 {
"com.sun.star.sdbcx.IndexColumnDescriptor" };
419 PropertyDef indexColumnDescDef[] =
422 PropertyDef( statics.
NAME , tString )
425 indexColumnDescDef, std::size(indexColumnDescDef), 0 );
443 statics.
SELECT =
"SELECT";
444 statics.
UPDATE =
"UPDATE";
445 statics.
INSERT =
"INSERT";
446 statics.
DELETE =
"DELETE";
447 statics.
RULE =
"RULE";
451 statics.
USAGE =
"USAGE";
452 statics.
CREATE =
"CREATE";
454 statics.
INDEX =
"Index";
457 statics.
schemaNames = std::vector< OUString > ( 1 );
460 statics.
tableTypeData = std::vector< std::vector< Any > >( 2 );
476 "TABLE_CAT",
"TABLE_SCHEM",
"TABLE_NAME",
"COLUMN_NAME",
477 "DATA_TYPE",
"TYPE_NAME",
"COLUMN_SIZE",
"BUFFER_LENGTH",
478 "DECIMAL_DIGITS",
"NUM_PREC_RADIX",
"NULLABLE",
"REMARKS",
479 "COLUMN_DEF",
"SQL_DATA_TYPE",
"SQL_DATETIME_SUB",
"CHAR_OCTET_LENGTH",
480 "ORDINAL_POSITION",
"IS_NULLABLE"
485 "TYPE_NAME",
"DATA_TYPE",
"PRECISION",
"LITERAL_PREFIX",
486 "LITERAL_SUFFIX",
"CREATE_PARAMS",
"NULLABLE",
"CASE_SENSITIVE",
487 "SEARCHABLE",
"UNSIGNED_ATTRIBUTE",
"FIXED_PREC_SCALE",
488 "AUTO_INCREMENT",
"LOCAL_TYPE_NAME",
"MINIMUM_SCALE",
489 "MAXIMUM_SCALE",
"SQL_DATA_TYPE",
"SQL_DATETIME_SUB",
495 "TABLE_CAT",
"TABLE_SCHEM",
"TABLE_NAME",
496 "NON_UNIQUE",
"INDEX_QUALIFIER",
"INDEX_NAME",
497 "TYPE",
"ORDINAL_POSITION",
"COLUMN_NAME",
498 "ASC_OR_DESC",
"CARDINALITY",
"PAGES",
"FILTER_CONDITION"
504 BaseTypeDef baseTypeDefs[] =
506 {
"bool" , css::sdbc::DataType::BOOLEAN },
507 {
"bytea", css::sdbc::DataType::VARBINARY },
508 {
"char" , css::sdbc::DataType::CHAR },
510 {
"int8" , css::sdbc::DataType::BIGINT },
511 {
"serial8" , css::sdbc::DataType::BIGINT },
514 {
"int2" , css::sdbc::DataType::SMALLINT },
516 {
"int4" , css::sdbc::DataType::INTEGER },
524 {
"text", css::sdbc::DataType::LONGVARCHAR },
525 {
"bpchar", css::sdbc::DataType::CHAR },
526 {
"varchar", css::sdbc::DataType::VARCHAR },
528 {
"float4", css::sdbc::DataType::REAL },
529 {
"float8", css::sdbc::DataType::DOUBLE },
531 {
"numeric", css::sdbc::DataType::NUMERIC },
532 {
"decimal", css::sdbc::DataType::DECIMAL },
534 {
"date", css::sdbc::DataType::DATE },
535 {
"time", css::sdbc::DataType::TIME },
536 {
"timestamp", css::sdbc::DataType::TIMESTAMP },
570 for(
i = 0 ; baseTypeDefs[
i].typeName ;
i ++ )
573 OUString::createFromAscii( baseTypeDefs[
i].
typeName) ] =
574 baseTypeDefs[
i].value;
580 DefColumnMetaData defTypeInfoMetaData[] =
582 {
"TYPE_NAME",
"TYPEINFO",
"pg_catalog",
"", css::sdbc::DataType::VARCHAR, 0,50,
false,
false,
false },
583 {
"DATA_TYPE",
"TYPEINFO",
"pg_catalog",
"", css::sdbc::DataType::SMALLINT, 0,50,
false,
false,
false },
584 {
"PRECISION",
"TYPEINFO",
"pg_catalog",
"", css::sdbc::DataType::INTEGER, 0,50,
false,
false,
false },
585 {
"LITERAL_PREFIX",
"TYPEINFO",
"pg_catalog",
"", css::sdbc::DataType::VARCHAR, 0,50,
false,
false,
false },
586 {
"LITERAL_SUFFIX",
"TYPEINFO",
"pg_catalog",
"", css::sdbc::DataType::VARCHAR, 0,50,
false,
false,
false },
587 {
"CREATE_PARAMS",
"TYPEINFO",
"pg_catalog",
"", css::sdbc::DataType::VARCHAR, 0,50,
false,
false,
false },
588 {
"NULLABLE",
"TYPEINFO",
"pg_catalog",
"", css::sdbc::DataType::INTEGER, 0,50,
false,
false,
false },
589 {
"CASE_SENSITIVE",
"TYPEINFO",
"pg_catalog",
"", css::sdbc::DataType::BOOLEAN, 0,50,
false,
false,
false },
590 {
"SEARCHABLE",
"TYPEINFO",
"pg_catalog",
"", css::sdbc::DataType::SMALLINT, 0,50,
false,
false,
false },
591 {
"UNSIGNED_ATTRIBUTE",
"TYPEINFO",
"pg_catalog",
"", css::sdbc::DataType::BOOLEAN, 0,50,
false,
false,
false },
592 {
"FIXED_PREC_SCALE",
"TYPEINFO",
"pg_catalog",
"", css::sdbc::DataType::BOOLEAN, 0,50,
false,
false,
false },
593 {
"AUTO_INCREMENT",
"TYPEINFO",
"pg_catalog",
"", css::sdbc::DataType::BOOLEAN, 0,50,
false,
false,
false },
594 {
"LOCAL_TYPE_NAME",
"TYPEINFO",
"pg_catalog",
"", css::sdbc::DataType::VARCHAR, 0,50,
false,
false,
false },
595 {
"MINIMUM_SCALE",
"TYPEINFO",
"pg_catalog",
"", css::sdbc::DataType::SMALLINT, 0,50,
false,
false,
false},
596 {
"MAXIMUM_SCALE",
"TYPEINFO",
"pg_catalog",
"", css::sdbc::DataType::SMALLINT, 0,50,
false,
false,
false },
597 {
"SQL_DATA_TYPE",
"TYPEINFO",
"pg_catalog",
"", css::sdbc::DataType::INTEGER, 0,50,
false,
false,
false },
598 {
"SQL_DATETIME_SUB",
"TYPEINFO",
"pg_catalog",
"", css::sdbc::DataType::INTEGER, 0,50,
false,
false,
false},
599 {
"NUM_PREC_RADIX",
"TYPEINFO",
"pg_catalog",
"", css::sdbc::DataType::INTEGER, 0,50,
false,
false,
false },
600 {
nullptr,
nullptr,
nullptr,
nullptr,0,0,0,
false,
false,
false}
603 for(
i = 0 ; defTypeInfoMetaData[
i].columnName ;
i++ )
607 OUString::createFromAscii( defTypeInfoMetaData[
i].
columnName ),
608 OUString::createFromAscii( defTypeInfoMetaData[
i].
tableName ),
610 OUString::createFromAscii( defTypeInfoMetaData[
i].
typeName ),
611 defTypeInfoMetaData[
i].
type,
613 defTypeInfoMetaData[
i].
scale,
css::uno::Type const & get()
const sal_Int32 TABLE_INDEX_SCHEMA
static Any isAutoIncrement(std::u16string_view defaultValue)
const sal_Int32 TABLE_INDEX_TYPE
const sal_Int32 TABLE_INDEX_REMARKS
const sal_Int32 TABLE_INDEX_NAME
const sal_Int32 TABLE_INDEX_CATALOG
static Any isCurrency(std::u16string_view typeName)
static cppu::IPropertyArrayHelper * createPropertyArrayHelper(PropertyDef const *props, int count, sal_Int16 attr)
const char * schemaTableName
css::uno::Sequence< OUString > serviceNames
cppu::IPropertyArrayHelper * pProps
struct ImplementationStatics viewDescriptor
struct ImplementationStatics indexDescriptor
struct ImplementationStatics user
struct ImplementationStatics keycolumnDescriptor
struct ImplementationStatics key
struct ImplementationStatics keycolumn
struct ImplementationStatics column
struct ImplementationStatics keyDescriptor
struct ImplementationStatics table
struct ImplementationStatics indexColumn
struct ImplementationStatics index
struct ImplementationStatics view
struct ImplementationStatics tableDescriptor
struct ImplementationStatics columnDescriptor
struct ImplementationStatics indexColumnDescriptor
struct ImplementationStatics userDescriptor
std::vector< OUString > typeinfoColumnNames
OUString PRIVATE_COLUMN_INDEXES
std::vector< OUString > tableTypeNames
OUString ESCAPE_PROCESSING
std::vector< OUString > indexinfoColumnNames
OUString IS_AUTO_INCREMENT
std::vector< OUString > columnRowNames
OUString RESULT_SET_CONCURRENCY
OUString IS_PRIMARY_KEY_INDEX
ColumnMetaDataVector typeInfoMetaData
std::vector< OUString > primaryKeyNames
ReflectionImplementations refl
std::vector< OUString > tablesRowNames
OUString PRIVATE_FOREIGN_COLUMNS
std::vector< std::vector< css::uno::Any > > tableTypeData
OUString REFERENCED_TABLE
OUString NULLABLE_UNKNOWN
std::vector< OUString > schemaNames
std::vector< OUString > resultSetArrayColumnNames