Skip to content

Commit 40055d9

Browse files
committed
Using clickhouse client rather than HTTP POST to create a database
1 parent fe900cb commit 40055d9

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

tests/clickhouse-test

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,14 +1313,22 @@ class TestCase:
13131313
)
13141314

13151315
database = f"test_{random_str()}"
1316-
1317-
clickhouse_execute(
1318-
args,
1319-
"CREATE DATABASE IF NOT EXISTS "
1320-
+ database
1321-
+ get_db_engine(testcase_args, database),
1322-
settings=get_create_database_settings(args, testcase_args),
1323-
)
1316+
command = f"{args.client}" \
1317+
+ " -q" \
1318+
+ " 'CREATE DATABASE IF NOT EXISTS " \
1319+
+ database \
1320+
+ get_db_engine(testcase_args, database) \
1321+
+ "' " \
1322+
+ TestCase.cli_format_settings(get_create_database_settings(args, testcase_args))
1323+
1324+
subprocess.check_call(command, shell=True)
1325+
# clickhouse_execute(
1326+
# args,
1327+
# "CREATE DATABASE IF NOT EXISTS "
1328+
# + database
1329+
# + get_db_engine(testcase_args, database),
1330+
# settings=get_create_database_settings(args, testcase_args),
1331+
# )
13241332

13251333
os.environ["CLICKHOUSE_DATABASE"] = database
13261334
# Set temporary directory to match the randomly generated database,

0 commit comments

Comments
 (0)