Skip to content

Commit e26c03e

Browse files
committed
renamed user -> username; pass -> password;
1 parent f43913e commit e26c03e

21 files changed

+118
-140
lines changed

cpp_test/test_line_sender.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -812,16 +812,16 @@ TEST_CASE("HTTP basics") {
812812
"localhost",
813813
1};
814814
questdb::ingress::opts opts1conf = questdb::ingress::opts::from_conf(
815-
"http::addr=localhost:1;user=user;pass=pass;request_timeout=5000;retry_timeout=5;");
815+
"http::addr=localhost:1;username=user;password=pass;request_timeout=5000;retry_timeout=5;");
816816
questdb::ingress::opts opts2{
817817
questdb::ingress::line_sender_protocol::http,
818818
"localhost",
819819
"1"};
820820
questdb::ingress::opts opts2conf = questdb::ingress::opts::from_conf(
821821
"http::addr=localhost:1;token=token;request_min_throughput=1000;retry_timeout=0;");
822822
opts1
823-
.user("user")
824-
.pass("pass")
823+
.username("user")
824+
.password("pass")
825825
.max_buf_size(1000000)
826826
.request_timeout(5000)
827827
.retry_timeout(5);

examples/line_sender_c_example_auth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ static bool example(const char* host, const char* port)
1111
line_sender_buffer* buffer = NULL;
1212
char* conf_str = concat(
1313
"tcp::addr=", host, ":", port, ";",
14-
"user=testUser1;",
14+
"username=testUser1;",
1515
"token=5UjEMuA0Pj5pjK8a-fa24dyIf-Es5mYny3oE_Wmus48;"
1616
"token_x=fLKYEaoEb9lrn3nkwLDA-M_xnuFOdSt9y0Z7_vWSHLU;"
1717
"token_y=Dt5tbS1dEDMSYfym3fgMv0B99szno-dFc1rYF9t0aac;");

examples/line_sender_c_example_auth_tls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ static bool example(const char* host, const char* port)
1111
line_sender_buffer* buffer = NULL;
1212
char* conf_str = concat(
1313
"tcps::addr=", host, ":", port, ";",
14-
"user=testUser1;",
14+
"username=testUser1;",
1515
"token=5UjEMuA0Pj5pjK8a-fa24dyIf-Es5mYny3oE_Wmus48;"
1616
"token_x=fLKYEaoEb9lrn3nkwLDA-M_xnuFOdSt9y0Z7_vWSHLU;"
1717
"token_y=Dt5tbS1dEDMSYfym3fgMv0B99szno-dFc1rYF9t0aac;");

examples/line_sender_c_example_http.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ static bool example(const char* host, const char* port)
1010
line_sender* sender = NULL;
1111
line_sender_buffer* buffer = NULL;
1212
// Use `https` to enable TLS.
13-
// Use `user=...;pass=...;` or `token=...` for authentication.
13+
// Use `username=...;password=...;` or `token=...` for authentication.
1414
char* conf_str = concat("http::addr=", host, ":", port, ";");
1515
if (!conf_str) {
1616
fprintf(stderr, "Could not concatenate connection string.\n");

examples/line_sender_c_example_tls_ca.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ static bool example(const char* ca_path, const char* host, const char* port)
1212
char* conf_str = concat(
1313
"tcps::addr=", host, ":", port, ";",
1414
"tls_roots=", ca_path, ";",
15-
"user=testUser1;",
15+
"username=testUser1;",
1616
"token=5UjEMuA0Pj5pjK8a-fa24dyIf-Es5mYny3oE_Wmus48;"
1717
"token_x=fLKYEaoEb9lrn3nkwLDA-M_xnuFOdSt9y0Z7_vWSHLU;"
1818
"token_y=Dt5tbS1dEDMSYfym3fgMv0B99szno-dFc1rYF9t0aac;");

examples/line_sender_cpp_example_auth.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ static bool example(std::string_view host, std::string_view port)
1010
{
1111
auto sender = questdb::ingress::line_sender::from_conf(
1212
"tcp::addr=" + std::string{host} + ":" + std::string{port} + ";"
13-
"user=testUser1;"
13+
"username=testUser1;"
1414
"token=5UjEMuA0Pj5pjK8a-fa24dyIf-Es5mYny3oE_Wmus48;"
1515
"token_x=fLKYEaoEb9lrn3nkwLDA-M_xnuFOdSt9y0Z7_vWSHLU;"
1616
"token_y=Dt5tbS1dEDMSYfym3fgMv0B99szno-dFc1rYF9t0aac;");

examples/line_sender_cpp_example_auth_tls.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ static bool example(
1212
{
1313
auto sender = questdb::ingress::line_sender::from_conf(
1414
"tcps::addr=" + std::string{host} + ":" + std::string{port} + ";"
15-
"user=testUser1;"
15+
"username=testUser1;"
1616
"token=5UjEMuA0Pj5pjK8a-fa24dyIf-Es5mYny3oE_Wmus48;"
1717
"token_x=fLKYEaoEb9lrn3nkwLDA-M_xnuFOdSt9y0Z7_vWSHLU;"
1818
"token_y=Dt5tbS1dEDMSYfym3fgMv0B99szno-dFc1rYF9t0aac;");

examples/line_sender_cpp_example_tls_ca.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ static bool example(
1313
{
1414
auto sender = questdb::ingress::line_sender::from_conf(
1515
"tcps::addr=" + std::string{host} + ":" + std::string{port} + ";"
16-
"user=testUser1;"
16+
"username=testUser1;"
1717
"token=5UjEMuA0Pj5pjK8a-fa24dyIf-Es5mYny3oE_Wmus48;"
1818
"token_x=fLKYEaoEb9lrn3nkwLDA-M_xnuFOdSt9y0Z7_vWSHLU;"
1919
"token_y=Dt5tbS1dEDMSYfym3fgMv0B99szno-dFc1rYF9t0aac;"

include/questdb/ingress/line_sender.h

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ typedef struct line_sender_opts line_sender_opts;
550550
* The format of the string is: "tcp::addr=host:port;key=value;...;"
551551
* Alongside "tcp" you can also specify "tcps", "http", and "https".
552552
* The accepted set of keys and values is the same as for the opt's API.
553-
* E.g. "tcp::addr=host:port;user=alice;password=secret;tls_ca=os_roots;"
553+
* E.g. "tcp::addr=host:port;username=alice;password=secret;tls_ca=os_roots;"
554554
*/
555555
LINESENDER_API
556556
line_sender_opts* line_sender_opts_from_conf(
@@ -621,22 +621,22 @@ bool line_sender_opts_bind_interface(
621621
* The other fields are `token` `token_x` and `token_y`.
622622
*
623623
* For HTTP this is part of basic authentication.
624-
* Also see `pass`.
624+
* Also see `password`.
625625
*/
626626
LINESENDER_API
627-
bool line_sender_opts_user(
627+
bool line_sender_opts_username(
628628
line_sender_opts* opts,
629-
line_sender_utf8 user,
629+
line_sender_utf8 username,
630630
line_sender_error** err_out);
631631

632632
/**
633633
* Set the password for basic HTTP authentication.
634-
* Also see `user`.
634+
* Also see `username`.
635635
*/
636636
LINESENDER_API
637-
bool line_sender_opts_pass(
637+
bool line_sender_opts_password(
638638
line_sender_opts* opts,
639-
line_sender_utf8 pass,
639+
line_sender_utf8 password,
640640
line_sender_error** err_out);
641641

642642
/**
@@ -758,7 +758,7 @@ bool line_sender_opts_request_min_throughput(
758758

759759
/**
760760
* Grace request timeout before relying on the minimum throughput logic.
761-
* The default is 5 seconds.
761+
* The default is 10 seconds.
762762
*/
763763
LINESENDER_API
764764
bool line_sender_opts_request_timeout(
@@ -794,7 +794,7 @@ line_sender* line_sender_build(
794794
* The format of the string is: "tcp::addr=host:port;key=value;...;"
795795
* Alongside "tcp" you can also specify "tcps", "http", and "https".
796796
* The accepted set of keys and values is the same as for the opt's API.
797-
* E.g. "tcp::addr=host:port;user=alice;password=secret;tls_ca=os_roots;"
797+
* E.g. "tcp::addr=host:port;username=alice;password=secret;tls_ca=os_roots;"
798798
*
799799
* For full list of keys and values, search this header for `bool line_sender_opts_`.
800800
*/
@@ -857,16 +857,6 @@ bool line_sender_flush_and_keep(
857857
const line_sender_buffer* buffer,
858858
line_sender_error** err_out);
859859

860-
/// Variant of `.flush()` that does not clear the buffer and allows for
861-
/// transactional flushes.
862-
///
863-
/// A transactional flush is simply a flush that ensures that all rows in
864-
/// the ILP buffer refer to the same table, thus allowing the server to
865-
/// treat the flush request as a single transaction.
866-
///
867-
/// This is because QuestDB does not support transactions spanning multiple
868-
/// tables.
869-
870860
/**
871861
* Variant of `.flush()` that does not clear the buffer and allows for
872862
* transactional flushes.

include/questdb/ingress/line_sender.hpp

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ namespace questdb::ingress
732732
* The format of the string is: "tcp::addr=host:port;key=value;...;"
733733
* Alongside "tcp" you can also specify "tcps", "http", and "https".
734734
* The accepted set of keys and values is the same as for the opt's API.
735-
* E.g. "tcp::addr=host:port;user=alice;password=secret;tls_ca=os_roots;"
735+
* E.g. "tcp::addr=host:port;username=alice;password=secret;tls_ca=os_roots;"
736736
*/
737737
static inline opts from_conf(utf8_view conf)
738738
{
@@ -831,49 +831,34 @@ namespace questdb::ingress
831831
return *this;
832832
}
833833

834-
// /**
835-
// * Set the username for authentication.
836-
// *
837-
// * For TCP this is the `kid` part of the ECDSA key set.
838-
// * The other fields are `token` `token_x` and `token_y`.
839-
// *
840-
// * For HTTP this is part of basic authentication.
841-
// * Also see `pass`.
842-
// */
843-
// LINESENDER_API
844-
// bool line_sender_opts_user(
845-
// line_sender_opts* opts,
846-
// line_sender_utf8 user,
847-
// line_sender_error** err_out);
848-
849834
/**
850835
* Set the username for basic HTTP authentication.
851836
*
852837
* For TCP this is the `kid` part of the ECDSA key set.
853838
* The other fields are `token` `token_x` and `token_y`.
854839
*
855840
* For HTTP this is part of basic authentication.
856-
* Also see `pass`.
841+
* Also see `password`.
857842
*/
858-
opts& user(utf8_view user)
843+
opts& username(utf8_view username)
859844
{
860845
line_sender_error::wrapped_call(
861-
::line_sender_opts_user,
846+
::line_sender_opts_username,
862847
_impl,
863-
user._impl);
848+
username._impl);
864849
return *this;
865850
}
866851

867852
/**
868853
* Set the password for basic HTTP authentication.
869-
* Also see `user`.
854+
* Also see `username`.
870855
*/
871-
opts& pass(utf8_view pass)
856+
opts& password(utf8_view password)
872857
{
873858
line_sender_error::wrapped_call(
874-
::line_sender_opts_pass,
859+
::line_sender_opts_password,
875860
_impl,
876-
pass._impl);
861+
password._impl);
877862
return *this;
878863
}
879864

@@ -1079,7 +1064,7 @@ namespace questdb::ingress
10791064
* The format of the string is: "tcp::addr=host:port;key=value;...;"
10801065
* Alongside "tcp" you can also specify "tcps", "http", and "https".
10811066
* The accepted set of keys and values is the same as for the opt's API.
1082-
* E.g. "tcp::addr=host:port;user=alice;password=secret;tls_ca=os_roots;"
1067+
* E.g. "tcp::addr=host:port;username=alice;password=secret;tls_ca=os_roots;"
10831068
*/
10841069
static inline line_sender from_conf(utf8_view conf)
10851070
{

questdb-rs-ffi/src/lib.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -890,10 +890,10 @@ pub unsafe extern "C" fn line_sender_buffer_at_now(
890890
pub struct line_sender_opts(SenderBuilder);
891891

892892
/// Create a new `ops` instance from configuration string.
893-
/// The format of the string is: "tcp::addr=host:port;ket=value;...;"
893+
/// The format of the string is: "tcp::addr=host:port;key=value;...;"
894894
/// Alongside "tcp" you can also specify "tcps", "http", and "https".
895895
/// The accepted set of keys and values is the same as for the opt's API.
896-
/// E.g. "tcp::addr=host:port;user=alice;password=secret;tls_ca=os_roots;"
896+
/// E.g. "tcp::addr=host:port;username=alice;password=secret;tls_ca=os_roots;"
897897
#[no_mangle]
898898
pub unsafe extern "C" fn line_sender_opts_from_conf(
899899
config: line_sender_utf8,
@@ -978,25 +978,25 @@ pub unsafe extern "C" fn line_sender_opts_bind_interface(
978978
/// The other fields are `token` `token_x` and `token_y`.
979979
///
980980
/// For HTTP this is part of basic authentication.
981-
/// Also see `pass`.
981+
/// Also see `password`.
982982
#[no_mangle]
983-
pub unsafe extern "C" fn line_sender_opts_user(
983+
pub unsafe extern "C" fn line_sender_opts_username(
984984
opts: *mut line_sender_opts,
985-
user: line_sender_utf8,
985+
username: line_sender_utf8,
986986
err_out: *mut *mut line_sender_error,
987987
) -> bool {
988-
upd_opts!(opts, err_out, user, user.as_str())
988+
upd_opts!(opts, err_out, username, username.as_str())
989989
}
990990

991991
/// Set the password for basic HTTP authentication.
992-
/// Also see `user`.
992+
/// Also see `username`.
993993
#[no_mangle]
994-
pub unsafe extern "C" fn line_sender_opts_pass(
994+
pub unsafe extern "C" fn line_sender_opts_password(
995995
opts: *mut line_sender_opts,
996-
pass: line_sender_utf8,
996+
password: line_sender_utf8,
997997
err_out: *mut *mut line_sender_error,
998998
) -> bool {
999-
upd_opts!(opts, err_out, pass, pass.as_str())
999+
upd_opts!(opts, err_out, password, password.as_str())
10001000
}
10011001

10021002
/// Token (Bearer) Authentication Parameters for ILP over HTTP,
@@ -1201,7 +1201,7 @@ pub unsafe extern "C" fn line_sender_build(
12011201
/// The format of the string is: "tcp::addr=host:port;key=value;...;"
12021202
/// Alongside "tcp" you can also specify "tcps", "http", and "https".
12031203
/// The accepted set of keys and values is the same as for the opt's API.
1204-
/// E.g. "tcp::addr=host:port;user=alice;password=secret;tls_ca=os_roots;"
1204+
/// E.g. "tcp::addr=host:port;username=alice;password=secret;tls_ca=os_roots;"
12051205
///
12061206
/// For full list of options, search this header for `bool line_sender_opts_`.
12071207
#[no_mangle]

questdb-rs/examples/auth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn main() -> Result<()> {
1212
.parse()
1313
.unwrap();
1414
let mut sender = SenderBuilder::new_tcp(host, port)
15-
.user("testUser1")? // kid
15+
.username("testUser1")? // kid
1616
.token("5UjEMuA0Pj5pjK8a-fa24dyIf-Es5mYny3oE_Wmus48")? // d
1717
.token_x("fLKYEaoEb9lrn3nkwLDA-M_xnuFOdSt9y0Z7_vWSHLU")? // x
1818
.token_y("Dt5tbS1dEDMSYfym3fgMv0B99szno-dFc1rYF9t0aac")? // y

questdb-rs/examples/auth_tls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn main() -> Result<()> {
1212
.parse()
1313
.unwrap();
1414
let mut sender = SenderBuilder::new_tcp(host, port)
15-
.user("testUser1")? // kid
15+
.username("testUser1")? // kid
1616
.token("5UjEMuA0Pj5pjK8a-fa24dyIf-Es5mYny3oE_Wmus48")? // d
1717
.token_x("fLKYEaoEb9lrn3nkwLDA-M_xnuFOdSt9y0Z7_vWSHLU")? // x
1818
.token_y("Dt5tbS1dEDMSYfym3fgMv0B99szno-dFc1rYF9t0aac")? // y

questdb-rs/examples/http.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use questdb::{
44
};
55

66
fn main() -> Result<()> {
7-
let mut sender = Sender::from_conf("https::addr=localhost:9000;user=foo;pass=bar;")?;
7+
let mut sender = Sender::from_conf("https::addr=localhost:9000;username=foo;password=bar;")?;
88
let mut buffer = Buffer::new();
99
buffer
1010
.table("sensors")?

0 commit comments

Comments
 (0)