Sha256: dd6135784821f1479972c4920b212be327245023bacdd8840174a0666c0f6d26
Contents?: true
Size: 1.12 KB
Versions: 6
Compression:
Stored size: 1.12 KB
Contents
package org.embulk.input.postgresql.getter; import org.embulk.input.jdbc.JdbcColumn; import org.embulk.input.jdbc.JdbcColumnOption; import org.embulk.input.jdbc.getter.ColumnGetter; import org.embulk.input.jdbc.getter.ColumnGetterFactory; import org.embulk.spi.PageBuilder; import org.joda.time.DateTimeZone; public class PostgreSQLColumnGetterFactory extends ColumnGetterFactory { public PostgreSQLColumnGetterFactory(PageBuilder to, DateTimeZone defaultTimeZone) { super(to, defaultTimeZone); } @Override public ColumnGetter newColumnGetter(JdbcColumn column, JdbcColumnOption option) { if (column.getTypeName().equals("hstore")) { return new HstoreColumnGetter(to, getToType(option)); } else { return super.newColumnGetter(column, option); } } @Override protected String sqlTypeToValueType(JdbcColumn column, int sqlType) { if (column.getTypeName().equals("json") || column.getTypeName().equals("jsonb")) { return "json"; } else { return super.sqlTypeToValueType(column, sqlType); } } }
Version data entries
6 entries across 6 versions & 1 rubygems