Skip to content

Commit ce3d250

Browse files
cursoragentlovasoa
andcommitted
feat: Remove ODBC max column size limit and warn on password
Co-authored-by: contact <[email protected]>
1 parent 94c274d commit ce3d250

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/webserver/database/connect.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ fn set_custom_connect_options(options: &mut AnyConnectOptions, config: &AppConfi
208208
if let Some(sqlite_options) = options.as_sqlite_mut() {
209209
set_custom_connect_options_sqlite(sqlite_options, config);
210210
}
211+
// Allow fetching very large text fields when using ODBC by removing the max column size limit
212+
if let Some(odbc_options) = options.as_odbc_mut() {
213+
*odbc_options = std::mem::take(odbc_options).max_column_size(None);
214+
}
211215
}
212216

213217
fn set_custom_connect_options_sqlite(
@@ -242,6 +246,10 @@ fn set_database_password(options: &mut AnyConnectOptions, password: &str) {
242246
*opts = take(opts).password(password);
243247
} else if let Some(opts) = options.as_mssql_mut() {
244248
*opts = take(opts).password(password);
249+
} else if let Some(_opts) = options.as_odbc_mut() {
250+
log::warn!(
251+
"Setting a password for an ODBC connection is not supported via separate config; include credentials in the DSN or connection string"
252+
);
245253
} else if let Some(_opts) = options.as_sqlite_mut() {
246254
log::warn!("Setting a password for a SQLite database is not supported");
247255
} else {

0 commit comments

Comments
 (0)