Sha256: aa617ae0ccbece8b799e257909f6f7009d1a7ca0365a8d313954125b5fb075c9
Contents?: true
Size: 860 Bytes
Versions: 6
Compression:
Stored size: 860 Bytes
Contents
require_relative "../helpers/errors" module CsvImportAnalyzer module PgQueryHelper def form_query_for_datatype(args) unless args[:datatype].nil? || args[:header].nil? if args[:datatype] == :string return args[:header].to_s + " varchar(255)" else return args[:header].to_s + " " + args[:datatype].to_s end else MissingRequiredArguments.new("Required arguments missing for form_query_for_datatype") end end def import_csv(args) unless args[:tablename].nil? || args[:filename].nil? || args[:delimiter].nil? pg_import_statement = "COPY #{args[:tablename]} FROM '#{args[:filename]}' HEADER DELIMITER '#{args[:delimiter]}' CSV NULL AS 'NULL';" else MissingRequiredArguments.new("Required arguments missing for import_csv") end end end end
Version data entries
6 entries across 6 versions & 1 rubygems