Skip to content

Commit

Permalink
removed unused config options
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienR1 committed Oct 24, 2023
1 parent e991456 commit b23c44d
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 13 deletions.
2 changes: 0 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ HOST=http://127.0.0.1:8123
DATABASE=default
USERNAME=default
PASSWORD=
CREATE_DB=false

# Sink
QUEUE_LIMIT=10
QUEUE_CONCURRENCY=10
SCHEMA_URL=... # generate SQL schema by providing file (ex: ./schema.sql) or URL path (ex: https://example.com/schema.sql)
VERBOSE=true
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,12 @@ Options:
-V, --version output the version number
-p, --port <number> HTTP port on which to attach the sink (default: "3000", env: PORT)
-v, --verbose <boolean> Enable verbose logging (choices: "true", "false", default: "pretty", env: VERBOSE)
-s, --schema-url <string> Execute SQL instructions before starting the sink (env: SCHEMA_URL)
--public-key <string> Public key to validate messages (env: PUBLIC_KEY)
--auth-key <string> Auth key to validate requests (env: AUTH_KEY)
--host <string> Database HTTP hostname (default: "http://localhost:8123", env: HOST)
--database <string> The database to use inside ClickHouse (default: "default", env: DATABASE)
--username <string> Database user (default: "default", env: USERNAME)
--password <string> Password associated with the specified username (default: "", env: PASSWORD)
--create-database <boolean> If the specified database does not exist, automatically create it (default: "false", env: CREATE_DATABASE)
--async-insert <number> https://clickhouse.com/docs/en/operations/settings/settings#async-insert (choices: "0", "1", default: 1, env: ASYNC_INSERT)
--wait-for-insert <boolean> https://clickhouse.com/docs/en/operations/settings/settings#wait-for-async-insert (choices: "0", "1", default: 0, env: WAIT_FOR_INSERT)
--queue-limit <number> Insert delay to each response when the pqueue exceeds this value (default: 10, env: QUEUE_LIMIT)
Expand Down
3 changes: 0 additions & 3 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export const DEFAULT_HOST = "http://localhost:8123";
export const DEFAULT_DATABASE = "default";
export const DEFAULT_USERNAME = "default";
export const DEFAULT_PASSWORD = "";
export const DEFAULT_CREATE_DATABASE = "false";
export const DEFAULT_ASYNC_INSERT = 1;
export const DEFAULT_WAIT_FOR_ASYNC_INSERT = 0;
export const DEFAULT_QUEUE_LIMIT = 10;
Expand All @@ -29,14 +28,12 @@ export const opts = program
.addOption(new Option("-p, --port <number>", "HTTP port on which to attach the sink").env("PORT").default(DEFAULT_PORT))
.addOption(new Option("-v, --verbose <boolean>", "Enable verbose logging").choices(["true", "false"]).env("VERBOSE").default(DEFAULT_VERBOSE))
.addOption(new Option("--hostname <string>", "Server listen on HTTP hostname").env("HOSTNAME").default(DEFAULT_HOSTNAME))
.addOption(new Option("-s, --schema-url <string>", "Execute SQL instructions before starting the sink").env("SCHEMA_URL").preset(DEFAULT_SCHEMA_URL))
.addOption(new Option("--public-key <string>", "Public key to validate messages").env("PUBLIC_KEY"))
.addOption(new Option("--auth-key <string>", "Auth key to validate requests").env("AUTH_KEY"))
.addOption(new Option("--host <string>", "Database HTTP hostname").env("HOST").default(DEFAULT_HOST))
.addOption(new Option("--username <string>", "Database user").env("USERNAME").default(DEFAULT_USERNAME))
.addOption(new Option("--password <string>", "Password associated with the specified username").env("PASSWORD").default(DEFAULT_PASSWORD))
.addOption(new Option("--database <string>", "The database to use inside ClickHouse").env("DATABASE").default(DEFAULT_DATABASE))
.addOption(new Option("--create-database <boolean>", "If the specified database does not exist, automatically create it").env("CREATE_DATABASE").default(DEFAULT_CREATE_DATABASE))
.addOption(new Option("--async-insert <number>", "https://clickhouse.com/docs/en/operations/settings/settings#async-insert").choices(["0", "1"]).env("ASYNC_INSERT").default(DEFAULT_ASYNC_INSERT))
.addOption(new Option("--wait-for-async-insert <boolean>", "https://clickhouse.com/docs/en/operations/settings/settings#wait-for-async-insert").choices(["0", "1"]).env("WAIT_FOR_INSERT").default(DEFAULT_WAIT_FOR_ASYNC_INSERT))
.addOption(new Option("--queue-limit <number>","Insert delay to each response when the pqueue exceeds this value").env("QUEUE_LIMIT").default(DEFAULT_QUEUE_LIMIT))
Expand Down
4 changes: 0 additions & 4 deletions src/schemas.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ const config = ConfigSchema.parse({
hostname: "0.0.0.0",
publicKey: "a3cb7366ee8ca77225b4d41772e270e4e831d171d1de71d91707c42e7ba82cc9",
host: "http://127.0.0.1:8123",
schemaUrl: "./schema.sql",
database: "default",
username: "default",
password: "",
createDb: "false",
queueLimit: "10",
queueConcurrency: "10",
verbose: "true",
Expand All @@ -30,11 +28,9 @@ describe("ConfigSchema", () => {
test("port", () => expect(config.port).toBe(3000));
test("queueLimit", () => expect(config.queueLimit).toBe(10));
test("verbose", () => expect(config.verbose).toBe(true));
test("schemaUrl", () => expect(config.schemaUrl).toBe("./schema.sql"));
test("database", () => expect(config.database).toBe("default"));
test("username", () => expect(config.username).toBe("default"));
test("publicKey", () => expect(config.publicKey).toBe("a3cb7366ee8ca77225b4d41772e270e4e831d171d1de71d91707c42e7ba82cc9"));
test("waitForAsyncInsert", () => expect(config.waitForAsyncInsert).toBe(0));
test("asyncInsert", () => expect(config.asyncInsert).toBe(1));
test("createDatabase", () => expect(config.createDatabase).toBe(false));
});
2 changes: 0 additions & 2 deletions src/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ export const ConfigSchema = z.object({
database: z.string(),
username: z.string(),
password: z.string(),
createDatabase: boolean,
asyncInsert: oneOrZero,
waitForAsyncInsert: oneOrZero,
queueLimit: positiveNumber,
queueConcurrency: positiveNumber,
schemaUrl: z.optional(z.string()),
});
export type ConfigSchema = z.infer<typeof ConfigSchema>;

Expand Down

0 comments on commit b23c44d

Please sign in to comment.