Class PostgreSqlSink

java.lang.Object
ch.ergon.adam.jooq.JooqSink
ch.ergon.adam.postgresql.PostgreSqlSink
All Implemented Interfaces:
ch.ergon.adam.core.db.interfaces.SchemaSink, AutoCloseable

public class PostgreSqlSink extends ch.ergon.adam.jooq.JooqSink
  • Field Summary

    Fields inherited from class ch.ergon.adam.jooq.JooqSink

    context, schema
  • Constructor Summary

    Constructors
    Constructor
    Description
    PostgreSqlSink(Connection dbConnection, String schema)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected String
    castIfNeeded(ch.ergon.adam.core.db.schema.Field sourceField, ch.ergon.adam.core.db.schema.Field targetField, org.jooq.DSLContext renderContext)
     
    void
    changeFieldType(ch.ergon.adam.core.db.schema.Field oldField, ch.ergon.adam.core.db.schema.Field newField, ch.ergon.adam.core.db.schema.DataType targetDataType)
     
    void
    copyData(ch.ergon.adam.core.db.schema.Table sourceTable, ch.ergon.adam.core.db.schema.Table targetTable, String sourceTableName)
     
    void
    createEnum(ch.ergon.adam.core.db.schema.DbEnum dbEnum)
     
    void
    dropEnum(ch.ergon.adam.core.db.schema.DbEnum dbEnum)
     
    void
    dropSequence(ch.ergon.adam.core.db.schema.Sequence sequence)
     
    void
    dropSequencesAndDefaults(ch.ergon.adam.core.db.schema.Table table)
     
    protected org.jooq.DataType<?>
    mapFieldToJooqType(ch.ergon.adam.core.db.schema.Field field)
     
    protected org.jooq.DataType<?>
    mapType(ch.ergon.adam.core.db.schema.Field field)
     

    Methods inherited from class ch.ergon.adam.jooq.JooqSink

    addField, adjustSequences, close, commitChanges, createConstraint, createForeignKey, createIndex, createSequence, createTable, createView, dropConstraint, dropDefault, dropField, dropForeignKey, dropIndex, dropTable, dropView, getDefaultValue, getFieldName, getTableName, mapRawType, renameTable, rollback, setDefault, setTargetSchema

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface ch.ergon.adam.core.db.interfaces.SchemaSink

    supportAlterAndDropField
  • Constructor Details

    • PostgreSqlSink

      public PostgreSqlSink(Connection dbConnection, String schema)
  • Method Details

    • dropEnum

      public void dropEnum(ch.ergon.adam.core.db.schema.DbEnum dbEnum)
      Specified by:
      dropEnum in interface ch.ergon.adam.core.db.interfaces.SchemaSink
      Overrides:
      dropEnum in class ch.ergon.adam.jooq.JooqSink
    • createEnum

      public void createEnum(ch.ergon.adam.core.db.schema.DbEnum dbEnum)
      Specified by:
      createEnum in interface ch.ergon.adam.core.db.interfaces.SchemaSink
      Overrides:
      createEnum in class ch.ergon.adam.jooq.JooqSink
    • changeFieldType

      public void changeFieldType(ch.ergon.adam.core.db.schema.Field oldField, ch.ergon.adam.core.db.schema.Field newField, ch.ergon.adam.core.db.schema.DataType targetDataType)
      Specified by:
      changeFieldType in interface ch.ergon.adam.core.db.interfaces.SchemaSink
      Overrides:
      changeFieldType in class ch.ergon.adam.jooq.JooqSink
    • mapType

      protected org.jooq.DataType<?> mapType(ch.ergon.adam.core.db.schema.Field field)
      Overrides:
      mapType in class ch.ergon.adam.jooq.JooqSink
    • mapFieldToJooqType

      protected org.jooq.DataType<?> mapFieldToJooqType(ch.ergon.adam.core.db.schema.Field field)
      Overrides:
      mapFieldToJooqType in class ch.ergon.adam.jooq.JooqSink
    • copyData

      public void copyData(ch.ergon.adam.core.db.schema.Table sourceTable, ch.ergon.adam.core.db.schema.Table targetTable, String sourceTableName)
      Specified by:
      copyData in interface ch.ergon.adam.core.db.interfaces.SchemaSink
      Overrides:
      copyData in class ch.ergon.adam.jooq.JooqSink
    • castIfNeeded

      protected String castIfNeeded(ch.ergon.adam.core.db.schema.Field sourceField, ch.ergon.adam.core.db.schema.Field targetField, org.jooq.DSLContext renderContext)
      Overrides:
      castIfNeeded in class ch.ergon.adam.jooq.JooqSink
    • dropSequencesAndDefaults

      public void dropSequencesAndDefaults(ch.ergon.adam.core.db.schema.Table table)
      Specified by:
      dropSequencesAndDefaults in interface ch.ergon.adam.core.db.interfaces.SchemaSink
      Overrides:
      dropSequencesAndDefaults in class ch.ergon.adam.jooq.JooqSink
    • dropSequence

      public void dropSequence(ch.ergon.adam.core.db.schema.Sequence sequence)
      Specified by:
      dropSequence in interface ch.ergon.adam.core.db.interfaces.SchemaSink
      Overrides:
      dropSequence in class ch.ergon.adam.jooq.JooqSink