Daftar Isi:

#membuat database baru di clickhouse

berikut adalah perintah untuk membuat database baru di clickhouse

CREATE database nama_database
  • untuk melihat database
SHOW databases
  • memakai database
USE nama_database
  • membuat table
CREATE TABLE testing.user (
    id UInt32,
    nama String,
    umur UInt8,
    alamat String
) ENGINE = MergeTree()
ORDER BY id;
  • memeriksa table
DESCRIBE TABLE testing.user;
  • INSERT ke database
INSERT INTO testing.user (id, nama, umur, alamat) VALUES
(1, 'John Doe', 25, '123 Elm Street'),
(2, 'Jane Smith', 30, '456 Oak Avenue'),
(3, 'Alice Johnson', 22, '789 Maple Lane'),
(4, 'Bob Brown', 35, '321 Pine Road'),
(5, 'Charlie Green', 28, '654 Cedar Street'),
(6, 'David White', 40, '987 Birch Boulevard'),
(7, 'Eve Black', 27, '159 Willow Way'),
(8, 'Frank Adams', 33, '753 Fir Drive'),
(9, 'Grace Lee', 24, '852 Ash Lane'),
(10, 'Henry Wilson', 29, '951 Spruce Street');
  • query SELECT table
SELECT * FROM testing.user;

menjalankan CLI dbclickhouse docker

docker exec -it dbclickhouse-ch_client-1 clickhouse-client --host ch_server

#cek koneksi db clickhouse

db.ping().then(() => {
  console.log('Koneksi berhasil!')
}).catch((error:any) => {
  console.error('Koneksi gagal:', error)
})

Rabbit mq typescript

https://hassanfouad.medium.com/using-rabbitmq-with-nodejs-and-typescript-8b33d56a62cc