migrate
migrate copied to clipboard
ClickHouse insert statement error
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')
(details: insert statement supported only in the batch mode (use begin/commit))
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
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.