oneuptime/Clickhouse/Docs/ClickhouseOps.md
2023-10-20 19:51:23 +01:00

612 B

Some basic commands for Clickhouse

Show tables in the database

show tables from oneuptime

Show table structure

DESCRIBE TABLE oneuptime.Span

Show table data

select * from table_name

Delete table data

truncate table_name

Delete table

drop table oneuptime.table_name 

Insert for nested data

INSERT INTO opentelemetry_spans (trace_id, span_id, attributes.key, attributes.value) VALUES 
('trace1', 'span1', ['key1', 'key2'], ['value1', 'value2']),
('trace2', 'span2', ['keyA', 'keyB'], ['valueA', 'valueB']);