Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
prmoore77 committed Jan 23, 2024
1 parent 928656d commit 7e69db2
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 45 deletions.
84 changes: 42 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,46 +273,46 @@ To see all the available options run `flight_sql --help`.
```bash
flight_sql --help
Allowed options:
--help produce this help message
-B [ --backend ] arg (=duckdb) Specify the database backend. Allowed
options: duckdb, sqlite.
-H [ --hostname ] arg Specify the hostname to listen on for
the Flight SQL Server. If not set, we
will use env var: 'FLIGHT_HOSTNAME'.If
that isn't set, we will use the default
of: '0.0.0.0'.
-R [ --port ] arg (=31337) Specify the port to listen on for the
Flight SQL Server.
-D [ --database-filename ] arg Specify the database filename (absolute
or relative to the current working
directory)
-U [ --username ] arg (=flight_username)
Specify the username to allow to
connect to the Flight SQL Server for
clients.
-P [ --password ] arg Specify the password to set on the
Flight SQL Server for clients to
connect with. If not set, we will use
env var: 'FLIGHT_PASSWORD'.If that
isn't set, the server will exit with
failure.
-S [ --secret-key ] arg Specify the secret key used to sign
JWTs issued by the Flight SQL Server.
If it isn't set, we use env var:
'SECRET_KEY'. If that isn't set, the
server will create a random secret key.
-T [ --tls ] arg Specify the TLS certificate and key
file paths.
-I [ --init-sql-commands ] arg Specify the SQL commands to run on
server startup.If not set, we will use
env var: 'INIT_SQL_COMMANDS'.
-F [ --init-sql-commands-file ] arg Specify a file containing SQL commands
to run on server startup.If not set, we
will use env var: 'INIT_SQL_COMMANDS_FI
LE'.
-M [ --mtls-ca-cert-filename ] arg Specify an optional mTLS CA certificate
path used to verify clients. The
certificate MUST be in PEM format.
-Q [ --print-queries ] Print queries run by clients to stdout
--help produce this help message
-B [ --backend ] arg (=duckdb) Specify the database backend. Allowed
options: duckdb, sqlite.
-H [ --hostname ] arg Specify the hostname to listen on for the
Flight SQL Server. If not set, we will
use env var: 'FLIGHT_HOSTNAME'. If that
isn't set, we will use the default of:
'0.0.0.0'.
-R [ --port ] arg (=31337) Specify the port to listen on for the
Flight SQL Server.
-D [ --database-filename ] arg Specify the database filename (absolute
or relative to the current working
directory)
-U [ --username ] arg Specify the username to allow to connect
to the Flight SQL Server for clients. If
not set, we will use env var:
'FLIGHT_USERNAME'. If that isn't set, we
will use the default of:
'flight_username'.
-P [ --password ] arg Specify the password to set on the Flight
SQL Server for clients to connect with.
If not set, we will use env var:
'FLIGHT_PASSWORD'. If that isn't set,
the server will exit with failure.
-S [ --secret-key ] arg Specify the secret key used to sign JWTs
issued by the Flight SQL Server. If it
isn't set, we use env var: 'SECRET_KEY'.
If that isn't set, the server will create
a random secret key.
-T [ --tls ] arg Specify the TLS certificate and key file
paths.
-I [ --init-sql-commands ] arg Specify the SQL commands to run on server
startup. If not set, we will use env
var: 'INIT_SQL_COMMANDS'.
-F [ --init-sql-commands-file ] arg Specify a file containing SQL commands to
run on server startup. If not set, we
will use env var: 'INIT_SQL_COMMANDS_FILE
'.
-M [ --mtls-ca-cert-filename ] arg Specify an optional mTLS CA certificate
path used to verify clients. The
certificate MUST be in PEM format.
-Q [ --print-queries ] Print queries run by clients to stdout
```

5 changes: 3 additions & 2 deletions src/flight_sql.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ int main(int argc, char **argv) {
"Specify the port to listen on for the Flight SQL Server.")
("database-filename,D", po::value<std::string>()->default_value(""),
"Specify the database filename (absolute or relative to the current working directory)")
("username,U", po::value<std::string>()->default_value("flight_username"),
"Specify the username to allow to connect to the Flight SQL Server for clients.")
("username,U", po::value<std::string>()->default_value(""),
"Specify the username to allow to connect to the Flight SQL Server for clients. If not set, we will use env var: 'FLIGHT_USERNAME'. "
"If that isn't set, we will use the default of: 'flight_username'.")
("password,P", po::value<std::string>()->default_value(""),
"Specify the password to set on the Flight SQL Server for clients to connect with. If not set, we will use env var: 'FLIGHT_PASSWORD'. "
"If that isn't set, the server will exit with failure.")
Expand Down
3 changes: 2 additions & 1 deletion src/library/flight_sql_library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ arrow::Result<std::shared_ptr<arrow::flight::sql::FlightSqlServerBase>> CreateFl
if (username.empty()) {
username = SafeGetEnvVarValue("FLIGHT_USERNAME");
if (username.empty()) {
username = "flight_username";
username = DEFAULT_FLIGHT_USERNAME;
}
}

if (password.empty()) {
Expand Down
1 change: 1 addition & 0 deletions src/library/include/flight_sql_library.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

// Constants
const std::string DEFAULT_FLIGHT_HOSTNAME = "0.0.0.0";
const std::string DEFAULT_FLIGHT_USERNAME = "flight_username";
const int DEFAULT_FLIGHT_PORT = 31337;

enum class BackendType {
Expand Down

0 comments on commit 7e69db2

Please sign in to comment.