Skip to content

Commit 8b538ea

Browse files
authored
feat: Rust API. (#19)
1 parent 06974d9 commit 8b538ea

File tree

21 files changed

+1338
-473
lines changed

21 files changed

+1338
-473
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ target
22
build
33
.vs
44
.vscode
5-
src/tests/json_tests.rs
5+
questdb-rs/Cargo.lock
6+
questdb-rs/src/tests/json_tests.rs

CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ option(
2525
# Imports `questdb_client` target.
2626
add_subdirectory(corrosion)
2727
corrosion_import_crate(
28-
MANIFEST_PATH Cargo.toml
29-
FEATURES ffi
28+
MANIFEST_PATH questdb-rs-ffi/Cargo.toml
3029
LINK_AS C)
3130
target_include_directories(
3231
questdb_client INTERFACE
@@ -100,8 +99,8 @@ compile_example(
10099
# Include Rust tests as part of the tests run
101100
add_test(
102101
NAME rust_tests
103-
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
104-
COMMAND cargo test --features insecure_skip_verify -- --nocapture)
102+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/questdb-rs
103+
COMMAND cargo test --features insecure-skip-verify -- --nocapture)
105104

106105
# Unit test binaries.
107106
function(compile_test TARGET_NAME)

Cargo.toml

Lines changed: 0 additions & 47 deletions
This file was deleted.

ci/run_all_tests.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
import subprocess
2323

2424

25-
def run_cmd(*args):
25+
def run_cmd(*args, cwd=None):
2626
sys.stderr.write(f'About to run: {args!r}:\n')
2727
try:
28-
subprocess.check_call(args)
28+
subprocess.check_call(args, cwd=cwd)
2929
sys.stderr.write(f'Success running: {args!r}.\n')
3030
except subprocess.CalledProcessError as cpe:
3131
sys.stderr.write(f'Command {args!r} failed with return code {cpe.returncode}.\n')
@@ -38,11 +38,12 @@ def main():
3838
test_line_sender_path = next(iter(
3939
build_dir.glob(f'**/test_line_sender{exe_suffix}')))
4040
system_test_path = pathlib.Path('system_test') / 'test.py'
41-
qdb_v = '6.4.2' # The version of QuestDB we'll test against.
41+
qdb_v = '6.4.3' # The version of QuestDB we'll test against.
4242

4343
run_cmd('cargo', 'test',
44-
'--features', 'insecure_skip_verify',
45-
'--', '--nocapture')
44+
'--features', 'insecure-skip-verify',
45+
'--', '--nocapture',
46+
cwd='questdb-rs')
4647
run_cmd(str(test_line_sender_path))
4748
run_cmd('python3', str(system_test_path), 'run', '--versions', qdb_v, '-v')
4849

0 commit comments

Comments
 (0)