[#3254] Add support for PostgreSQL materialized views
This commit is contained in:
parent
bb285924d9
commit
e9ddeaff62
@ -48,6 +48,7 @@ import static org.jooq.impl.DSL.field;
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.DSL.max;
|
||||
import static org.jooq.impl.DSL.name;
|
||||
import static org.jooq.impl.DSL.row;
|
||||
import static org.jooq.impl.DSL.select;
|
||||
import static org.jooq.impl.DSL.selectOne;
|
||||
import static org.jooq.impl.DSL.upper;
|
||||
@ -263,6 +264,7 @@ public class PostgresDatabase extends AbstractDatabase {
|
||||
TABLES.TABLE_NAME,
|
||||
TABLES.TABLE_NAME.as("specific_name"),
|
||||
inline(false).as("table_valued_function"),
|
||||
inline(false).as("materialized_view"),
|
||||
PG_DESCRIPTION.DESCRIPTION)
|
||||
.from(TABLES)
|
||||
.join(PG_NAMESPACE)
|
||||
@ -275,6 +277,37 @@ public class PostgresDatabase extends AbstractDatabase {
|
||||
.and(PG_DESCRIPTION.OBJSUBID.eq(0))
|
||||
.where(TABLES.TABLE_SCHEMA.in(getInputSchemata()))
|
||||
|
||||
// To stay on the safe side, if the INFORMATION_SCHEMA ever
|
||||
// includs materialised views, let's exclude them from here
|
||||
.and(row(TABLES.TABLE_SCHEMA, TABLES.TABLE_NAME).notIn(
|
||||
select(
|
||||
PG_NAMESPACE.NSPNAME,
|
||||
PG_CLASS.RELNAME)
|
||||
.from(PG_CLASS)
|
||||
.join(PG_NAMESPACE)
|
||||
.on(PG_CLASS.RELNAMESPACE.eq(oid(PG_NAMESPACE)))
|
||||
.where(PG_CLASS.RELKIND.eq(inline("m")))
|
||||
))
|
||||
|
||||
// [#3254] Materialised views are reported only in PG_CLASS, not
|
||||
// in INFORMATION_SCHEMA.TABLES
|
||||
.unionAll(
|
||||
select(
|
||||
PG_NAMESPACE.NSPNAME,
|
||||
PG_CLASS.RELNAME,
|
||||
PG_CLASS.RELNAME,
|
||||
inline(false).as("table_valued_function"),
|
||||
inline(true).as("materialized_view"),
|
||||
PG_DESCRIPTION.DESCRIPTION)
|
||||
.from(PG_CLASS)
|
||||
.join(PG_NAMESPACE)
|
||||
.on(PG_CLASS.RELNAMESPACE.eq(oid(PG_NAMESPACE)))
|
||||
.leftOuterJoin(PG_DESCRIPTION)
|
||||
.on(PG_DESCRIPTION.OBJOID.eq(oid(PG_CLASS)))
|
||||
.and(PG_DESCRIPTION.OBJSUBID.eq(0))
|
||||
.where(PG_NAMESPACE.NSPNAME.in(getInputSchemata()))
|
||||
.and(PG_CLASS.RELKIND.eq(inline("m"))))
|
||||
|
||||
// [#3375] [#3376] Include table-valued functions in the set of tables
|
||||
.unionAll(
|
||||
select(
|
||||
@ -282,6 +315,7 @@ public class PostgresDatabase extends AbstractDatabase {
|
||||
ROUTINES.ROUTINE_NAME,
|
||||
ROUTINES.SPECIFIC_NAME,
|
||||
inline(true).as("table_valued_function"),
|
||||
inline(false).as("materialized_view"),
|
||||
inline(""))
|
||||
.from(ROUTINES)
|
||||
.join(PG_NAMESPACE).on(ROUTINES.SPECIFIC_SCHEMA.eq(PG_NAMESPACE.NSPNAME))
|
||||
@ -296,11 +330,15 @@ public class PostgresDatabase extends AbstractDatabase {
|
||||
SchemaDefinition schema = getSchema(record.getValue(TABLES.TABLE_SCHEMA));
|
||||
String name = record.getValue(TABLES.TABLE_NAME);
|
||||
boolean tableValuedFunction = record.getValue("table_valued_function", boolean.class);
|
||||
boolean materializedView = record.getValue("materialized_view", boolean.class);
|
||||
String comment = record.getValue(PG_DESCRIPTION.DESCRIPTION, String.class);
|
||||
|
||||
if (tableValuedFunction) {
|
||||
result.add(new PostgresTableValuedFunction(schema, name, record.getValue(ROUTINES.SPECIFIC_NAME), comment));
|
||||
}
|
||||
else if (materializedView) {
|
||||
result.add(new PostgresMaterializedViewDefinition(schema, name, comment));
|
||||
}
|
||||
else {
|
||||
PostgresTableDefinition t = new PostgresTableDefinition(schema, name, comment);
|
||||
result.add(t);
|
||||
|
||||
@ -0,0 +1,195 @@
|
||||
/**
|
||||
* Copyright (c) 2009-2015, Data Geekery GmbH (http://www.datageekery.com)
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* Other licenses:
|
||||
* -----------------------------------------------------------------------------
|
||||
* Commercial licenses for this work are available. These replace the above
|
||||
* ASL 2.0 and offer limited warranties, support, maintenance, and commercial
|
||||
* database integrations.
|
||||
*
|
||||
* For more information, please visit: http://www.jooq.org/licenses
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
package org.jooq.util.postgres;
|
||||
|
||||
import static org.jooq.impl.DSL.condition;
|
||||
import static org.jooq.impl.DSL.field;
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.DSL.not;
|
||||
import static org.jooq.impl.DSL.nvl;
|
||||
import static org.jooq.impl.DSL.when;
|
||||
import static org.jooq.tools.StringUtils.defaultString;
|
||||
import static org.jooq.util.postgres.PostgresDSL.oid;
|
||||
import static org.jooq.util.postgres.information_schema.Tables.COLUMNS;
|
||||
import static org.jooq.util.postgres.pg_catalog.Tables.PG_ATTRDEF;
|
||||
import static org.jooq.util.postgres.pg_catalog.Tables.PG_ATTRIBUTE;
|
||||
import static org.jooq.util.postgres.pg_catalog.Tables.PG_CLASS;
|
||||
import static org.jooq.util.postgres.pg_catalog.Tables.PG_COLLATION;
|
||||
import static org.jooq.util.postgres.pg_catalog.Tables.PG_DESCRIPTION;
|
||||
import static org.jooq.util.postgres.pg_catalog.Tables.PG_NAMESPACE;
|
||||
import static org.jooq.util.postgres.pg_catalog.Tables.PG_TYPE;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.jooq.Record;
|
||||
import org.jooq.util.AbstractTableDefinition;
|
||||
import org.jooq.util.ColumnDefinition;
|
||||
import org.jooq.util.DataTypeDefinition;
|
||||
import org.jooq.util.DefaultColumnDefinition;
|
||||
import org.jooq.util.DefaultDataTypeDefinition;
|
||||
import org.jooq.util.SchemaDefinition;
|
||||
import org.jooq.util.postgres.information_schema.tables.Columns;
|
||||
import org.jooq.util.postgres.pg_catalog.tables.PgAttrdef;
|
||||
import org.jooq.util.postgres.pg_catalog.tables.PgAttribute;
|
||||
import org.jooq.util.postgres.pg_catalog.tables.PgClass;
|
||||
import org.jooq.util.postgres.pg_catalog.tables.PgCollation;
|
||||
import org.jooq.util.postgres.pg_catalog.tables.PgNamespace;
|
||||
import org.jooq.util.postgres.pg_catalog.tables.PgType;
|
||||
|
||||
/**
|
||||
* @author Lukas Eder
|
||||
*/
|
||||
public class PostgresMaterializedViewDefinition extends AbstractTableDefinition {
|
||||
|
||||
public PostgresMaterializedViewDefinition(SchemaDefinition schema, String name, String comment) {
|
||||
super(schema, name, comment);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ColumnDefinition> getElements0() throws SQLException {
|
||||
List<ColumnDefinition> result = new ArrayList<ColumnDefinition>();
|
||||
|
||||
Columns col = COLUMNS;
|
||||
PgAttribute a = PG_ATTRIBUTE.as("a");
|
||||
PgAttrdef ad = PG_ATTRDEF.as("ad");
|
||||
PgType t = PG_TYPE.as("t");
|
||||
PgType bt = PG_TYPE.as("bt");
|
||||
PgClass c = PG_CLASS.as("c");
|
||||
PgCollation co = PG_COLLATION.as("co");
|
||||
PgNamespace nt = PG_NAMESPACE.as("nt");
|
||||
PgNamespace nc = PG_NAMESPACE.as("nc");
|
||||
PgNamespace nbt = PG_NAMESPACE.as("nbt");
|
||||
PgNamespace nco = PG_NAMESPACE.as("nco");
|
||||
|
||||
for (Record record : create().select(
|
||||
field("({0})::information_schema.sql_identifier", col.COLUMN_NAME.getDataType(), a.ATTNAME).as(col.COLUMN_NAME),
|
||||
field("({0})::information_schema.cardinal_number", col.ORDINAL_POSITION.getDataType(), a.ATTNUM).as(col.ORDINAL_POSITION),
|
||||
field("({0})::information_schema.character_data", col.DATA_TYPE.getDataType(),
|
||||
when(t.TYPTYPE.eq(inline("d")),
|
||||
when(bt.TYPELEM.ne(inline(0L)).and(bt.TYPLEN.eq(inline((short) -1))), inline("ARRAY"))
|
||||
.when(nbt.NSPNAME.eq(inline("pg_catalog")), field("format_type({0}, NULL::integer)", String.class, t.TYPBASETYPE))
|
||||
.otherwise(inline("USER-DEFINED")))
|
||||
.otherwise(
|
||||
when(t.TYPELEM.ne(inline(0L)).and(t.TYPLEN.eq(inline((short) -1))), inline("ARRAY"))
|
||||
.when(nt.NSPNAME.eq(inline("pg_catalog")), field("format_type({0}, NULL::integer)", String.class, a.ATTTYPID))
|
||||
.otherwise(inline("USER-DEFINED")))).as(col.DATA_TYPE),
|
||||
field("(information_schema._pg_char_max_length(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)))::information_schema.cardinal_number", col.CHARACTER_MAXIMUM_LENGTH.getDataType()).as(col.CHARACTER_MAXIMUM_LENGTH),
|
||||
field("(information_schema._pg_numeric_precision(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)))::information_schema.cardinal_number", col.NUMERIC_PRECISION.getDataType()).as(col.NUMERIC_PRECISION),
|
||||
field("(information_schema._pg_numeric_scale(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)))::information_schema.cardinal_number", col.NUMERIC_SCALE.getDataType()).as(col.NUMERIC_SCALE),
|
||||
field("({0})::information_schema.yes_or_no", col.IS_NULLABLE.getDataType(),
|
||||
when(condition(a.ATTNOTNULL).or(t.TYPTYPE.eq(inline("d")).and(t.TYPNOTNULL)), inline("NO"))
|
||||
.otherwise(inline("YES"))).as(col.IS_NULLABLE),
|
||||
field("(pg_get_expr({0}, {1}))::information_schema.character_data", col.COLUMN_DEFAULT.getDataType(), ad.ADBIN, ad.ADRELID).as(col.COLUMN_DEFAULT),
|
||||
field("({0})::information_schema.sql_identifier", col.UDT_SCHEMA.getDataType(),
|
||||
nvl(nbt.NSPNAME, nt.NSPNAME)).as(col.UDT_SCHEMA),
|
||||
field("({0})::information_schema.sql_identifier", col.UDT_NAME.getDataType(),
|
||||
nvl(bt.TYPNAME, t.TYPNAME)).as(col.UDT_NAME),
|
||||
PG_DESCRIPTION.DESCRIPTION)
|
||||
.from(a
|
||||
.leftJoin(ad)
|
||||
.on(a.ATTRELID.eq(ad.ADRELID))
|
||||
.and(a.ATTNUM.eq(ad.ADNUM))
|
||||
.join(c
|
||||
.join(nc)
|
||||
.on(c.RELNAMESPACE.eq(oid(nc))))
|
||||
.on(a.ATTRELID.eq(oid(c)))
|
||||
.join(t
|
||||
.join(nt)
|
||||
.on(t.TYPNAMESPACE.eq(oid(nt))))
|
||||
.on(a.ATTTYPID.eq(oid(t))))
|
||||
.leftJoin(bt
|
||||
.join(nbt)
|
||||
.on(bt.TYPNAMESPACE.eq(oid(nbt))))
|
||||
.on(t.TYPTYPE.eq(inline("d")).and(t.TYPBASETYPE.eq(oid(bt))))
|
||||
.leftJoin(co
|
||||
.join(nco)
|
||||
.on(co.COLLNAMESPACE.eq(oid(nco))))
|
||||
.on(a.ATTCOLLATION.eq(oid(co)).and(
|
||||
nco.NSPNAME.ne(inline("pg_catalog")).or(co.COLLNAME.ne(inline("default")))
|
||||
))
|
||||
.leftJoin(PG_DESCRIPTION)
|
||||
.on(PG_DESCRIPTION.OBJOID.eq(oid(c)))
|
||||
.and(PG_DESCRIPTION.OBJSUBID.eq(a.ATTNUM.coerce(PG_DESCRIPTION.OBJSUBID)))
|
||||
.where(
|
||||
not(condition("pg_is_other_temp_schema({0})", oid(nc)))
|
||||
.and(a.ATTNUM.gt(inline((short) 0)))
|
||||
.and(not(a.ATTISDROPPED))
|
||||
.and(c.RELKIND.eq(inline("m")))
|
||||
.and(nc.NSPNAME.in(getSchema().getName()))
|
||||
.and(c.RELNAME.eq(getName())))
|
||||
.orderBy(a.ATTNUM)) {
|
||||
|
||||
SchemaDefinition typeSchema = null;
|
||||
|
||||
String schemaName = record.getValue(COLUMNS.UDT_SCHEMA);
|
||||
if (schemaName != null)
|
||||
typeSchema = getDatabase().getSchema(schemaName);
|
||||
|
||||
DataTypeDefinition type = new DefaultDataTypeDefinition(
|
||||
getDatabase(),
|
||||
typeSchema,
|
||||
record.getValue(COLUMNS.DATA_TYPE),
|
||||
record.getValue(COLUMNS.CHARACTER_MAXIMUM_LENGTH),
|
||||
record.getValue(COLUMNS.NUMERIC_PRECISION),
|
||||
record.getValue(COLUMNS.NUMERIC_SCALE),
|
||||
record.getValue(COLUMNS.IS_NULLABLE, boolean.class),
|
||||
record.getValue(COLUMNS.COLUMN_DEFAULT) != null,
|
||||
record.getValue(COLUMNS.UDT_NAME)
|
||||
);
|
||||
|
||||
ColumnDefinition column = new DefaultColumnDefinition(
|
||||
getDatabase().getTable(getSchema(), getName()),
|
||||
record.getValue(COLUMNS.COLUMN_NAME),
|
||||
record.getValue(COLUMNS.ORDINAL_POSITION, int.class),
|
||||
type,
|
||||
defaultString(record.getValue(COLUMNS.COLUMN_DEFAULT)).startsWith("nextval"),
|
||||
record.getValue(PG_DESCRIPTION.DESCRIPTION)
|
||||
);
|
||||
|
||||
result.add(column);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
/**
|
||||
* This class is generated by jOOQ
|
||||
*/
|
||||
package org.jooq.util.postgres.pg_catalog;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Generated;
|
||||
|
||||
import org.jooq.Schema;
|
||||
import org.jooq.impl.CatalogImpl;
|
||||
|
||||
|
||||
/**
|
||||
* This class is generated by jOOQ.
|
||||
*/
|
||||
@Generated(
|
||||
value = {
|
||||
"http://www.jooq.org",
|
||||
"jOOQ version:3.8.0"
|
||||
},
|
||||
comments = "This class is generated by jOOQ"
|
||||
)
|
||||
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||
public class DefaultCatalog extends CatalogImpl {
|
||||
|
||||
private static final long serialVersionUID = 2037041374;
|
||||
|
||||
/**
|
||||
* The reference instance of <code></code>
|
||||
*/
|
||||
public static final DefaultCatalog DEFAULT_CATALOG = new DefaultCatalog();
|
||||
|
||||
/**
|
||||
* No further instances allowed
|
||||
*/
|
||||
private DefaultCatalog() {
|
||||
super("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public final List<Schema> getSchemas() {
|
||||
List result = new ArrayList();
|
||||
result.addAll(getSchemas0());
|
||||
return result;
|
||||
}
|
||||
|
||||
private final List<Schema> getSchemas0() {
|
||||
return Arrays.<Schema>asList(
|
||||
PgCatalog.PG_CATALOG);
|
||||
}
|
||||
}
|
||||
@ -12,8 +12,10 @@ import javax.annotation.Generated;
|
||||
|
||||
import org.jooq.Table;
|
||||
import org.jooq.impl.SchemaImpl;
|
||||
import org.jooq.util.postgres.pg_catalog.tables.PgAttrdef;
|
||||
import org.jooq.util.postgres.pg_catalog.tables.PgAttribute;
|
||||
import org.jooq.util.postgres.pg_catalog.tables.PgClass;
|
||||
import org.jooq.util.postgres.pg_catalog.tables.PgCollation;
|
||||
import org.jooq.util.postgres.pg_catalog.tables.PgConstraint;
|
||||
import org.jooq.util.postgres.pg_catalog.tables.PgCursor;
|
||||
import org.jooq.util.postgres.pg_catalog.tables.PgDescription;
|
||||
@ -37,7 +39,7 @@ import org.jooq.util.postgres.pg_catalog.tables.PgType;
|
||||
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||
public class PgCatalog extends SchemaImpl {
|
||||
|
||||
private static final long serialVersionUID = 1107728347;
|
||||
private static final long serialVersionUID = -1493849473;
|
||||
|
||||
/**
|
||||
* The reference instance of <code>pg_catalog</code>
|
||||
@ -48,7 +50,7 @@ public class PgCatalog extends SchemaImpl {
|
||||
* No further instances allowed
|
||||
*/
|
||||
private PgCatalog() {
|
||||
super("pg_catalog");
|
||||
super("pg_catalog", DefaultCatalog.DEFAULT_CATALOG);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -60,8 +62,10 @@ public class PgCatalog extends SchemaImpl {
|
||||
|
||||
private final List<Table<?>> getTables0() {
|
||||
return Arrays.<Table<?>>asList(
|
||||
PgAttrdef.PG_ATTRDEF,
|
||||
PgAttribute.PG_ATTRIBUTE,
|
||||
PgClass.PG_CLASS,
|
||||
PgCollation.PG_COLLATION,
|
||||
PgConstraint.PG_CONSTRAINT,
|
||||
PgCursor.PG_CURSOR,
|
||||
PgDescription.PG_DESCRIPTION,
|
||||
|
||||
@ -6,8 +6,10 @@ package org.jooq.util.postgres.pg_catalog;
|
||||
|
||||
import javax.annotation.Generated;
|
||||
|
||||
import org.jooq.util.postgres.pg_catalog.tables.PgAttrdef;
|
||||
import org.jooq.util.postgres.pg_catalog.tables.PgAttribute;
|
||||
import org.jooq.util.postgres.pg_catalog.tables.PgClass;
|
||||
import org.jooq.util.postgres.pg_catalog.tables.PgCollation;
|
||||
import org.jooq.util.postgres.pg_catalog.tables.PgConstraint;
|
||||
import org.jooq.util.postgres.pg_catalog.tables.PgCursor;
|
||||
import org.jooq.util.postgres.pg_catalog.tables.PgDescription;
|
||||
@ -31,6 +33,11 @@ import org.jooq.util.postgres.pg_catalog.tables.PgType;
|
||||
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||
public class Tables {
|
||||
|
||||
/**
|
||||
* The table pg_catalog.pg_attrdef
|
||||
*/
|
||||
public static final PgAttrdef PG_ATTRDEF = org.jooq.util.postgres.pg_catalog.tables.PgAttrdef.PG_ATTRDEF;
|
||||
|
||||
/**
|
||||
* The table pg_catalog.pg_attribute
|
||||
*/
|
||||
@ -41,6 +48,11 @@ public class Tables {
|
||||
*/
|
||||
public static final PgClass PG_CLASS = org.jooq.util.postgres.pg_catalog.tables.PgClass.PG_CLASS;
|
||||
|
||||
/**
|
||||
* The table pg_catalog.pg_collation
|
||||
*/
|
||||
public static final PgCollation PG_COLLATION = org.jooq.util.postgres.pg_catalog.tables.PgCollation.PG_COLLATION;
|
||||
|
||||
/**
|
||||
* The table pg_catalog.pg_constraint
|
||||
*/
|
||||
|
||||
@ -0,0 +1,101 @@
|
||||
/**
|
||||
* This class is generated by jOOQ
|
||||
*/
|
||||
package org.jooq.util.postgres.pg_catalog.tables;
|
||||
|
||||
|
||||
import javax.annotation.Generated;
|
||||
|
||||
import org.jooq.Field;
|
||||
import org.jooq.Record;
|
||||
import org.jooq.Table;
|
||||
import org.jooq.TableField;
|
||||
import org.jooq.impl.TableImpl;
|
||||
import org.jooq.util.postgres.pg_catalog.PgCatalog;
|
||||
|
||||
|
||||
/**
|
||||
* This class is generated by jOOQ.
|
||||
*/
|
||||
@Generated(
|
||||
value = {
|
||||
"http://www.jooq.org",
|
||||
"jOOQ version:3.8.0"
|
||||
},
|
||||
comments = "This class is generated by jOOQ"
|
||||
)
|
||||
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||
public class PgAttrdef extends TableImpl<Record> {
|
||||
|
||||
private static final long serialVersionUID = -772871199;
|
||||
|
||||
/**
|
||||
* The reference instance of <code>pg_catalog.pg_attrdef</code>
|
||||
*/
|
||||
public static final PgAttrdef PG_ATTRDEF = new PgAttrdef();
|
||||
|
||||
/**
|
||||
* The class holding records for this type
|
||||
*/
|
||||
@Override
|
||||
public Class<Record> getRecordType() {
|
||||
return Record.class;
|
||||
}
|
||||
|
||||
/**
|
||||
* The column <code>pg_catalog.pg_attrdef.adrelid</code>.
|
||||
*/
|
||||
public final TableField<Record, Long> ADRELID = createField("adrelid", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>pg_catalog.pg_attrdef.adnum</code>.
|
||||
*/
|
||||
public final TableField<Record, Short> ADNUM = createField("adnum", org.jooq.impl.SQLDataType.SMALLINT.nullable(false), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>pg_catalog.pg_attrdef.adbin</code>.
|
||||
*/
|
||||
public final TableField<Record, Object> ADBIN = createField("adbin", org.jooq.impl.DefaultDataType.getDefaultDataType("pg_node_tree"), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>pg_catalog.pg_attrdef.adsrc</code>.
|
||||
*/
|
||||
public final TableField<Record, String> ADSRC = createField("adsrc", org.jooq.impl.SQLDataType.CLOB, this, "");
|
||||
|
||||
/**
|
||||
* Create a <code>pg_catalog.pg_attrdef</code> table reference
|
||||
*/
|
||||
public PgAttrdef() {
|
||||
this("pg_attrdef", null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an aliased <code>pg_catalog.pg_attrdef</code> table reference
|
||||
*/
|
||||
public PgAttrdef(String alias) {
|
||||
this(alias, PG_ATTRDEF);
|
||||
}
|
||||
|
||||
private PgAttrdef(String alias, Table<Record> aliased) {
|
||||
this(alias, aliased, null);
|
||||
}
|
||||
|
||||
private PgAttrdef(String alias, Table<Record> aliased, Field<?>[] parameters) {
|
||||
super(alias, PgCatalog.PG_CATALOG, aliased, parameters, "");
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public PgAttrdef as(String alias) {
|
||||
return new PgAttrdef(alias, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
public PgAttrdef rename(String name) {
|
||||
return new PgAttrdef(name, null);
|
||||
}
|
||||
}
|
||||
@ -27,7 +27,7 @@ import org.jooq.util.postgres.pg_catalog.PgCatalog;
|
||||
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||
public class PgClass extends TableImpl<Record> {
|
||||
|
||||
private static final long serialVersionUID = -1795207531;
|
||||
private static final long serialVersionUID = -1454094151;
|
||||
|
||||
/**
|
||||
* The reference instance of <code>pg_catalog.pg_class</code>
|
||||
@ -162,6 +162,11 @@ public class PgClass extends TableImpl<Record> {
|
||||
*/
|
||||
public final TableField<Record, Boolean> RELROWSECURITY = createField("relrowsecurity", org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>pg_catalog.pg_class.relforcerowsecurity</code>.
|
||||
*/
|
||||
public final TableField<Record, Boolean> RELFORCEROWSECURITY = createField("relforcerowsecurity", org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>pg_catalog.pg_class.relispopulated</code>.
|
||||
*/
|
||||
|
||||
@ -0,0 +1,111 @@
|
||||
/**
|
||||
* This class is generated by jOOQ
|
||||
*/
|
||||
package org.jooq.util.postgres.pg_catalog.tables;
|
||||
|
||||
|
||||
import javax.annotation.Generated;
|
||||
|
||||
import org.jooq.Field;
|
||||
import org.jooq.Record;
|
||||
import org.jooq.Table;
|
||||
import org.jooq.TableField;
|
||||
import org.jooq.impl.TableImpl;
|
||||
import org.jooq.util.postgres.pg_catalog.PgCatalog;
|
||||
|
||||
|
||||
/**
|
||||
* This class is generated by jOOQ.
|
||||
*/
|
||||
@Generated(
|
||||
value = {
|
||||
"http://www.jooq.org",
|
||||
"jOOQ version:3.8.0"
|
||||
},
|
||||
comments = "This class is generated by jOOQ"
|
||||
)
|
||||
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||
public class PgCollation extends TableImpl<Record> {
|
||||
|
||||
private static final long serialVersionUID = 39183355;
|
||||
|
||||
/**
|
||||
* The reference instance of <code>pg_catalog.pg_collation</code>
|
||||
*/
|
||||
public static final PgCollation PG_COLLATION = new PgCollation();
|
||||
|
||||
/**
|
||||
* The class holding records for this type
|
||||
*/
|
||||
@Override
|
||||
public Class<Record> getRecordType() {
|
||||
return Record.class;
|
||||
}
|
||||
|
||||
/**
|
||||
* The column <code>pg_catalog.pg_collation.collname</code>.
|
||||
*/
|
||||
public final TableField<Record, String> COLLNAME = createField("collname", org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>pg_catalog.pg_collation.collnamespace</code>.
|
||||
*/
|
||||
public final TableField<Record, Long> COLLNAMESPACE = createField("collnamespace", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>pg_catalog.pg_collation.collowner</code>.
|
||||
*/
|
||||
public final TableField<Record, Long> COLLOWNER = createField("collowner", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>pg_catalog.pg_collation.collencoding</code>.
|
||||
*/
|
||||
public final TableField<Record, Integer> COLLENCODING = createField("collencoding", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>pg_catalog.pg_collation.collcollate</code>.
|
||||
*/
|
||||
public final TableField<Record, String> COLLCOLLATE = createField("collcollate", org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>pg_catalog.pg_collation.collctype</code>.
|
||||
*/
|
||||
public final TableField<Record, String> COLLCTYPE = createField("collctype", org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, "");
|
||||
|
||||
/**
|
||||
* Create a <code>pg_catalog.pg_collation</code> table reference
|
||||
*/
|
||||
public PgCollation() {
|
||||
this("pg_collation", null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an aliased <code>pg_catalog.pg_collation</code> table reference
|
||||
*/
|
||||
public PgCollation(String alias) {
|
||||
this(alias, PG_COLLATION);
|
||||
}
|
||||
|
||||
private PgCollation(String alias, Table<Record> aliased) {
|
||||
this(alias, aliased, null);
|
||||
}
|
||||
|
||||
private PgCollation(String alias, Table<Record> aliased, Field<?>[] parameters) {
|
||||
super(alias, PgCatalog.PG_CATALOG, aliased, parameters, "");
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public PgCollation as(String alias) {
|
||||
return new PgCollation(alias, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
public PgCollation rename(String name) {
|
||||
return new PgCollation(name, null);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user