|
| 1 | +// Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +// or more contributor license agreements. See the NOTICE file |
| 3 | +// distributed with this work for additional information |
| 4 | +// regarding copyright ownership. The ASF licenses this file |
| 5 | +// to you under the Apache License, Version 2.0 (the |
| 6 | +// "License"); you may not use this file except in compliance |
| 7 | +// with the License. You may obtain a copy of the License at |
| 8 | +// |
| 9 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +// |
| 11 | +// Unless required by applicable law or agreed to in writing, |
| 12 | +// software distributed under the License is distributed on an |
| 13 | +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +// KIND, either express or implied. See the License for the |
| 15 | +// specific language governing permissions and limitations |
| 16 | +// under the License. |
| 17 | + |
| 18 | +// platform.h includes windows.h, so it needs to be included first |
| 19 | +#include "arrow/flight/sql/odbc/odbc_impl/platform.h" |
| 20 | + |
| 21 | +#include "arrow/flight/sql/odbc/odbc_impl/config/configuration.h" |
| 22 | + |
| 23 | +namespace arrow::flight::sql::odbc { |
| 24 | + |
| 25 | +using config::Configuration; |
| 26 | + |
| 27 | +#if defined _WIN32 || defined _WIN64 |
| 28 | +/** |
| 29 | + * Display connection window for user to configure connection parameters. |
| 30 | + * |
| 31 | + * @param window_parent Parent window handle. |
| 32 | + * @param config Output configuration. |
| 33 | + * @return True on success and false on fail. |
| 34 | + */ |
| 35 | +bool DisplayConnectionWindow(void* window_parent, Configuration& config); |
| 36 | + |
| 37 | +/** |
| 38 | + * For SQLDriverConnect. |
| 39 | + * Display connection window for user to configure connection parameters. |
| 40 | + * |
| 41 | + * @param window_parent Parent window handle. |
| 42 | + * @param config Output configuration, presumed to be empty, it will be using values from |
| 43 | + * properties. |
| 44 | + * @param properties Output properties. |
| 45 | + * @return True on success and false on fail. |
| 46 | + */ |
| 47 | +bool DisplayConnectionWindow(void* window_parent, Configuration& config, |
| 48 | + Connection::ConnPropertyMap& properties); |
| 49 | +#endif |
| 50 | + |
| 51 | +/** |
| 52 | + * Register DSN with specified configuration. |
| 53 | + * |
| 54 | + * @param config Configuration. |
| 55 | + * @param driver Driver. |
| 56 | + * @return True on success and false on fail. |
| 57 | + */ |
| 58 | +bool RegisterDsn(const Configuration& config, LPCWSTR driver); |
| 59 | + |
| 60 | +/** |
| 61 | + * Unregister specified DSN. |
| 62 | + * |
| 63 | + * @param dsn DSN name. |
| 64 | + * @return True on success and false on fail. |
| 65 | + */ |
| 66 | +bool UnregisterDsn(const std::wstring& dsn); |
| 67 | + |
| 68 | +} // namespace arrow::flight::sql::odbc |
0 commit comments