Class PostgreSqlBulkWriter

All Implemented Interfaces:
Closeable, AutoCloseable, StatementsWriter

public class PostgreSqlBulkWriter extends FileStatementsWriter
Implementation of a StatementsWriter that writes bulk text files for each table, and references them in "COPY INTO".
Author:
Tobias Liefke
  • Constructor Details

    • PostgreSqlBulkWriter

      public PostgreSqlBulkWriter(GeneratorContext context) throws FileNotFoundException
      Creates a new instance for a SQL file with UTF-8 encoding. All bulk files will end up in the same directory as the given file.
      Parameters:
      context - the current generation context
      Throws:
      FileNotFoundException - if the directory is not available
    • PostgreSqlBulkWriter

      public PostgreSqlBulkWriter(GeneratorContext context, File sqlFile) throws FileNotFoundException
      Creates a new instance for a SQL file with UTF-8 encoding. All bulk files will end up in the same directory as the given file.
      Parameters:
      context - the current generation context
      sqlFile - the file that is feeded with all plain statements
      Throws:
      FileNotFoundException - if the directory is not available
    • PostgreSqlBulkWriter

      public PostgreSqlBulkWriter(GeneratorContext context, File sqlFile, Charset encoding) throws FileNotFoundException
      Creates a new instance for a SQL file. All bulk files will end up in the same directory as the given file.
      Parameters:
      context - the current generation context
      sqlFile - the file that is feeded with all plain statements
      encoding - the encoding of all written files
      Throws:
      FileNotFoundException - if the directory is not available
    • PostgreSqlBulkWriter

      public PostgreSqlBulkWriter(GeneratorContext context, File directory, Writer writer, Charset encoding)
      Creates a new instance of PostgreSqlBulkWriter.
      Parameters:
      context - the current generation context
      directory - the directory for the bulk files
      writer - the SQL file which contains the plain and the "COPY" statements
      encoding - The encoding of the bulk files.
  • Method Details