2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

embulkで入力チェックする

Last updated at Posted at 2017-01-20

embulk

embulk 入力チェックでググって出てこなかったから考えた

使用したライブラリ

とにかく入力チェックしてダメだったらエラーで落とす作戦

  • partial/hoge.yml.liquid
- type: ruby_proc
    columns:
      - name: "{{ validate_column }}"
        proc: |
          -> (str, record) do
            return str if str.match(/\A[0-9]*\z/)

            raise "Validation error. invalid_column:{{ validate_column }} / invalid_record:#{record}"
          end
  • 呼び出し
{% include 'partial/hoge', validate_column: 'foo_column' %}

validationエラーで落とさない作戦

何も考えていない

2
2
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?