migrate icon indicating copy to clipboard operation
migrate copied to clipboard

ClickHouse insert statement error

Open divanovGH opened this issue 3 years ago • 3 comments

I've got an error: insert statement supported only in the batch mode (use begin/commit) But ClickHouse doesn't support transaction

        CREATE TABLE IF NOT EXISTS owner_type (
        `id` String,
        `name` String
        )
        ENGINE = MergeTree()
        ORDER BY (id)
        INSERT INTO owner_type VALUES
        ('CUSTOMER', 'c'),
        ('ORGANIZATION', 'o')

divanovGH avatar Jun 29 '21 09:06 divanovGH

(details: insert statement supported only in the batch mode (use begin/commit))

divanovGH avatar Jun 29 '21 09:06 divanovGH

This is not a bug, it's how clickhouse golang driver works: https://github.com/ClickHouse/clickhouse-go Bulk write support : begin->prepare->(in loop exec)->commit

kchodnicki avatar Nov 08 '21 09:11 kchodnicki

I'm encountering the same problem. It's unclear to me from the comments whether or not it is possible to use golang-migrate to run a migration file that does an INSERT into a ClickHouse database. Is it possible, and if so how? TIA.

mackler avatar Sep 17 '22 14:09 mackler